From e257408101b56908d3c80dffc624160fc8d97a1c Mon Sep 17 00:00:00 2001 From: Andy Wickham Date: Fri, 8 Sep 2023 17:10:49 -0700 Subject: [PATCH] Adds SystemActionConstants This includes the previously added Taskbar System Action, as well as a new one for Screen Search. Bug: 299321919 Test: Manual Change-Id: I4a8fa1dde402dc2de5f448cb2edbe712e128ff12 --- .../launcher3/taskbar/TaskbarManager.java | 9 +---- .../taskbar/TaskbarStashController.java | 2 +- .../quickstep/util/SystemActionConstants.java | 40 +++++++++++++++++++ 3 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 quickstep/src/com/android/quickstep/util/SystemActionConstants.java diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java index ba2116dedf..e922c4c2ac 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarManager.java @@ -27,6 +27,8 @@ import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NO_RECREA import static com.android.launcher3.util.DisplayController.TASKBAR_NOT_DESTROYED_TAG; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange; +import static com.android.quickstep.util.SystemActionConstants.ACTION_SHOW_TASKBAR; +import static com.android.quickstep.util.SystemActionConstants.SYSTEM_ACTION_ID_TASKBAR; import android.annotation.SuppressLint; import android.app.Activity; @@ -141,13 +143,6 @@ public class TaskbarManager { private boolean mUserUnlocked = false; - public static final int SYSTEM_ACTION_ID_TASKBAR = 499; - - /** - * For Taskbar broadcast intent filter. - */ - public static final String ACTION_SHOW_TASKBAR = "ACTION_SHOW_TASKBAR"; - private final SimpleBroadcastReceiver mTaskbarBroadcastReceiver = new SimpleBroadcastReceiver(this::showTaskbarFromBroadcast); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index ee4db73860..f2b60b952a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -29,10 +29,10 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_HIDE; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TRANSIENT_TASKBAR_SHOW; import static com.android.launcher3.taskbar.TaskbarKeyguardController.MASK_ANY_SYSUI_LOCKED; -import static com.android.launcher3.taskbar.TaskbarManager.SYSTEM_ACTION_ID_TASKBAR; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.launcher3.util.FlagDebugUtils.appendFlag; import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange; +import static com.android.quickstep.util.SystemActionConstants.SYSTEM_ACTION_ID_TASKBAR; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SHOWING; import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_IME_SWITCHER_SHOWING; diff --git a/quickstep/src/com/android/quickstep/util/SystemActionConstants.java b/quickstep/src/com/android/quickstep/util/SystemActionConstants.java new file mode 100644 index 0000000000..522930f792 --- /dev/null +++ b/quickstep/src/com/android/quickstep/util/SystemActionConstants.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2023 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.quickstep.util; + +/** + * Constants for registering SystemActions. + * + * Prefer to use AccessibilityService.GLOBAL_ACTION_* if applicable. + */ +public final class SystemActionConstants { + + public static final int SYSTEM_ACTION_ID_TASKBAR = 499; + public static final int SYSTEM_ACTION_ID_SEARCH_SCREEN = 500; + + /** + * For Taskbar broadcast intent filter. + */ + public static final String ACTION_SHOW_TASKBAR = "ACTION_SHOW_TASKBAR"; + + /** + * For Search Screen broadcast intent filter. + */ + public static final String ACTION_SEARCH_SCREEN = "ACTION_SEARCH_SCREEN"; + + private SystemActionConstants() {} +}