Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2010 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
Joe Onorato | 79de0c5 | 2010-05-26 17:03:26 -0400 | [diff] [blame] | 17 | package com.android.systemui.statusbar; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 18 | |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 19 | import static android.app.StatusBarManager.DISABLE2_NONE; |
| 20 | import static android.app.StatusBarManager.DISABLE_NONE; |
| 21 | import static android.view.Display.DEFAULT_DISPLAY; |
| 22 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 23 | import static com.android.systemui.statusbar.phone.StatusBar.ONLY_CORE_APPS; |
| 24 | |
| 25 | import android.app.StatusBarManager; |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 26 | import android.app.StatusBarManager.Disable2Flags; |
| 27 | import android.app.StatusBarManager.DisableFlags; |
| 28 | import android.app.StatusBarManager.WindowType; |
| 29 | import android.app.StatusBarManager.WindowVisibleState; |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 30 | import android.content.ComponentName; |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 31 | import android.content.Context; |
Jorim Jaggi | 8690558 | 2016-02-09 21:36:09 -0800 | [diff] [blame] | 32 | import android.graphics.Rect; |
Kevin Chyn | 23289ef | 2018-11-28 16:32:36 -0800 | [diff] [blame] | 33 | import android.hardware.biometrics.IBiometricServiceReceiverInternal; |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 34 | import android.hardware.display.DisplayManager; |
| 35 | import android.inputmethodservice.InputMethodService.BackDispositionMode; |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 36 | import android.os.Bundle; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 37 | import android.os.Handler; |
Joe Onorato | a0c56fe | 2010-05-20 10:21:52 -0700 | [diff] [blame] | 38 | import android.os.IBinder; |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 39 | import android.os.Looper; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 40 | import android.os.Message; |
Kevin Chyn | 1b9f8df | 2018-11-12 19:04:55 -0800 | [diff] [blame] | 41 | import android.util.Pair; |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 42 | import android.util.SparseArray; |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 43 | |
Aurimas Liutikas | fd52c14 | 2018-04-17 09:50:46 -0700 | [diff] [blame] | 44 | import androidx.annotation.VisibleForTesting; |
Winson | c0d7058 | 2016-01-29 10:24:39 -0800 | [diff] [blame] | 45 | |
Jorim Jaggi | 8690558 | 2016-02-09 21:36:09 -0800 | [diff] [blame] | 46 | import com.android.internal.os.SomeArgs; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 47 | import com.android.internal.statusbar.IStatusBar; |
| 48 | import com.android.internal.statusbar.StatusBarIcon; |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 49 | import com.android.systemui.SystemUI; |
Jason Monk | d7c9855 | 2018-12-04 11:14:50 -0500 | [diff] [blame] | 50 | import com.android.systemui.statusbar.CommandQueue.Callbacks; |
| 51 | import com.android.systemui.statusbar.policy.CallbackController; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 52 | |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 53 | import java.util.ArrayList; |
| 54 | |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 55 | /** |
| 56 | * This class takes the functions from IStatusBar that come in on |
| 57 | * binder pool threads and posts messages to get them onto the main |
| 58 | * thread, and calls onto Callbacks. It also takes care of |
Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 59 | * coalescing these calls so they don't stack up. For the calls |
| 60 | * are coalesced, note that they are all idempotent. |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 61 | */ |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 62 | public class CommandQueue extends IStatusBar.Stub implements CallbackController<Callbacks>, |
| 63 | DisplayManager.DisplayListener { |
Daniel Sandler | 1d4d30a | 2011-04-28 12:35:29 -0400 | [diff] [blame] | 64 | private static final int INDEX_MASK = 0xffff; |
| 65 | private static final int MSG_SHIFT = 16; |
| 66 | private static final int MSG_MASK = 0xffff << MSG_SHIFT; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 67 | |
Daniel Sandler | 1d4d30a | 2011-04-28 12:35:29 -0400 | [diff] [blame] | 68 | private static final int OP_SET_ICON = 1; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 69 | private static final int OP_REMOVE_ICON = 2; |
| 70 | |
Jaewan Kim | c552b04 | 2016-01-18 16:08:45 +0900 | [diff] [blame] | 71 | private static final int MSG_ICON = 1 << MSG_SHIFT; |
| 72 | private static final int MSG_DISABLE = 2 << MSG_SHIFT; |
| 73 | private static final int MSG_EXPAND_NOTIFICATIONS = 3 << MSG_SHIFT; |
| 74 | private static final int MSG_COLLAPSE_PANELS = 4 << MSG_SHIFT; |
| 75 | private static final int MSG_EXPAND_SETTINGS = 5 << MSG_SHIFT; |
| 76 | private static final int MSG_SET_SYSTEMUI_VISIBILITY = 6 << MSG_SHIFT; |
| 77 | private static final int MSG_TOP_APP_WINDOW_CHANGED = 7 << MSG_SHIFT; |
| 78 | private static final int MSG_SHOW_IME_BUTTON = 8 << MSG_SHIFT; |
| 79 | private static final int MSG_TOGGLE_RECENT_APPS = 9 << MSG_SHIFT; |
| 80 | private static final int MSG_PRELOAD_RECENT_APPS = 10 << MSG_SHIFT; |
| 81 | private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 11 << MSG_SHIFT; |
| 82 | private static final int MSG_SET_WINDOW_STATE = 12 << MSG_SHIFT; |
| 83 | private static final int MSG_SHOW_RECENT_APPS = 13 << MSG_SHIFT; |
| 84 | private static final int MSG_HIDE_RECENT_APPS = 14 << MSG_SHIFT; |
Jaewan Kim | c552b04 | 2016-01-18 16:08:45 +0900 | [diff] [blame] | 85 | private static final int MSG_SHOW_SCREEN_PIN_REQUEST = 18 << MSG_SHIFT; |
| 86 | private static final int MSG_APP_TRANSITION_PENDING = 19 << MSG_SHIFT; |
| 87 | private static final int MSG_APP_TRANSITION_CANCELLED = 20 << MSG_SHIFT; |
| 88 | private static final int MSG_APP_TRANSITION_STARTING = 21 << MSG_SHIFT; |
| 89 | private static final int MSG_ASSIST_DISCLOSURE = 22 << MSG_SHIFT; |
| 90 | private static final int MSG_START_ASSIST = 23 << MSG_SHIFT; |
| 91 | private static final int MSG_CAMERA_LAUNCH_GESTURE = 24 << MSG_SHIFT; |
| 92 | private static final int MSG_TOGGLE_KEYBOARD_SHORTCUTS = 25 << MSG_SHIFT; |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 93 | private static final int MSG_SHOW_PICTURE_IN_PICTURE_MENU = 26 << MSG_SHIFT; |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 94 | private static final int MSG_ADD_QS_TILE = 27 << MSG_SHIFT; |
| 95 | private static final int MSG_REMOVE_QS_TILE = 28 << MSG_SHIFT; |
| 96 | private static final int MSG_CLICK_QS_TILE = 29 << MSG_SHIFT; |
Phil Weaver | 315c34e | 2016-02-19 15:12:29 -0800 | [diff] [blame] | 97 | private static final int MSG_TOGGLE_APP_SPLIT_SCREEN = 30 << MSG_SHIFT; |
Jorim Jaggi | 2adba07 | 2016-03-03 13:43:39 +0100 | [diff] [blame] | 98 | private static final int MSG_APP_TRANSITION_FINISHED = 31 << MSG_SHIFT; |
Andrei Stingaceanu | 0bf096f | 2016-04-14 18:11:57 +0100 | [diff] [blame] | 99 | private static final int MSG_DISMISS_KEYBOARD_SHORTCUTS = 32 << MSG_SHIFT; |
Philip Quinn | c3a503d | 2017-07-18 23:23:41 -0700 | [diff] [blame] | 100 | private static final int MSG_HANDLE_SYSTEM_KEY = 33 << MSG_SHIFT; |
Jason Monk | 361915c | 2017-03-21 20:33:59 -0400 | [diff] [blame] | 101 | private static final int MSG_SHOW_GLOBAL_ACTIONS = 34 << MSG_SHIFT; |
Anthony Chen | 9ad00e0 | 2017-05-12 15:53:36 -0700 | [diff] [blame] | 102 | private static final int MSG_TOGGLE_PANEL = 35 << MSG_SHIFT; |
Jason Monk | 0b99402 | 2017-08-08 16:27:14 -0400 | [diff] [blame] | 103 | private static final int MSG_SHOW_SHUTDOWN_UI = 36 << MSG_SHIFT; |
Selim Cinek | 3a49ba2 | 2017-08-10 11:17:39 -0700 | [diff] [blame] | 104 | private static final int MSG_SET_TOP_APP_HIDES_STATUS_BAR = 37 << MSG_SHIFT; |
Mike Digman | 93f0834 | 2017-11-24 21:46:53 -0800 | [diff] [blame] | 105 | private static final int MSG_ROTATION_PROPOSAL = 38 << MSG_SHIFT; |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 106 | private static final int MSG_BIOMETRIC_SHOW = 39 << MSG_SHIFT; |
| 107 | private static final int MSG_BIOMETRIC_AUTHENTICATED = 40 << MSG_SHIFT; |
| 108 | private static final int MSG_BIOMETRIC_HELP = 41 << MSG_SHIFT; |
| 109 | private static final int MSG_BIOMETRIC_ERROR = 42 << MSG_SHIFT; |
| 110 | private static final int MSG_BIOMETRIC_HIDE = 43 << MSG_SHIFT; |
Beverly | ae79ab9 | 2017-12-11 09:20:02 -0500 | [diff] [blame] | 111 | private static final int MSG_SHOW_CHARGING_ANIMATION = 44 << MSG_SHIFT; |
Matthew Ng | 9c3bce5 | 2018-02-01 22:00:31 +0000 | [diff] [blame] | 112 | private static final int MSG_SHOW_PINNING_TOAST_ENTER_EXIT = 45 << MSG_SHIFT; |
| 113 | private static final int MSG_SHOW_PINNING_TOAST_ESCAPE = 46 << MSG_SHIFT; |
Daniel Sandler | 328310c | 2011-09-23 15:56:52 -0400 | [diff] [blame] | 114 | |
Jim Miller | 9a720f5 | 2012-05-30 03:19:43 -0700 | [diff] [blame] | 115 | public static final int FLAG_EXCLUDE_NONE = 0; |
| 116 | public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0; |
| 117 | public static final int FLAG_EXCLUDE_RECENTS_PANEL = 1 << 1; |
| 118 | public static final int FLAG_EXCLUDE_NOTIFICATION_PANEL = 1 << 2; |
| 119 | public static final int FLAG_EXCLUDE_INPUT_METHODS_PANEL = 1 << 3; |
| 120 | public static final int FLAG_EXCLUDE_COMPAT_MODE_PANEL = 1 << 4; |
| 121 | |
Jason Monk | b605fec | 2014-05-02 17:04:10 -0400 | [diff] [blame] | 122 | private static final String SHOW_IME_SWITCHER_KEY = "showImeSwitcherKey"; |
| 123 | |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 124 | private final Object mLock = new Object(); |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 125 | private ArrayList<Callbacks> mCallbacks = new ArrayList<>(); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 126 | private Handler mHandler = new H(Looper.getMainLooper()); |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 127 | /** A map of display id - disable flag pair */ |
| 128 | private SparseArray<Pair<Integer, Integer>> mDisplayDisabled = new SparseArray<>(); |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 129 | |
| 130 | /** |
| 131 | * These methods are called back on the main thread. |
| 132 | */ |
| 133 | public interface Callbacks { |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 134 | default void setIcon(String slot, StatusBarIcon icon) { } |
| 135 | default void removeIcon(String slot) { } |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 136 | |
| 137 | /** |
| 138 | * Called to notify that disable flags are updated. |
| 139 | * @see IStatusBar#disable(int, int, int). |
| 140 | * |
| 141 | * @param displayId The id of the display to notify. |
| 142 | * @param state1 The combination of following DISABLE_* flags: |
| 143 | * @param state2 The combination of following DISABLE2_* flags: |
| 144 | * @param animate {@code true} to show animations. |
| 145 | */ |
| 146 | default void disable(int displayId, @DisableFlags int state1, @Disable2Flags int state2, |
| 147 | boolean animate) { } |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 148 | default void animateExpandNotificationsPanel() { } |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 149 | default void animateCollapsePanels(int flags, boolean force) { } |
Anthony Chen | 9ad00e0 | 2017-05-12 15:53:36 -0700 | [diff] [blame] | 150 | default void togglePanel() { } |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 151 | default void animateExpandSettingsPanel(String obj) { } |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 152 | |
| 153 | /** |
| 154 | * Called to notify visibility flag changes. |
| 155 | * @see IStatusBar#setSystemUiVisibility(int, int, int, int, int, Rect, Rect). |
| 156 | * |
| 157 | * @param displayId The id of the display to notify. |
| 158 | * @param vis The visibility flags except SYSTEM_UI_FLAG_LIGHT_STATUS_BAR which will |
| 159 | * be reported separately in fullscreenStackVis and dockedStackVis. |
| 160 | * @param fullscreenStackVis The flags which only apply in the region of the fullscreen |
| 161 | * stack, which is currently only SYSTEM_UI_FLAG_LIGHT_STATUS_BAR. |
| 162 | * @param dockedStackVis The flags that only apply in the region of the docked stack, which |
| 163 | * is currently only SYSTEM_UI_FLAG_LIGHT_STATUS_BAR. |
| 164 | * @param mask Which flags to change. |
| 165 | * @param fullscreenStackBounds The current bounds of the fullscreen stack, in screen |
| 166 | * coordinates. |
| 167 | * @param dockedStackBounds The current bounds of the docked stack, in screen coordinates. |
| 168 | */ |
| 169 | default void setSystemUiVisibility(int displayId, int vis, int fullscreenStackVis, |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 170 | int dockedStackVis, int mask, Rect fullscreenStackBounds, Rect dockedStackBounds) { |
| 171 | } |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 172 | |
| 173 | /** |
| 174 | * Called to notify top app window changes. |
| 175 | * @see IStatusBar#topAppWindowChanged(int, boolean) |
| 176 | * |
| 177 | * @param displayId The id of the display to notify. |
| 178 | * @param visible {@code true} to show menu button. |
| 179 | */ |
| 180 | default void topAppWindowChanged(int displayId, boolean visible) { } |
| 181 | |
| 182 | /** |
| 183 | * Called to notify IME window status changes. |
| 184 | * |
| 185 | * @param displayId The id of the display to notify. |
| 186 | * @param token IME token. |
| 187 | * @param vis IME visibility. |
| 188 | * @param backDisposition Disposition mode of back button. It should be one of below flags: |
| 189 | * @param showImeSwitcher {@code true} to show IME switch button. |
| 190 | */ |
| 191 | default void setImeWindowStatus(int displayId, IBinder token, int vis, |
| 192 | @BackDispositionMode int backDisposition, boolean showImeSwitcher) { } |
Winson Chung | dff7a73 | 2017-12-11 12:17:06 -0800 | [diff] [blame] | 193 | default void showRecentApps(boolean triggeredFromAltTab) { } |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 194 | default void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { } |
| 195 | default void toggleRecentApps() { } |
| 196 | default void toggleSplitScreen() { } |
| 197 | default void preloadRecentApps() { } |
| 198 | default void dismissKeyboardShortcutsMenu() { } |
| 199 | default void toggleKeyboardShortcutsMenu(int deviceId) { } |
| 200 | default void cancelPreloadRecentApps() { } |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 201 | |
| 202 | /** |
| 203 | * Called to notify window state changes. |
| 204 | * @see IStatusBar#setWindowState(int, int, int) |
| 205 | * |
| 206 | * @param displayId The id of the display to notify. |
| 207 | * @param window Window type. It should be one of {@link StatusBarManager#WINDOW_STATUS_BAR} |
| 208 | * or {@link StatusBarManager#WINDOW_NAVIGATION_BAR} |
| 209 | * @param state Window visible state. |
| 210 | */ |
| 211 | default void setWindowState(int displayId, @WindowType int window, |
| 212 | @WindowVisibleState int state) { } |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 213 | default void showScreenPinningRequest(int taskId) { } |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 214 | |
| 215 | /** |
| 216 | * Called to notify System UI that an application transition is pending. |
| 217 | * @see IStatusBar#appTransitionPending(int). |
| 218 | * |
| 219 | * @param displayId The id of the display to notify. |
| 220 | * @param forced {@code true} to force transition pending. |
| 221 | */ |
| 222 | default void appTransitionPending(int displayId, boolean forced) { } |
| 223 | |
| 224 | /** |
| 225 | * Called to notify System UI that an application transition is canceled. |
| 226 | * @see IStatusBar#appTransitionCancelled(int). |
| 227 | * |
| 228 | * @param displayId The id of the display to notify. |
| 229 | */ |
| 230 | default void appTransitionCancelled(int displayId) { } |
| 231 | |
| 232 | /** |
| 233 | * Called to notify System UI that an application transition is starting. |
| 234 | * @see IStatusBar#appTransitionStarting(int, long, long). |
| 235 | * |
| 236 | * @param displayId The id of the display to notify. |
| 237 | * @param startTime Transition start time. |
| 238 | * @param duration Transition duration. |
| 239 | * @param forced {@code true} to force transition pending. |
| 240 | */ |
| 241 | default void appTransitionStarting( |
| 242 | int displayId, long startTime, long duration, boolean forced) { } |
| 243 | |
| 244 | /** |
| 245 | * Called to notify System UI that an application transition is finished. |
| 246 | * @see IStatusBar#appTransitionFinished(int) |
| 247 | * |
| 248 | * @param displayId The id of the display to notify. |
| 249 | */ |
| 250 | default void appTransitionFinished(int displayId) { } |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 251 | default void showAssistDisclosure() { } |
| 252 | default void startAssist(Bundle args) { } |
| 253 | default void onCameraLaunchGestureDetected(int source) { } |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 254 | default void showPictureInPictureMenu() { } |
Selim Cinek | 3a49ba2 | 2017-08-10 11:17:39 -0700 | [diff] [blame] | 255 | default void setTopAppHidesStatusBar(boolean topAppHidesStatusBar) { } |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 256 | |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 257 | default void addQsTile(ComponentName tile) { } |
| 258 | default void remQsTile(ComponentName tile) { } |
| 259 | default void clickTile(ComponentName tile) { } |
Jim Miller | 07e0384 | 2016-06-22 15:18:13 -0700 | [diff] [blame] | 260 | |
Philip Quinn | c3a503d | 2017-07-18 23:23:41 -0700 | [diff] [blame] | 261 | default void handleSystemKey(int arg1) { } |
Matthew Ng | 9c3bce5 | 2018-02-01 22:00:31 +0000 | [diff] [blame] | 262 | default void showPinningEnterExitToast(boolean entering) { } |
| 263 | default void showPinningEscapeToast() { } |
Jason Monk | 361915c | 2017-03-21 20:33:59 -0400 | [diff] [blame] | 264 | default void handleShowGlobalActionsMenu() { } |
Jason Monk | b430218 | 2017-08-04 13:39:17 -0400 | [diff] [blame] | 265 | default void handleShowShutdownUi(boolean isReboot, String reason) { } |
Mike Digman | 93f0834 | 2017-11-24 21:46:53 -0800 | [diff] [blame] | 266 | |
Beverly | ac32c9a | 2018-01-31 16:10:41 -0500 | [diff] [blame] | 267 | default void showWirelessChargingAnimation(int batteryLevel) { } |
Beverly | ae79ab9 | 2017-12-11 09:20:02 -0500 | [diff] [blame] | 268 | |
Mike Digman | e077731 | 2018-01-19 12:41:51 -0800 | [diff] [blame] | 269 | default void onRotationProposal(int rotation, boolean isValid) { } |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 270 | |
Kevin Chyn | 23289ef | 2018-11-28 16:32:36 -0800 | [diff] [blame] | 271 | default void showBiometricDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver, |
Kevin Chyn | 1b9f8df | 2018-11-12 19:04:55 -0800 | [diff] [blame] | 272 | int type, boolean requireConfirmation, int userId) { } |
Kevin Chyn | e191271 | 2019-01-04 14:22:34 -0800 | [diff] [blame] | 273 | default void onBiometricAuthenticated(boolean authenticated) { } |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 274 | default void onBiometricHelp(String message) { } |
| 275 | default void onBiometricError(String error) { } |
| 276 | default void hideBiometricDialog() { } |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 277 | } |
| 278 | |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 279 | @VisibleForTesting |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 280 | public CommandQueue(Context context) { |
| 281 | context.getSystemService(DisplayManager.class).registerDisplayListener(this, mHandler); |
| 282 | // We always have default display. |
| 283 | setDisabled(DEFAULT_DISPLAY, DISABLE_NONE, DISABLE2_NONE); |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 284 | } |
| 285 | |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 286 | @Override |
| 287 | public void onDisplayAdded(int displayId) { } |
| 288 | |
| 289 | @Override |
| 290 | public void onDisplayRemoved(int displayId) { |
| 291 | synchronized (mLock) { |
| 292 | mDisplayDisabled.remove(displayId); |
| 293 | } |
| 294 | } |
| 295 | |
| 296 | @Override |
| 297 | public void onDisplayChanged(int displayId) { } |
| 298 | |
| 299 | // TODO(b/118592525): add multi-display support if needed. |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 300 | public boolean panelsEnabled() { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 301 | final int disabled1 = getDisabled1(DEFAULT_DISPLAY); |
| 302 | final int disabled2 = getDisabled2(DEFAULT_DISPLAY); |
| 303 | return (disabled1 & StatusBarManager.DISABLE_EXPAND) == 0 |
| 304 | && (disabled2 & StatusBarManager.DISABLE2_NOTIFICATION_SHADE) == 0 |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 305 | && !ONLY_CORE_APPS; |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 306 | } |
| 307 | |
Jason Monk | d7c9855 | 2018-12-04 11:14:50 -0500 | [diff] [blame] | 308 | public void addCallback(Callbacks callbacks) { |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 309 | mCallbacks.add(callbacks); |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 310 | // TODO(b/117478341): find a better way to pass disable flags by display. |
| 311 | for (int i = 0; i < mDisplayDisabled.size(); i++) { |
| 312 | int displayId = mDisplayDisabled.keyAt(i); |
| 313 | int disabled1 = getDisabled1(displayId); |
| 314 | int disabled2 = getDisabled2(displayId); |
| 315 | callbacks.disable(displayId, disabled1, disabled2, false /* animate */); |
| 316 | } |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 317 | } |
| 318 | |
Jason Monk | d7c9855 | 2018-12-04 11:14:50 -0500 | [diff] [blame] | 319 | public void removeCallback(Callbacks callbacks) { |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 320 | mCallbacks.remove(callbacks); |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 321 | } |
| 322 | |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 323 | public void setIcon(String slot, StatusBarIcon icon) { |
| 324 | synchronized (mLock) { |
| 325 | // don't coalesce these |
| 326 | mHandler.obtainMessage(MSG_ICON, OP_SET_ICON, 0, |
| 327 | new Pair<String, StatusBarIcon>(slot, icon)).sendToTarget(); |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 328 | } |
| 329 | } |
| 330 | |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 331 | public void removeIcon(String slot) { |
| 332 | synchronized (mLock) { |
| 333 | // don't coalesce these |
| 334 | mHandler.obtainMessage(MSG_ICON, OP_REMOVE_ICON, 0, slot).sendToTarget(); |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 335 | } |
| 336 | } |
| 337 | |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 338 | /** |
| 339 | * Called to notify that disable flags are updated. |
| 340 | * @see Callbacks#disable(int, int, int, boolean). |
| 341 | */ |
| 342 | public void disable(int displayId, @DisableFlags int state1, @Disable2Flags int state2, |
| 343 | boolean animate) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 344 | synchronized (mLock) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 345 | setDisabled(displayId, state1, state2); |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 346 | mHandler.removeMessages(MSG_DISABLE); |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 347 | final SomeArgs args = SomeArgs.obtain(); |
| 348 | args.argi1 = displayId; |
| 349 | args.argi2 = state1; |
| 350 | args.argi3 = state2; |
| 351 | args.argi4 = animate ? 1 : 0; |
| 352 | Message msg = mHandler.obtainMessage(MSG_DISABLE, args); |
Jason Monk | 3d3e99c | 2017-04-20 11:26:36 -0400 | [diff] [blame] | 353 | if (Looper.myLooper() == mHandler.getLooper()) { |
| 354 | // If its the right looper execute immediately so hides can be handled quickly. |
| 355 | mHandler.handleMessage(msg); |
| 356 | msg.recycle(); |
| 357 | } else { |
| 358 | msg.sendToTarget(); |
| 359 | } |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 360 | } |
| 361 | } |
| 362 | |
Charles Chen | 24e7a9f | 2018-11-21 11:59:07 +0800 | [diff] [blame] | 363 | @Override |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 364 | public void disable(int displayId, @DisableFlags int state1, @Disable2Flags int state2) { |
| 365 | disable(displayId, state1, state2, true); |
Jason Monk | 1e5ba5d | 2017-02-14 15:48:57 -0500 | [diff] [blame] | 366 | } |
| 367 | |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 368 | /** |
| 369 | * Apply current disable flags by {@link CommandQueue#disable(int, int, int, boolean)}. |
| 370 | * |
| 371 | * @param displayId The id of the display to notify. |
| 372 | * @param animate {@code true} to show animations. |
| 373 | */ |
| 374 | public void recomputeDisableFlags(int displayId, boolean animate) { |
| 375 | int disabled1 = getDisabled1(displayId); |
| 376 | int disabled2 = getDisabled2(displayId); |
| 377 | disable(displayId, disabled1, disabled2, animate); |
| 378 | } |
| 379 | |
| 380 | private void setDisabled(int displayId, int disabled1, int disabled2) { |
| 381 | mDisplayDisabled.put(displayId, new Pair<>(disabled1, disabled2)); |
| 382 | } |
| 383 | |
| 384 | private int getDisabled1(int displayId) { |
| 385 | return getDisabled(displayId).first; |
| 386 | } |
| 387 | |
| 388 | private int getDisabled2(int displayId) { |
| 389 | return getDisabled(displayId).second; |
| 390 | } |
| 391 | |
| 392 | private Pair<Integer, Integer> getDisabled(int displayId) { |
| 393 | Pair<Integer, Integer> disablePair = mDisplayDisabled.get(displayId); |
| 394 | if (disablePair == null) { |
| 395 | disablePair = new Pair<>(DISABLE_NONE, DISABLE2_NONE); |
| 396 | mDisplayDisabled.put(displayId, disablePair); |
| 397 | } |
| 398 | return disablePair; |
Jason Monk | 00659ba | 2017-03-03 10:28:45 -0500 | [diff] [blame] | 399 | } |
| 400 | |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 401 | public void animateExpandNotificationsPanel() { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 402 | synchronized (mLock) { |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 403 | mHandler.removeMessages(MSG_EXPAND_NOTIFICATIONS); |
| 404 | mHandler.sendEmptyMessage(MSG_EXPAND_NOTIFICATIONS); |
Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 405 | } |
| 406 | } |
| 407 | |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 408 | public void animateCollapsePanels() { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 409 | synchronized (mLock) { |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 410 | mHandler.removeMessages(MSG_COLLAPSE_PANELS); |
Jason Monk | 9c7844c | 2017-01-18 15:21:53 -0500 | [diff] [blame] | 411 | mHandler.obtainMessage(MSG_COLLAPSE_PANELS, 0, 0).sendToTarget(); |
| 412 | } |
| 413 | } |
| 414 | |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 415 | public void animateCollapsePanels(int flags, boolean force) { |
Jason Monk | 9c7844c | 2017-01-18 15:21:53 -0500 | [diff] [blame] | 416 | synchronized (mLock) { |
| 417 | mHandler.removeMessages(MSG_COLLAPSE_PANELS); |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 418 | mHandler.obtainMessage(MSG_COLLAPSE_PANELS, flags, force ? 1 : 0).sendToTarget(); |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 419 | } |
Jim Miller | 9a720f5 | 2012-05-30 03:19:43 -0700 | [diff] [blame] | 420 | } |
| 421 | |
Anthony Chen | 9ad00e0 | 2017-05-12 15:53:36 -0700 | [diff] [blame] | 422 | public void togglePanel() { |
| 423 | synchronized (mLock) { |
| 424 | mHandler.removeMessages(MSG_TOGGLE_PANEL); |
| 425 | mHandler.obtainMessage(MSG_TOGGLE_PANEL, 0, 0).sendToTarget(); |
| 426 | } |
| 427 | } |
| 428 | |
Jason Monk | a992732 | 2015-12-13 16:22:37 -0500 | [diff] [blame] | 429 | public void animateExpandSettingsPanel(String subPanel) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 430 | synchronized (mLock) { |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 431 | mHandler.removeMessages(MSG_EXPAND_SETTINGS); |
Jason Monk | a992732 | 2015-12-13 16:22:37 -0500 | [diff] [blame] | 432 | mHandler.obtainMessage(MSG_EXPAND_SETTINGS, subPanel).sendToTarget(); |
Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 433 | } |
| 434 | } |
| 435 | |
Charles Chen | 24e7a9f | 2018-11-21 11:59:07 +0800 | [diff] [blame] | 436 | @Override |
| 437 | public void setSystemUiVisibility(int displayId, int vis, int fullscreenStackVis, |
| 438 | int dockedStackVis, int mask, Rect fullscreenStackBounds, Rect dockedStackBounds) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 439 | synchronized (mLock) { |
Selim Cinek | 4a4a2bddc | 2015-05-07 12:50:19 -0700 | [diff] [blame] | 440 | // Don't coalesce these, since it might have one time flags set such as |
| 441 | // STATUS_BAR_UNHIDE which might get lost. |
Jorim Jaggi | 8690558 | 2016-02-09 21:36:09 -0800 | [diff] [blame] | 442 | SomeArgs args = SomeArgs.obtain(); |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 443 | args.argi1 = displayId; |
| 444 | args.argi2 = vis; |
| 445 | args.argi3 = fullscreenStackVis; |
| 446 | args.argi4 = dockedStackVis; |
| 447 | args.argi5 = mask; |
Jorim Jaggi | 8690558 | 2016-02-09 21:36:09 -0800 | [diff] [blame] | 448 | args.arg1 = fullscreenStackBounds; |
| 449 | args.arg2 = dockedStackBounds; |
| 450 | mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY, args).sendToTarget(); |
Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 451 | } |
| 452 | } |
| 453 | |
Charles Chen | 24e7a9f | 2018-11-21 11:59:07 +0800 | [diff] [blame] | 454 | @Override |
| 455 | public void topAppWindowChanged(int displayId, boolean menuVisible) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 456 | synchronized (mLock) { |
Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 457 | mHandler.removeMessages(MSG_TOP_APP_WINDOW_CHANGED); |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 458 | mHandler.obtainMessage(MSG_TOP_APP_WINDOW_CHANGED, |
| 459 | displayId, menuVisible ? 1 : 0, null).sendToTarget(); |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 460 | } |
| 461 | } |
| 462 | |
Charles Chen | 24e7a9f | 2018-11-21 11:59:07 +0800 | [diff] [blame] | 463 | @Override |
| 464 | public void setImeWindowStatus(int displayId, IBinder token, int vis, int backDisposition, |
Jason Monk | b605fec | 2014-05-02 17:04:10 -0400 | [diff] [blame] | 465 | boolean showImeSwitcher) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 466 | synchronized (mLock) { |
satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 467 | mHandler.removeMessages(MSG_SHOW_IME_BUTTON); |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 468 | SomeArgs args = SomeArgs.obtain(); |
| 469 | args.argi1 = displayId; |
| 470 | args.argi2 = vis; |
| 471 | args.argi3 = backDisposition; |
| 472 | args.argi4 = showImeSwitcher ? 1 : 0; |
| 473 | args.arg1 = token; |
| 474 | Message m = mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, args); |
Jason Monk | b605fec | 2014-05-02 17:04:10 -0400 | [diff] [blame] | 475 | m.sendToTarget(); |
satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 476 | } |
| 477 | } |
| 478 | |
Winson Chung | dff7a73 | 2017-12-11 12:17:06 -0800 | [diff] [blame] | 479 | public void showRecentApps(boolean triggeredFromAltTab) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 480 | synchronized (mLock) { |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 481 | mHandler.removeMessages(MSG_SHOW_RECENT_APPS); |
Winson Chung | dff7a73 | 2017-12-11 12:17:06 -0800 | [diff] [blame] | 482 | mHandler.obtainMessage(MSG_SHOW_RECENT_APPS, triggeredFromAltTab ? 1 : 0, 0, |
| 483 | null).sendToTarget(); |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 484 | } |
| 485 | } |
| 486 | |
Winson Chung | cdcd487 | 2014-08-05 18:00:13 -0700 | [diff] [blame] | 487 | public void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 488 | synchronized (mLock) { |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 489 | mHandler.removeMessages(MSG_HIDE_RECENT_APPS); |
Winson Chung | 6cb485f | 2014-05-19 10:30:43 -0700 | [diff] [blame] | 490 | mHandler.obtainMessage(MSG_HIDE_RECENT_APPS, |
Winson Chung | cdcd487 | 2014-08-05 18:00:13 -0700 | [diff] [blame] | 491 | triggeredFromAltTab ? 1 : 0, triggeredFromHomeKey ? 1 : 0, |
| 492 | null).sendToTarget(); |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 493 | } |
| 494 | } |
| 495 | |
Phil Weaver | 315c34e | 2016-02-19 15:12:29 -0800 | [diff] [blame] | 496 | public void toggleSplitScreen() { |
| 497 | synchronized (mLock) { |
| 498 | mHandler.removeMessages(MSG_TOGGLE_APP_SPLIT_SCREEN); |
| 499 | mHandler.obtainMessage(MSG_TOGGLE_APP_SPLIT_SCREEN, 0, 0, null).sendToTarget(); |
| 500 | } |
| 501 | } |
| 502 | |
Michael Jurka | 3b1fc47 | 2011-06-13 10:54:40 -0700 | [diff] [blame] | 503 | public void toggleRecentApps() { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 504 | synchronized (mLock) { |
Michael Jurka | 3b1fc47 | 2011-06-13 10:54:40 -0700 | [diff] [blame] | 505 | mHandler.removeMessages(MSG_TOGGLE_RECENT_APPS); |
Jorim Jaggi | 6b46038 | 2017-05-13 23:16:44 +0200 | [diff] [blame] | 506 | Message msg = mHandler.obtainMessage(MSG_TOGGLE_RECENT_APPS, 0, 0, null); |
| 507 | msg.setAsynchronous(true); |
| 508 | msg.sendToTarget(); |
Michael Jurka | 3b1fc47 | 2011-06-13 10:54:40 -0700 | [diff] [blame] | 509 | } |
| 510 | } |
| 511 | |
Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 512 | public void preloadRecentApps() { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 513 | synchronized (mLock) { |
Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 514 | mHandler.removeMessages(MSG_PRELOAD_RECENT_APPS); |
| 515 | mHandler.obtainMessage(MSG_PRELOAD_RECENT_APPS, 0, 0, null).sendToTarget(); |
| 516 | } |
| 517 | } |
| 518 | |
| 519 | public void cancelPreloadRecentApps() { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 520 | synchronized (mLock) { |
Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 521 | mHandler.removeMessages(MSG_CANCEL_PRELOAD_RECENT_APPS); |
| 522 | mHandler.obtainMessage(MSG_CANCEL_PRELOAD_RECENT_APPS, 0, 0, null).sendToTarget(); |
| 523 | } |
| 524 | } |
| 525 | |
Clara Bayarri | f2debb1 | 2015-07-10 14:47:17 +0100 | [diff] [blame] | 526 | @Override |
Andrei Stingaceanu | 0bf096f | 2016-04-14 18:11:57 +0100 | [diff] [blame] | 527 | public void dismissKeyboardShortcutsMenu() { |
| 528 | synchronized (mLock) { |
| 529 | mHandler.removeMessages(MSG_DISMISS_KEYBOARD_SHORTCUTS); |
| 530 | mHandler.obtainMessage(MSG_DISMISS_KEYBOARD_SHORTCUTS).sendToTarget(); |
| 531 | } |
| 532 | } |
| 533 | |
| 534 | @Override |
Clara Bayarri | 4e850ff | 2016-03-02 11:12:32 -0800 | [diff] [blame] | 535 | public void toggleKeyboardShortcutsMenu(int deviceId) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 536 | synchronized (mLock) { |
Andrei Stingaceanu | c22ab79 | 2016-01-07 12:39:38 +0000 | [diff] [blame] | 537 | mHandler.removeMessages(MSG_TOGGLE_KEYBOARD_SHORTCUTS); |
Clara Bayarri | 4e850ff | 2016-03-02 11:12:32 -0800 | [diff] [blame] | 538 | mHandler.obtainMessage(MSG_TOGGLE_KEYBOARD_SHORTCUTS, deviceId, 0).sendToTarget(); |
Clara Bayarri | f2debb1 | 2015-07-10 14:47:17 +0100 | [diff] [blame] | 539 | } |
| 540 | } |
| 541 | |
Jaewan Kim | c552b04 | 2016-01-18 16:08:45 +0900 | [diff] [blame] | 542 | @Override |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 543 | public void showPictureInPictureMenu() { |
Jaewan Kim | c552b04 | 2016-01-18 16:08:45 +0900 | [diff] [blame] | 544 | synchronized (mLock) { |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 545 | mHandler.removeMessages(MSG_SHOW_PICTURE_IN_PICTURE_MENU); |
| 546 | mHandler.obtainMessage(MSG_SHOW_PICTURE_IN_PICTURE_MENU).sendToTarget(); |
Jaewan Kim | c552b04 | 2016-01-18 16:08:45 +0900 | [diff] [blame] | 547 | } |
| 548 | } |
| 549 | |
Charles Chen | 24e7a9f | 2018-11-21 11:59:07 +0800 | [diff] [blame] | 550 | @Override |
| 551 | public void setWindowState(int displayId, int window, int state) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 552 | synchronized (mLock) { |
John Spurlock | 5b9145b | 2013-08-20 15:13:47 -0400 | [diff] [blame] | 553 | // don't coalesce these |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 554 | mHandler.obtainMessage(MSG_SET_WINDOW_STATE, displayId, window, state).sendToTarget(); |
John Spurlock | 9764218 | 2013-07-29 17:58:39 -0400 | [diff] [blame] | 555 | } |
| 556 | } |
| 557 | |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 558 | public void showScreenPinningRequest(int taskId) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 559 | synchronized (mLock) { |
Andrii Kulian | 0f051f5 | 2016-04-14 00:41:51 -0700 | [diff] [blame] | 560 | mHandler.obtainMessage(MSG_SHOW_SCREEN_PIN_REQUEST, taskId, 0, null) |
| 561 | .sendToTarget(); |
Jason Monk | 5565cb4 | 2014-09-12 10:59:21 -0400 | [diff] [blame] | 562 | } |
| 563 | } |
| 564 | |
Charles Chen | 24e7a9f | 2018-11-21 11:59:07 +0800 | [diff] [blame] | 565 | @Override |
| 566 | public void appTransitionPending(int displayId) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 567 | appTransitionPending(displayId, false /* forced */); |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 568 | } |
| 569 | |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 570 | /** |
| 571 | * Called to notify System UI that an application transition is pending. |
| 572 | * @see Callbacks#appTransitionPending(int, boolean) |
| 573 | */ |
| 574 | public void appTransitionPending(int displayId, boolean forced) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 575 | synchronized (mLock) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 576 | mHandler.obtainMessage(MSG_APP_TRANSITION_PENDING, displayId, forced ? 1 : 0) |
| 577 | .sendToTarget(); |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 578 | } |
| 579 | } |
| 580 | |
Charles Chen | 24e7a9f | 2018-11-21 11:59:07 +0800 | [diff] [blame] | 581 | @Override |
| 582 | public void appTransitionCancelled(int displayId) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 583 | synchronized (mLock) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 584 | mHandler.obtainMessage(MSG_APP_TRANSITION_CANCELLED, displayId).sendToTarget(); |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 585 | } |
| 586 | } |
| 587 | |
Charles Chen | 24e7a9f | 2018-11-21 11:59:07 +0800 | [diff] [blame] | 588 | @Override |
| 589 | public void appTransitionStarting(int displayId, long startTime, long duration) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 590 | appTransitionStarting(displayId, startTime, duration, false /* forced */); |
Jason Monk | aa573e9 | 2017-01-27 17:00:29 -0500 | [diff] [blame] | 591 | } |
| 592 | |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 593 | /** |
| 594 | * Called to notify System UI that an application transition is starting. |
| 595 | * @see Callbacks#appTransitionStarting(int, long, long, boolean). |
| 596 | */ |
| 597 | public void appTransitionStarting(int displayId, long startTime, long duration, |
| 598 | boolean forced) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 599 | synchronized (mLock) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 600 | final SomeArgs args = SomeArgs.obtain(); |
| 601 | args.argi1 = displayId; |
| 602 | args.argi2 = forced ? 1 : 0; |
| 603 | args.arg1 = startTime; |
| 604 | args.arg2 = duration; |
| 605 | mHandler.obtainMessage(MSG_APP_TRANSITION_STARTING, args).sendToTarget(); |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 606 | } |
| 607 | } |
| 608 | |
Jorim Jaggi | 2adba07 | 2016-03-03 13:43:39 +0100 | [diff] [blame] | 609 | @Override |
Charles Chen | 24e7a9f | 2018-11-21 11:59:07 +0800 | [diff] [blame] | 610 | public void appTransitionFinished(int displayId) { |
Jorim Jaggi | 2adba07 | 2016-03-03 13:43:39 +0100 | [diff] [blame] | 611 | synchronized (mLock) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 612 | mHandler.obtainMessage(MSG_APP_TRANSITION_FINISHED, displayId).sendToTarget(); |
Jorim Jaggi | 2adba07 | 2016-03-03 13:43:39 +0100 | [diff] [blame] | 613 | } |
| 614 | } |
| 615 | |
Adrian Roos | 4f43dc0 | 2015-06-17 16:43:38 -0700 | [diff] [blame] | 616 | public void showAssistDisclosure() { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 617 | synchronized (mLock) { |
Adrian Roos | 4f43dc0 | 2015-06-17 16:43:38 -0700 | [diff] [blame] | 618 | mHandler.removeMessages(MSG_ASSIST_DISCLOSURE); |
| 619 | mHandler.obtainMessage(MSG_ASSIST_DISCLOSURE).sendToTarget(); |
| 620 | } |
| 621 | } |
| 622 | |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 623 | public void startAssist(Bundle args) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 624 | synchronized (mLock) { |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 625 | mHandler.removeMessages(MSG_START_ASSIST); |
| 626 | mHandler.obtainMessage(MSG_START_ASSIST, args).sendToTarget(); |
| 627 | } |
| 628 | } |
| 629 | |
Selim Cinek | 372d1bd | 2015-08-14 13:19:37 -0700 | [diff] [blame] | 630 | @Override |
Jorim Jaggi | 40aa881 | 2015-09-23 12:59:22 -0700 | [diff] [blame] | 631 | public void onCameraLaunchGestureDetected(int source) { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 632 | synchronized (mLock) { |
Selim Cinek | 372d1bd | 2015-08-14 13:19:37 -0700 | [diff] [blame] | 633 | mHandler.removeMessages(MSG_CAMERA_LAUNCH_GESTURE); |
Jorim Jaggi | 40aa881 | 2015-09-23 12:59:22 -0700 | [diff] [blame] | 634 | mHandler.obtainMessage(MSG_CAMERA_LAUNCH_GESTURE, source, 0).sendToTarget(); |
Selim Cinek | 372d1bd | 2015-08-14 13:19:37 -0700 | [diff] [blame] | 635 | } |
| 636 | } |
| 637 | |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 638 | @Override |
| 639 | public void addQsTile(ComponentName tile) { |
| 640 | synchronized (mLock) { |
| 641 | mHandler.obtainMessage(MSG_ADD_QS_TILE, tile).sendToTarget(); |
| 642 | } |
| 643 | } |
| 644 | |
| 645 | @Override |
| 646 | public void remQsTile(ComponentName tile) { |
| 647 | synchronized (mLock) { |
| 648 | mHandler.obtainMessage(MSG_REMOVE_QS_TILE, tile).sendToTarget(); |
| 649 | } |
| 650 | } |
| 651 | |
| 652 | @Override |
| 653 | public void clickQsTile(ComponentName tile) { |
| 654 | synchronized (mLock) { |
| 655 | mHandler.obtainMessage(MSG_CLICK_QS_TILE, tile).sendToTarget(); |
| 656 | } |
| 657 | } |
| 658 | |
Jim Miller | 07e0384 | 2016-06-22 15:18:13 -0700 | [diff] [blame] | 659 | @Override |
Philip Quinn | c3a503d | 2017-07-18 23:23:41 -0700 | [diff] [blame] | 660 | public void handleSystemKey(int key) { |
Jim Miller | 07e0384 | 2016-06-22 15:18:13 -0700 | [diff] [blame] | 661 | synchronized (mLock) { |
Philip Quinn | c3a503d | 2017-07-18 23:23:41 -0700 | [diff] [blame] | 662 | mHandler.obtainMessage(MSG_HANDLE_SYSTEM_KEY, key, 0).sendToTarget(); |
Jim Miller | 07e0384 | 2016-06-22 15:18:13 -0700 | [diff] [blame] | 663 | } |
| 664 | } |
| 665 | |
Jason Monk | 361915c | 2017-03-21 20:33:59 -0400 | [diff] [blame] | 666 | @Override |
Matthew Ng | 9c3bce5 | 2018-02-01 22:00:31 +0000 | [diff] [blame] | 667 | public void showPinningEnterExitToast(boolean entering) { |
| 668 | synchronized (mLock) { |
| 669 | mHandler.obtainMessage(MSG_SHOW_PINNING_TOAST_ENTER_EXIT, entering).sendToTarget(); |
| 670 | } |
| 671 | } |
| 672 | |
| 673 | @Override |
| 674 | public void showPinningEscapeToast() { |
| 675 | synchronized (mLock) { |
| 676 | mHandler.obtainMessage(MSG_SHOW_PINNING_TOAST_ESCAPE).sendToTarget(); |
| 677 | } |
| 678 | } |
| 679 | |
| 680 | |
| 681 | @Override |
Jason Monk | 361915c | 2017-03-21 20:33:59 -0400 | [diff] [blame] | 682 | public void showGlobalActionsMenu() { |
| 683 | synchronized (mLock) { |
| 684 | mHandler.removeMessages(MSG_SHOW_GLOBAL_ACTIONS); |
| 685 | mHandler.obtainMessage(MSG_SHOW_GLOBAL_ACTIONS).sendToTarget(); |
| 686 | } |
| 687 | } |
| 688 | |
Jason Monk | b430218 | 2017-08-04 13:39:17 -0400 | [diff] [blame] | 689 | @Override |
Selim Cinek | 3a49ba2 | 2017-08-10 11:17:39 -0700 | [diff] [blame] | 690 | public void setTopAppHidesStatusBar(boolean hidesStatusBar) { |
| 691 | mHandler.removeMessages(MSG_SET_TOP_APP_HIDES_STATUS_BAR); |
| 692 | mHandler.obtainMessage(MSG_SET_TOP_APP_HIDES_STATUS_BAR, hidesStatusBar ? 1 : 0, 0) |
| 693 | .sendToTarget(); |
| 694 | } |
| 695 | |
| 696 | @Override |
Jason Monk | b430218 | 2017-08-04 13:39:17 -0400 | [diff] [blame] | 697 | public void showShutdownUi(boolean isReboot, String reason) { |
| 698 | synchronized (mLock) { |
| 699 | mHandler.removeMessages(MSG_SHOW_SHUTDOWN_UI); |
| 700 | mHandler.obtainMessage(MSG_SHOW_SHUTDOWN_UI, isReboot ? 1 : 0, 0, reason) |
| 701 | .sendToTarget(); |
| 702 | } |
| 703 | } |
| 704 | |
Mike Digman | 93f0834 | 2017-11-24 21:46:53 -0800 | [diff] [blame] | 705 | @Override |
Beverly | ac32c9a | 2018-01-31 16:10:41 -0500 | [diff] [blame] | 706 | public void showWirelessChargingAnimation(int batteryLevel) { |
Beverly | ae79ab9 | 2017-12-11 09:20:02 -0500 | [diff] [blame] | 707 | mHandler.removeMessages(MSG_SHOW_CHARGING_ANIMATION); |
| 708 | mHandler.obtainMessage(MSG_SHOW_CHARGING_ANIMATION, batteryLevel, 0) |
| 709 | .sendToTarget(); |
| 710 | } |
| 711 | |
| 712 | @Override |
Mike Digman | e077731 | 2018-01-19 12:41:51 -0800 | [diff] [blame] | 713 | public void onProposedRotationChanged(int rotation, boolean isValid) { |
Mike Digman | 93f0834 | 2017-11-24 21:46:53 -0800 | [diff] [blame] | 714 | synchronized (mLock) { |
| 715 | mHandler.removeMessages(MSG_ROTATION_PROPOSAL); |
Mike Digman | e077731 | 2018-01-19 12:41:51 -0800 | [diff] [blame] | 716 | mHandler.obtainMessage(MSG_ROTATION_PROPOSAL, rotation, isValid ? 1 : 0, |
Mike Digman | 93f0834 | 2017-11-24 21:46:53 -0800 | [diff] [blame] | 717 | null).sendToTarget(); |
| 718 | } |
| 719 | } |
| 720 | |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 721 | @Override |
Kevin Chyn | 23289ef | 2018-11-28 16:32:36 -0800 | [diff] [blame] | 722 | public void showBiometricDialog(Bundle bundle, IBiometricServiceReceiverInternal receiver, |
| 723 | int type, boolean requireConfirmation, int userId) { |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 724 | synchronized (mLock) { |
| 725 | SomeArgs args = SomeArgs.obtain(); |
| 726 | args.arg1 = bundle; |
| 727 | args.arg2 = receiver; |
Kevin Chyn | 5a2ff5d | 2018-08-29 19:07:30 -0700 | [diff] [blame] | 728 | args.argi1 = type; |
Kevin Chyn | 6cf54e8 | 2018-09-18 19:13:27 -0700 | [diff] [blame] | 729 | args.arg3 = requireConfirmation; |
Kevin Chyn | 1b9f8df | 2018-11-12 19:04:55 -0800 | [diff] [blame] | 730 | args.argi2 = userId; |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 731 | mHandler.obtainMessage(MSG_BIOMETRIC_SHOW, args) |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 732 | .sendToTarget(); |
| 733 | } |
| 734 | } |
| 735 | |
| 736 | @Override |
Kevin Chyn | e191271 | 2019-01-04 14:22:34 -0800 | [diff] [blame] | 737 | public void onBiometricAuthenticated(boolean authenticated) { |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 738 | synchronized (mLock) { |
Kevin Chyn | e191271 | 2019-01-04 14:22:34 -0800 | [diff] [blame] | 739 | mHandler.obtainMessage(MSG_BIOMETRIC_AUTHENTICATED, authenticated).sendToTarget(); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 740 | } |
| 741 | } |
| 742 | |
| 743 | @Override |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 744 | public void onBiometricHelp(String message) { |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 745 | synchronized (mLock) { |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 746 | mHandler.obtainMessage(MSG_BIOMETRIC_HELP, message).sendToTarget(); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 747 | } |
| 748 | } |
| 749 | |
| 750 | @Override |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 751 | public void onBiometricError(String error) { |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 752 | synchronized (mLock) { |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 753 | mHandler.obtainMessage(MSG_BIOMETRIC_ERROR, error).sendToTarget(); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 754 | } |
| 755 | } |
| 756 | |
| 757 | @Override |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 758 | public void hideBiometricDialog() { |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 759 | synchronized (mLock) { |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 760 | mHandler.obtainMessage(MSG_BIOMETRIC_HIDE).sendToTarget(); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 761 | } |
| 762 | } |
| 763 | |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 764 | private final class H extends Handler { |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 765 | private H(Looper l) { |
| 766 | super(l); |
| 767 | } |
| 768 | |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 769 | public void handleMessage(Message msg) { |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 770 | final int what = msg.what & MSG_MASK; |
Joe Onorato | 66d7d01 | 2010-05-14 10:05:10 -0700 | [diff] [blame] | 771 | switch (what) { |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 772 | case MSG_ICON: { |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 773 | switch (msg.arg1) { |
| 774 | case OP_SET_ICON: { |
Jason Monk | 07473ce | 2016-01-05 14:59:19 -0500 | [diff] [blame] | 775 | Pair<String, StatusBarIcon> p = (Pair<String, StatusBarIcon>) msg.obj; |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 776 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 777 | mCallbacks.get(i).setIcon(p.first, p.second); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 778 | } |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 779 | break; |
| 780 | } |
| 781 | case OP_REMOVE_ICON: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 782 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 783 | mCallbacks.get(i).removeIcon((String) msg.obj); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 784 | } |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 785 | break; |
| 786 | } |
| 787 | break; |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 788 | } |
| 789 | case MSG_DISABLE: |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 790 | SomeArgs args = (SomeArgs) msg.obj; |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 791 | for (int i = 0; i < mCallbacks.size(); i++) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 792 | mCallbacks.get(i).disable(args.argi1, args.argi2, args.argi3, |
| 793 | args.argi4 != 0 /* animate */); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 794 | } |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 795 | break; |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 796 | case MSG_EXPAND_NOTIFICATIONS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 797 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 798 | mCallbacks.get(i).animateExpandNotificationsPanel(); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 799 | } |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 800 | break; |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 801 | case MSG_COLLAPSE_PANELS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 802 | for (int i = 0; i < mCallbacks.size(); i++) { |
Jason Monk | 297c04e | 2018-08-23 17:16:59 -0400 | [diff] [blame] | 803 | mCallbacks.get(i).animateCollapsePanels(msg.arg1, msg.arg2 != 0); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 804 | } |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 805 | break; |
Anthony Chen | 9ad00e0 | 2017-05-12 15:53:36 -0700 | [diff] [blame] | 806 | case MSG_TOGGLE_PANEL: |
| 807 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 808 | mCallbacks.get(i).togglePanel(); |
| 809 | } |
| 810 | break; |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 811 | case MSG_EXPAND_SETTINGS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 812 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 813 | mCallbacks.get(i).animateExpandSettingsPanel((String) msg.obj); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 814 | } |
Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 815 | break; |
Daniel Sandler | 60ee256 | 2011-07-22 12:34:33 -0400 | [diff] [blame] | 816 | case MSG_SET_SYSTEMUI_VISIBILITY: |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 817 | args = (SomeArgs) msg.obj; |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 818 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 819 | mCallbacks.get(i).setSystemUiVisibility(args.argi1, args.argi2, args.argi3, |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 820 | args.argi4, args.argi5, (Rect) args.arg1, (Rect) args.arg2); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 821 | } |
Jorim Jaggi | 8690558 | 2016-02-09 21:36:09 -0800 | [diff] [blame] | 822 | args.recycle(); |
Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 823 | break; |
Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 824 | case MSG_TOP_APP_WINDOW_CHANGED: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 825 | for (int i = 0; i < mCallbacks.size(); i++) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 826 | mCallbacks.get(i).topAppWindowChanged(msg.arg1, msg.arg2 != 0); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 827 | } |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 828 | break; |
satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 829 | case MSG_SHOW_IME_BUTTON: |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 830 | args = (SomeArgs) msg.obj; |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 831 | for (int i = 0; i < mCallbacks.size(); i++) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 832 | mCallbacks.get(i).setImeWindowStatus(args.argi1, (IBinder) args.arg1, |
| 833 | args.argi2, args.argi3, args.argi4 != 0 /* showImeSwitcher */); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 834 | } |
satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 835 | break; |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 836 | case MSG_SHOW_RECENT_APPS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 837 | for (int i = 0; i < mCallbacks.size(); i++) { |
Winson Chung | dff7a73 | 2017-12-11 12:17:06 -0800 | [diff] [blame] | 838 | mCallbacks.get(i).showRecentApps(msg.arg1 != 0); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 839 | } |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 840 | break; |
| 841 | case MSG_HIDE_RECENT_APPS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 842 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 843 | mCallbacks.get(i).hideRecentApps(msg.arg1 != 0, msg.arg2 != 0); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 844 | } |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 845 | break; |
Michael Jurka | 3b1fc47 | 2011-06-13 10:54:40 -0700 | [diff] [blame] | 846 | case MSG_TOGGLE_RECENT_APPS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 847 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 848 | mCallbacks.get(i).toggleRecentApps(); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 849 | } |
Michael Jurka | 3b1fc47 | 2011-06-13 10:54:40 -0700 | [diff] [blame] | 850 | break; |
Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 851 | case MSG_PRELOAD_RECENT_APPS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 852 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 853 | mCallbacks.get(i).preloadRecentApps(); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 854 | } |
Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 855 | break; |
| 856 | case MSG_CANCEL_PRELOAD_RECENT_APPS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 857 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 858 | mCallbacks.get(i).cancelPreloadRecentApps(); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 859 | } |
Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 860 | break; |
Andrei Stingaceanu | 0bf096f | 2016-04-14 18:11:57 +0100 | [diff] [blame] | 861 | case MSG_DISMISS_KEYBOARD_SHORTCUTS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 862 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 863 | mCallbacks.get(i).dismissKeyboardShortcutsMenu(); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 864 | } |
Andrei Stingaceanu | 0bf096f | 2016-04-14 18:11:57 +0100 | [diff] [blame] | 865 | break; |
Andrei Stingaceanu | c22ab79 | 2016-01-07 12:39:38 +0000 | [diff] [blame] | 866 | case MSG_TOGGLE_KEYBOARD_SHORTCUTS: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 867 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 868 | mCallbacks.get(i).toggleKeyboardShortcutsMenu(msg.arg1); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 869 | } |
Clara Bayarri | f2debb1 | 2015-07-10 14:47:17 +0100 | [diff] [blame] | 870 | break; |
John Spurlock | 9764218 | 2013-07-29 17:58:39 -0400 | [diff] [blame] | 871 | case MSG_SET_WINDOW_STATE: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 872 | for (int i = 0; i < mCallbacks.size(); i++) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 873 | mCallbacks.get(i).setWindowState(msg.arg1, msg.arg2, (int) msg.obj); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 874 | } |
John Spurlock | 9764218 | 2013-07-29 17:58:39 -0400 | [diff] [blame] | 875 | break; |
Jason Monk | 5565cb4 | 2014-09-12 10:59:21 -0400 | [diff] [blame] | 876 | case MSG_SHOW_SCREEN_PIN_REQUEST: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 877 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 878 | mCallbacks.get(i).showScreenPinningRequest(msg.arg1); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 879 | } |
Jason Monk | 5565cb4 | 2014-09-12 10:59:21 -0400 | [diff] [blame] | 880 | break; |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 881 | case MSG_APP_TRANSITION_PENDING: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 882 | for (int i = 0; i < mCallbacks.size(); i++) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 883 | mCallbacks.get(i).appTransitionPending(msg.arg1, msg.arg2 != 0); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 884 | } |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 885 | break; |
| 886 | case MSG_APP_TRANSITION_CANCELLED: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 887 | for (int i = 0; i < mCallbacks.size(); i++) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 888 | mCallbacks.get(i).appTransitionCancelled(msg.arg1); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 889 | } |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 890 | break; |
| 891 | case MSG_APP_TRANSITION_STARTING: |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 892 | args = (SomeArgs) msg.obj; |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 893 | for (int i = 0; i < mCallbacks.size(); i++) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 894 | mCallbacks.get(i).appTransitionStarting(args.argi1, (long) args.arg1, |
| 895 | (long) args.arg2, args.argi2 != 0 /* forced */); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 896 | } |
Jorim Jaggi | 24bec7c | 2015-02-04 12:40:14 +0100 | [diff] [blame] | 897 | break; |
Jorim Jaggi | 2adba07 | 2016-03-03 13:43:39 +0100 | [diff] [blame] | 898 | case MSG_APP_TRANSITION_FINISHED: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 899 | for (int i = 0; i < mCallbacks.size(); i++) { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 900 | mCallbacks.get(i).appTransitionFinished(msg.arg1); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 901 | } |
Jorim Jaggi | 2adba07 | 2016-03-03 13:43:39 +0100 | [diff] [blame] | 902 | break; |
Adrian Roos | 4f43dc0 | 2015-06-17 16:43:38 -0700 | [diff] [blame] | 903 | case MSG_ASSIST_DISCLOSURE: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 904 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 905 | mCallbacks.get(i).showAssistDisclosure(); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 906 | } |
Adrian Roos | 4f43dc0 | 2015-06-17 16:43:38 -0700 | [diff] [blame] | 907 | break; |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 908 | case MSG_START_ASSIST: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 909 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 910 | mCallbacks.get(i).startAssist((Bundle) msg.obj); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 911 | } |
Jorim Jaggi | 165ce06 | 2015-07-06 16:18:11 -0700 | [diff] [blame] | 912 | break; |
Selim Cinek | 372d1bd | 2015-08-14 13:19:37 -0700 | [diff] [blame] | 913 | case MSG_CAMERA_LAUNCH_GESTURE: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 914 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 915 | mCallbacks.get(i).onCameraLaunchGestureDetected(msg.arg1); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 916 | } |
Selim Cinek | 372d1bd | 2015-08-14 13:19:37 -0700 | [diff] [blame] | 917 | break; |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 918 | case MSG_SHOW_PICTURE_IN_PICTURE_MENU: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 919 | for (int i = 0; i < mCallbacks.size(); i++) { |
Winson Chung | ac52f28 | 2017-03-30 14:44:52 -0700 | [diff] [blame] | 920 | mCallbacks.get(i).showPictureInPictureMenu(); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 921 | } |
Jaewan Kim | c552b04 | 2016-01-18 16:08:45 +0900 | [diff] [blame] | 922 | break; |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 923 | case MSG_ADD_QS_TILE: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 924 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 925 | mCallbacks.get(i).addQsTile((ComponentName) msg.obj); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 926 | } |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 927 | break; |
| 928 | case MSG_REMOVE_QS_TILE: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 929 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 930 | mCallbacks.get(i).remQsTile((ComponentName) msg.obj); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 931 | } |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 932 | break; |
| 933 | case MSG_CLICK_QS_TILE: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 934 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 935 | mCallbacks.get(i).clickTile((ComponentName) msg.obj); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 936 | } |
Jason Monk | 7e53f20 | 2016-01-28 10:40:20 -0500 | [diff] [blame] | 937 | break; |
Phil Weaver | 315c34e | 2016-02-19 15:12:29 -0800 | [diff] [blame] | 938 | case MSG_TOGGLE_APP_SPLIT_SCREEN: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 939 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 940 | mCallbacks.get(i).toggleSplitScreen(); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 941 | } |
Phil Weaver | 315c34e | 2016-02-19 15:12:29 -0800 | [diff] [blame] | 942 | break; |
Philip Quinn | c3a503d | 2017-07-18 23:23:41 -0700 | [diff] [blame] | 943 | case MSG_HANDLE_SYSTEM_KEY: |
Jason Monk | 49fa016 | 2017-01-11 09:21:56 -0500 | [diff] [blame] | 944 | for (int i = 0; i < mCallbacks.size(); i++) { |
Philip Quinn | c3a503d | 2017-07-18 23:23:41 -0700 | [diff] [blame] | 945 | mCallbacks.get(i).handleSystemKey(msg.arg1); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 946 | } |
Jim Miller | 07e0384 | 2016-06-22 15:18:13 -0700 | [diff] [blame] | 947 | break; |
Jason Monk | 361915c | 2017-03-21 20:33:59 -0400 | [diff] [blame] | 948 | case MSG_SHOW_GLOBAL_ACTIONS: |
| 949 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 950 | mCallbacks.get(i).handleShowGlobalActionsMenu(); |
| 951 | } |
| 952 | break; |
Jason Monk | b430218 | 2017-08-04 13:39:17 -0400 | [diff] [blame] | 953 | case MSG_SHOW_SHUTDOWN_UI: |
| 954 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 955 | mCallbacks.get(i).handleShowShutdownUi(msg.arg1 != 0, (String) msg.obj); |
| 956 | } |
| 957 | break; |
Selim Cinek | 3a49ba2 | 2017-08-10 11:17:39 -0700 | [diff] [blame] | 958 | case MSG_SET_TOP_APP_HIDES_STATUS_BAR: |
| 959 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 960 | mCallbacks.get(i).setTopAppHidesStatusBar(msg.arg1 != 0); |
| 961 | } |
| 962 | break; |
Mike Digman | 93f0834 | 2017-11-24 21:46:53 -0800 | [diff] [blame] | 963 | case MSG_ROTATION_PROPOSAL: |
| 964 | for (int i = 0; i < mCallbacks.size(); i++) { |
Mike Digman | e077731 | 2018-01-19 12:41:51 -0800 | [diff] [blame] | 965 | mCallbacks.get(i).onRotationProposal(msg.arg1, msg.arg2 != 0); |
Mike Digman | 93f0834 | 2017-11-24 21:46:53 -0800 | [diff] [blame] | 966 | } |
| 967 | break; |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 968 | case MSG_BIOMETRIC_SHOW: |
| 969 | mHandler.removeMessages(MSG_BIOMETRIC_ERROR); |
| 970 | mHandler.removeMessages(MSG_BIOMETRIC_HELP); |
| 971 | mHandler.removeMessages(MSG_BIOMETRIC_AUTHENTICATED); |
Kevin Chyn | 5a2ff5d | 2018-08-29 19:07:30 -0700 | [diff] [blame] | 972 | SomeArgs someArgs = (SomeArgs) msg.obj; |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 973 | for (int i = 0; i < mCallbacks.size(); i++) { |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 974 | mCallbacks.get(i).showBiometricDialog( |
Kevin Chyn | 5a2ff5d | 2018-08-29 19:07:30 -0700 | [diff] [blame] | 975 | (Bundle) someArgs.arg1, |
Kevin Chyn | 23289ef | 2018-11-28 16:32:36 -0800 | [diff] [blame] | 976 | (IBiometricServiceReceiverInternal) someArgs.arg2, |
Kevin Chyn | 1b9f8df | 2018-11-12 19:04:55 -0800 | [diff] [blame] | 977 | someArgs.argi1 /* type */, |
| 978 | (boolean) someArgs.arg3 /* requireConfirmation */, |
| 979 | someArgs.argi2 /* userId */); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 980 | } |
Kevin Chyn | 5a2ff5d | 2018-08-29 19:07:30 -0700 | [diff] [blame] | 981 | someArgs.recycle(); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 982 | break; |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 983 | case MSG_BIOMETRIC_AUTHENTICATED: |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 984 | for (int i = 0; i < mCallbacks.size(); i++) { |
Kevin Chyn | e191271 | 2019-01-04 14:22:34 -0800 | [diff] [blame] | 985 | mCallbacks.get(i).onBiometricAuthenticated((boolean) msg.obj); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 986 | } |
| 987 | break; |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 988 | case MSG_BIOMETRIC_HELP: |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 989 | for (int i = 0; i < mCallbacks.size(); i++) { |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 990 | mCallbacks.get(i).onBiometricHelp((String) msg.obj); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 991 | } |
| 992 | break; |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 993 | case MSG_BIOMETRIC_ERROR: |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 994 | for (int i = 0; i < mCallbacks.size(); i++) { |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 995 | mCallbacks.get(i).onBiometricError((String) msg.obj); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 996 | } |
| 997 | break; |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 998 | case MSG_BIOMETRIC_HIDE: |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 999 | for (int i = 0; i < mCallbacks.size(); i++) { |
Kevin Chyn | e927566 | 2018-07-23 16:42:06 -0700 | [diff] [blame] | 1000 | mCallbacks.get(i).hideBiometricDialog(); |
Kevin Chyn | aae4a15 | 2018-01-18 11:48:09 -0800 | [diff] [blame] | 1001 | } |
Beverly | ae79ab9 | 2017-12-11 09:20:02 -0500 | [diff] [blame] | 1002 | break; |
| 1003 | case MSG_SHOW_CHARGING_ANIMATION: |
| 1004 | for (int i = 0; i < mCallbacks.size(); i++) { |
Beverly | ac32c9a | 2018-01-31 16:10:41 -0500 | [diff] [blame] | 1005 | mCallbacks.get(i).showWirelessChargingAnimation(msg.arg1); |
Beverly | ae79ab9 | 2017-12-11 09:20:02 -0500 | [diff] [blame] | 1006 | } |
| 1007 | break; |
Matthew Ng | 9c3bce5 | 2018-02-01 22:00:31 +0000 | [diff] [blame] | 1008 | case MSG_SHOW_PINNING_TOAST_ENTER_EXIT: |
| 1009 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 1010 | mCallbacks.get(i).showPinningEnterExitToast((Boolean) msg.obj); |
| 1011 | } |
| 1012 | break; |
| 1013 | case MSG_SHOW_PINNING_TOAST_ESCAPE: |
| 1014 | for (int i = 0; i < mCallbacks.size(); i++) { |
| 1015 | mCallbacks.get(i).showPinningEscapeToast(); |
| 1016 | } |
| 1017 | break; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 1018 | } |
| 1019 | } |
| 1020 | } |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 1021 | |
| 1022 | // Need this class since CommandQueue already extends IStatusBar.Stub, so CommandQueueStart |
| 1023 | // is needed so it can extend SystemUI. |
| 1024 | public static class CommandQueueStart extends SystemUI { |
| 1025 | @Override |
| 1026 | public void start() { |
Charles Chen | f3d295c | 2018-11-30 18:15:21 +0800 | [diff] [blame] | 1027 | putComponent(CommandQueue.class, new CommandQueue(mContext)); |
Jason Monk | b5b09201 | 2017-01-05 11:35:34 -0500 | [diff] [blame] | 1028 | } |
| 1029 | } |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 1030 | } |