blob: 5a2758d89de87cf0f6aaa889aed9bd858872bd19 [file] [log] [blame]
Joe Onorato0cbda992010-05-02 16:28:15 -07001/*
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 Onorato79de0c52010-05-26 17:03:26 -040017package com.android.systemui.statusbar;
Joe Onorato0cbda992010-05-02 16:28:15 -070018
Jorim Jaggi165ce062015-07-06 16:18:11 -070019import android.os.Bundle;
Joe Onorato0cbda992010-05-02 16:28:15 -070020import android.os.Handler;
Joe Onoratoa0c56fe2010-05-20 10:21:52 -070021import android.os.IBinder;
Joe Onorato0cbda992010-05-02 16:28:15 -070022import android.os.Message;
Jorim Jaggi24bec7c2015-02-04 12:40:14 +010023import android.util.Pair;
John Spurlockde84f0e2013-06-12 12:41:00 -040024
Joe Onorato0cbda992010-05-02 16:28:15 -070025import com.android.internal.statusbar.IStatusBar;
26import com.android.internal.statusbar.StatusBarIcon;
27import com.android.internal.statusbar.StatusBarIconList;
28
Joe Onoratof3f0e052010-05-14 18:49:29 -070029/**
30 * This class takes the functions from IStatusBar that come in on
31 * binder pool threads and posts messages to get them onto the main
32 * thread, and calls onto Callbacks. It also takes care of
Joe Onorato4762c2d2010-05-17 15:42:59 -070033 * coalescing these calls so they don't stack up. For the calls
34 * are coalesced, note that they are all idempotent.
Joe Onoratof3f0e052010-05-14 18:49:29 -070035 */
Joe Onorato808182d2010-07-09 18:52:06 -040036public class CommandQueue extends IStatusBar.Stub {
Daniel Sandler1d4d30a2011-04-28 12:35:29 -040037 private static final int INDEX_MASK = 0xffff;
38 private static final int MSG_SHIFT = 16;
39 private static final int MSG_MASK = 0xffff << MSG_SHIFT;
Joe Onorato0cbda992010-05-02 16:28:15 -070040
Daniel Sandler1d4d30a2011-04-28 12:35:29 -040041 private static final int OP_SET_ICON = 1;
Joe Onorato0cbda992010-05-02 16:28:15 -070042 private static final int OP_REMOVE_ICON = 2;
43
Svetoslav Ganove20a1772012-09-25 16:07:46 -070044 private static final int MSG_ICON = 1 << MSG_SHIFT;
Christoph Studere71fefc2014-06-24 16:16:49 +020045 private static final int MSG_DISABLE = 2 << MSG_SHIFT;
46 private static final int MSG_EXPAND_NOTIFICATIONS = 3 << MSG_SHIFT;
47 private static final int MSG_COLLAPSE_PANELS = 4 << MSG_SHIFT;
48 private static final int MSG_EXPAND_SETTINGS = 5 << MSG_SHIFT;
49 private static final int MSG_SET_SYSTEMUI_VISIBILITY = 6 << MSG_SHIFT;
50 private static final int MSG_TOP_APP_WINDOW_CHANGED = 7 << MSG_SHIFT;
51 private static final int MSG_SHOW_IME_BUTTON = 8 << MSG_SHIFT;
Michael Wright665366a2014-08-07 15:44:40 -070052 private static final int MSG_TOGGLE_RECENT_APPS = 9 << MSG_SHIFT;
53 private static final int MSG_PRELOAD_RECENT_APPS = 10 << MSG_SHIFT;
54 private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 11 << MSG_SHIFT;
55 private static final int MSG_SET_WINDOW_STATE = 12 << MSG_SHIFT;
56 private static final int MSG_SHOW_RECENT_APPS = 13 << MSG_SHIFT;
57 private static final int MSG_HIDE_RECENT_APPS = 14 << MSG_SHIFT;
58 private static final int MSG_BUZZ_BEEP_BLINKED = 15 << MSG_SHIFT;
59 private static final int MSG_NOTIFICATION_LIGHT_OFF = 16 << MSG_SHIFT;
60 private static final int MSG_NOTIFICATION_LIGHT_PULSE = 17 << MSG_SHIFT;
Jason Monk5565cb42014-09-12 10:59:21 -040061 private static final int MSG_SHOW_SCREEN_PIN_REQUEST = 18 << MSG_SHIFT;
Jorim Jaggi24bec7c2015-02-04 12:40:14 +010062 private static final int MSG_APP_TRANSITION_PENDING = 19 << MSG_SHIFT;
63 private static final int MSG_APP_TRANSITION_CANCELLED = 20 << MSG_SHIFT;
64 private static final int MSG_APP_TRANSITION_STARTING = 21 << MSG_SHIFT;
Adrian Roos4f43dc02015-06-17 16:43:38 -070065 private static final int MSG_ASSIST_DISCLOSURE = 22 << MSG_SHIFT;
Jorim Jaggi165ce062015-07-06 16:18:11 -070066 private static final int MSG_START_ASSIST = 23 << MSG_SHIFT;
Selim Cinek372d1bd2015-08-14 13:19:37 -070067 private static final int MSG_CAMERA_LAUNCH_GESTURE = 24 << MSG_SHIFT;
Andrei Stingaceanuc22ab792016-01-07 12:39:38 +000068 private static final int MSG_TOGGLE_KEYBOARD_SHORTCUTS = 25 << MSG_SHIFT;
Daniel Sandler328310c2011-09-23 15:56:52 -040069
Jim Miller9a720f52012-05-30 03:19:43 -070070 public static final int FLAG_EXCLUDE_NONE = 0;
71 public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0;
72 public static final int FLAG_EXCLUDE_RECENTS_PANEL = 1 << 1;
73 public static final int FLAG_EXCLUDE_NOTIFICATION_PANEL = 1 << 2;
74 public static final int FLAG_EXCLUDE_INPUT_METHODS_PANEL = 1 << 3;
75 public static final int FLAG_EXCLUDE_COMPAT_MODE_PANEL = 1 << 4;
76
Jason Monkb605fec2014-05-02 17:04:10 -040077 private static final String SHOW_IME_SWITCHER_KEY = "showImeSwitcherKey";
78
Joe Onorato0cbda992010-05-02 16:28:15 -070079 private StatusBarIconList mList;
80 private Callbacks mCallbacks;
81 private Handler mHandler = new H();
82
83 /**
84 * These methods are called back on the main thread.
85 */
86 public interface Callbacks {
87 public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon);
88 public void updateIcon(String slot, int index, int viewIndex,
89 StatusBarIcon old, StatusBarIcon icon);
90 public void removeIcon(String slot, int index, int viewIndex);
Benjamin Franzcde0a2a2015-04-23 17:19:48 +010091 public void disable(int state1, int state2, boolean animate);
Daniel Sandler11cf1782012-09-27 14:03:08 -040092 public void animateExpandNotificationsPanel();
93 public void animateCollapsePanels(int flags);
Jason Monka9927322015-12-13 16:22:37 -050094 public void animateExpandSettingsPanel(String obj);
Dianne Hackborn3a3a6cf2012-03-26 10:24:04 -070095 public void setSystemUiVisibility(int vis, int mask);
Dianne Hackborn7d049322011-06-14 15:00:32 -070096 public void topAppWindowChanged(boolean visible);
Jason Monkb605fec2014-05-02 17:04:10 -040097 public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
98 boolean showImeSwitcher);
Winson Chung1e8d71b2014-05-16 17:05:22 -070099 public void showRecentApps(boolean triggeredFromAltTab);
Winson Chungcdcd4872014-08-05 18:00:13 -0700100 public void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey);
Michael Jurka3b1fc472011-06-13 10:54:40 -0700101 public void toggleRecentApps();
Michael Jurka7f2668c2012-03-27 07:49:52 -0700102 public void preloadRecentApps();
Andrei Stingaceanuc22ab792016-01-07 12:39:38 +0000103 public void toggleKeyboardShortcutsMenu();
Winson Chung1e8d71b2014-05-16 17:05:22 -0700104 public void cancelPreloadRecentApps();
John Spurlock97642182013-07-29 17:58:39 -0400105 public void setWindowState(int window, int state);
John Spurlockcad57682014-07-26 17:09:56 -0400106 public void buzzBeepBlinked();
John Spurlockcb566aa2014-08-03 22:58:28 -0400107 public void notificationLightOff();
108 public void notificationLightPulse(int argb, int onMillis, int offMillis);
Jason Monk5565cb42014-09-12 10:59:21 -0400109 public void showScreenPinningRequest();
Jorim Jaggi24bec7c2015-02-04 12:40:14 +0100110 public void appTransitionPending();
111 public void appTransitionCancelled();
112 public void appTransitionStarting(long startTime, long duration);
Adrian Roos4f43dc02015-06-17 16:43:38 -0700113 public void showAssistDisclosure();
Jorim Jaggi165ce062015-07-06 16:18:11 -0700114 public void startAssist(Bundle args);
Jorim Jaggi40aa8812015-09-23 12:59:22 -0700115 public void onCameraLaunchGestureDetected(int source);
Joe Onorato0cbda992010-05-02 16:28:15 -0700116 }
117
118 public CommandQueue(Callbacks callbacks, StatusBarIconList list) {
119 mCallbacks = callbacks;
120 mList = list;
121 }
122
123 public void setIcon(int index, StatusBarIcon icon) {
124 synchronized (mList) {
125 int what = MSG_ICON | index;
126 mHandler.removeMessages(what);
127 mHandler.obtainMessage(what, OP_SET_ICON, 0, icon.clone()).sendToTarget();
128 }
129 }
130
131 public void removeIcon(int index) {
132 synchronized (mList) {
133 int what = MSG_ICON | index;
134 mHandler.removeMessages(what);
135 mHandler.obtainMessage(what, OP_REMOVE_ICON, 0, null).sendToTarget();
136 }
137 }
138
Benjamin Franzcde0a2a2015-04-23 17:19:48 +0100139 public void disable(int state1, int state2) {
Joe Onoratof3f0e052010-05-14 18:49:29 -0700140 synchronized (mList) {
141 mHandler.removeMessages(MSG_DISABLE);
Benjamin Franzcde0a2a2015-04-23 17:19:48 +0100142 mHandler.obtainMessage(MSG_DISABLE, state1, state2, null).sendToTarget();
Joe Onoratof3f0e052010-05-14 18:49:29 -0700143 }
144 }
145
Daniel Sandler11cf1782012-09-27 14:03:08 -0400146 public void animateExpandNotificationsPanel() {
Joe Onorato4762c2d2010-05-17 15:42:59 -0700147 synchronized (mList) {
Svetoslav Ganove20a1772012-09-25 16:07:46 -0700148 mHandler.removeMessages(MSG_EXPAND_NOTIFICATIONS);
149 mHandler.sendEmptyMessage(MSG_EXPAND_NOTIFICATIONS);
Joe Onorato4762c2d2010-05-17 15:42:59 -0700150 }
151 }
152
Daniel Sandler11cf1782012-09-27 14:03:08 -0400153 public void animateCollapsePanels() {
Svetoslav Ganove20a1772012-09-25 16:07:46 -0700154 synchronized (mList) {
Daniel Sandler11cf1782012-09-27 14:03:08 -0400155 mHandler.removeMessages(MSG_COLLAPSE_PANELS);
156 mHandler.sendEmptyMessage(MSG_COLLAPSE_PANELS);
Svetoslav Ganove20a1772012-09-25 16:07:46 -0700157 }
Jim Miller9a720f52012-05-30 03:19:43 -0700158 }
159
Jason Monka9927322015-12-13 16:22:37 -0500160 public void animateExpandSettingsPanel(String subPanel) {
Joe Onorato4762c2d2010-05-17 15:42:59 -0700161 synchronized (mList) {
Daniel Sandler11cf1782012-09-27 14:03:08 -0400162 mHandler.removeMessages(MSG_EXPAND_SETTINGS);
Jason Monka9927322015-12-13 16:22:37 -0500163 mHandler.obtainMessage(MSG_EXPAND_SETTINGS, subPanel).sendToTarget();
Joe Onorato4762c2d2010-05-17 15:42:59 -0700164 }
165 }
166
Dianne Hackborn3a3a6cf2012-03-26 10:24:04 -0700167 public void setSystemUiVisibility(int vis, int mask) {
Joe Onorato93056472010-09-10 10:30:46 -0400168 synchronized (mList) {
Selim Cinek4a4a2bddc2015-05-07 12:50:19 -0700169 // Don't coalesce these, since it might have one time flags set such as
170 // STATUS_BAR_UNHIDE which might get lost.
Dianne Hackborn3a3a6cf2012-03-26 10:24:04 -0700171 mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY, vis, mask, null).sendToTarget();
Joe Onorato93056472010-09-10 10:30:46 -0400172 }
173 }
174
Dianne Hackborn7d049322011-06-14 15:00:32 -0700175 public void topAppWindowChanged(boolean menuVisible) {
Daniel Sandlere02d8082010-10-08 15:13:22 -0400176 synchronized (mList) {
Dianne Hackborn7d049322011-06-14 15:00:32 -0700177 mHandler.removeMessages(MSG_TOP_APP_WINDOW_CHANGED);
178 mHandler.obtainMessage(MSG_TOP_APP_WINDOW_CHANGED, menuVisible ? 1 : 0, 0,
179 null).sendToTarget();
Daniel Sandlere02d8082010-10-08 15:13:22 -0400180 }
181 }
182
Jason Monkb605fec2014-05-02 17:04:10 -0400183 public void setImeWindowStatus(IBinder token, int vis, int backDisposition,
184 boolean showImeSwitcher) {
satok06487a52010-10-29 11:37:18 +0900185 synchronized (mList) {
186 mHandler.removeMessages(MSG_SHOW_IME_BUTTON);
Jason Monkb605fec2014-05-02 17:04:10 -0400187 Message m = mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, vis, backDisposition, token);
188 m.getData().putBoolean(SHOW_IME_SWITCHER_KEY, showImeSwitcher);
189 m.sendToTarget();
satok06487a52010-10-29 11:37:18 +0900190 }
191 }
192
Winson Chung1e8d71b2014-05-16 17:05:22 -0700193 public void showRecentApps(boolean triggeredFromAltTab) {
194 synchronized (mList) {
195 mHandler.removeMessages(MSG_SHOW_RECENT_APPS);
196 mHandler.obtainMessage(MSG_SHOW_RECENT_APPS,
197 triggeredFromAltTab ? 1 : 0, 0, null).sendToTarget();
198 }
199 }
200
Winson Chungcdcd4872014-08-05 18:00:13 -0700201 public void hideRecentApps(boolean triggeredFromAltTab, boolean triggeredFromHomeKey) {
Winson Chung1e8d71b2014-05-16 17:05:22 -0700202 synchronized (mList) {
203 mHandler.removeMessages(MSG_HIDE_RECENT_APPS);
Winson Chung6cb485f2014-05-19 10:30:43 -0700204 mHandler.obtainMessage(MSG_HIDE_RECENT_APPS,
Winson Chungcdcd4872014-08-05 18:00:13 -0700205 triggeredFromAltTab ? 1 : 0, triggeredFromHomeKey ? 1 : 0,
206 null).sendToTarget();
Winson Chung1e8d71b2014-05-16 17:05:22 -0700207 }
208 }
209
Michael Jurka3b1fc472011-06-13 10:54:40 -0700210 public void toggleRecentApps() {
211 synchronized (mList) {
212 mHandler.removeMessages(MSG_TOGGLE_RECENT_APPS);
213 mHandler.obtainMessage(MSG_TOGGLE_RECENT_APPS, 0, 0, null).sendToTarget();
214 }
215 }
216
Michael Jurka7f2668c2012-03-27 07:49:52 -0700217 public void preloadRecentApps() {
218 synchronized (mList) {
219 mHandler.removeMessages(MSG_PRELOAD_RECENT_APPS);
220 mHandler.obtainMessage(MSG_PRELOAD_RECENT_APPS, 0, 0, null).sendToTarget();
221 }
222 }
223
224 public void cancelPreloadRecentApps() {
225 synchronized (mList) {
226 mHandler.removeMessages(MSG_CANCEL_PRELOAD_RECENT_APPS);
227 mHandler.obtainMessage(MSG_CANCEL_PRELOAD_RECENT_APPS, 0, 0, null).sendToTarget();
228 }
229 }
230
Clara Bayarrif2debb12015-07-10 14:47:17 +0100231 @Override
Andrei Stingaceanuc22ab792016-01-07 12:39:38 +0000232 public void toggleKeyboardShortcutsMenu() {
Clara Bayarrif2debb12015-07-10 14:47:17 +0100233 synchronized (mList) {
Andrei Stingaceanuc22ab792016-01-07 12:39:38 +0000234 mHandler.removeMessages(MSG_TOGGLE_KEYBOARD_SHORTCUTS);
235 mHandler.obtainMessage(MSG_TOGGLE_KEYBOARD_SHORTCUTS).sendToTarget();
Clara Bayarrif2debb12015-07-10 14:47:17 +0100236 }
237 }
238
John Spurlock97642182013-07-29 17:58:39 -0400239 public void setWindowState(int window, int state) {
240 synchronized (mList) {
John Spurlock5b9145b2013-08-20 15:13:47 -0400241 // don't coalesce these
John Spurlock97642182013-07-29 17:58:39 -0400242 mHandler.obtainMessage(MSG_SET_WINDOW_STATE, window, state, null).sendToTarget();
243 }
244 }
245
John Spurlockcad57682014-07-26 17:09:56 -0400246 public void buzzBeepBlinked() {
247 synchronized (mList) {
248 mHandler.removeMessages(MSG_BUZZ_BEEP_BLINKED);
249 mHandler.sendEmptyMessage(MSG_BUZZ_BEEP_BLINKED);
250 }
251 }
Jorim Jaggi380ecb82014-03-14 17:25:20 +0100252
John Spurlockcb566aa2014-08-03 22:58:28 -0400253 public void notificationLightOff() {
254 synchronized (mList) {
255 mHandler.sendEmptyMessage(MSG_NOTIFICATION_LIGHT_OFF);
256 }
257 }
258
259 public void notificationLightPulse(int argb, int onMillis, int offMillis) {
260 synchronized (mList) {
261 mHandler.obtainMessage(MSG_NOTIFICATION_LIGHT_PULSE, onMillis, offMillis, argb)
262 .sendToTarget();
263 }
264 }
265
Jason Monk5565cb42014-09-12 10:59:21 -0400266 public void showScreenPinningRequest() {
267 synchronized (mList) {
268 mHandler.sendEmptyMessage(MSG_SHOW_SCREEN_PIN_REQUEST);
269 }
270 }
271
Jorim Jaggi24bec7c2015-02-04 12:40:14 +0100272 public void appTransitionPending() {
273 synchronized (mList) {
274 mHandler.removeMessages(MSG_APP_TRANSITION_PENDING);
275 mHandler.sendEmptyMessage(MSG_APP_TRANSITION_PENDING);
276 }
277 }
278
279 public void appTransitionCancelled() {
280 synchronized (mList) {
281 mHandler.removeMessages(MSG_APP_TRANSITION_PENDING);
282 mHandler.sendEmptyMessage(MSG_APP_TRANSITION_PENDING);
283 }
284 }
285
286 public void appTransitionStarting(long startTime, long duration) {
287 synchronized (mList) {
288 mHandler.removeMessages(MSG_APP_TRANSITION_STARTING);
289 mHandler.obtainMessage(MSG_APP_TRANSITION_STARTING, Pair.create(startTime, duration))
290 .sendToTarget();
291 }
292 }
293
Adrian Roos4f43dc02015-06-17 16:43:38 -0700294 public void showAssistDisclosure() {
295 synchronized (mList) {
296 mHandler.removeMessages(MSG_ASSIST_DISCLOSURE);
297 mHandler.obtainMessage(MSG_ASSIST_DISCLOSURE).sendToTarget();
298 }
299 }
300
Jorim Jaggi165ce062015-07-06 16:18:11 -0700301 public void startAssist(Bundle args) {
302 synchronized (mList) {
303 mHandler.removeMessages(MSG_START_ASSIST);
304 mHandler.obtainMessage(MSG_START_ASSIST, args).sendToTarget();
305 }
306 }
307
Selim Cinek372d1bd2015-08-14 13:19:37 -0700308 @Override
Jorim Jaggi40aa8812015-09-23 12:59:22 -0700309 public void onCameraLaunchGestureDetected(int source) {
Selim Cinek372d1bd2015-08-14 13:19:37 -0700310 synchronized (mList) {
311 mHandler.removeMessages(MSG_CAMERA_LAUNCH_GESTURE);
Jorim Jaggi40aa8812015-09-23 12:59:22 -0700312 mHandler.obtainMessage(MSG_CAMERA_LAUNCH_GESTURE, source, 0).sendToTarget();
Selim Cinek372d1bd2015-08-14 13:19:37 -0700313 }
314 }
315
Joe Onorato0cbda992010-05-02 16:28:15 -0700316 private final class H extends Handler {
317 public void handleMessage(Message msg) {
Joe Onoratof3f0e052010-05-14 18:49:29 -0700318 final int what = msg.what & MSG_MASK;
Joe Onorato66d7d012010-05-14 10:05:10 -0700319 switch (what) {
Joe Onorato0cbda992010-05-02 16:28:15 -0700320 case MSG_ICON: {
Joe Onoratof3f0e052010-05-14 18:49:29 -0700321 final int index = msg.what & INDEX_MASK;
322 final int viewIndex = mList.getViewIndex(index);
Joe Onorato0cbda992010-05-02 16:28:15 -0700323 switch (msg.arg1) {
324 case OP_SET_ICON: {
325 StatusBarIcon icon = (StatusBarIcon)msg.obj;
326 StatusBarIcon old = mList.getIcon(index);
327 if (old == null) {
328 mList.setIcon(index, icon);
329 mCallbacks.addIcon(mList.getSlot(index), index, viewIndex, icon);
330 } else {
331 mList.setIcon(index, icon);
332 mCallbacks.updateIcon(mList.getSlot(index), index, viewIndex,
333 old, icon);
334 }
335 break;
336 }
337 case OP_REMOVE_ICON:
Joe Onorato795f2842010-09-27 11:34:46 -0700338 if (mList.getIcon(index) != null) {
339 mList.removeIcon(index);
340 mCallbacks.removeIcon(mList.getSlot(index), index, viewIndex);
341 }
Joe Onorato0cbda992010-05-02 16:28:15 -0700342 break;
343 }
344 break;
Joe Onoratof3f0e052010-05-14 18:49:29 -0700345 }
346 case MSG_DISABLE:
Benjamin Franzcde0a2a2015-04-23 17:19:48 +0100347 mCallbacks.disable(msg.arg1, msg.arg2, true /* animate */);
Joe Onoratof3f0e052010-05-14 18:49:29 -0700348 break;
Svetoslav Ganove20a1772012-09-25 16:07:46 -0700349 case MSG_EXPAND_NOTIFICATIONS:
Daniel Sandler11cf1782012-09-27 14:03:08 -0400350 mCallbacks.animateExpandNotificationsPanel();
Svetoslav Ganove20a1772012-09-25 16:07:46 -0700351 break;
Daniel Sandler11cf1782012-09-27 14:03:08 -0400352 case MSG_COLLAPSE_PANELS:
353 mCallbacks.animateCollapsePanels(0);
Svetoslav Ganove20a1772012-09-25 16:07:46 -0700354 break;
Daniel Sandler11cf1782012-09-27 14:03:08 -0400355 case MSG_EXPAND_SETTINGS:
Jason Monka9927322015-12-13 16:22:37 -0500356 mCallbacks.animateExpandSettingsPanel((String) msg.obj);
Joe Onorato93056472010-09-10 10:30:46 -0400357 break;
Daniel Sandler60ee2562011-07-22 12:34:33 -0400358 case MSG_SET_SYSTEMUI_VISIBILITY:
Dianne Hackborn3a3a6cf2012-03-26 10:24:04 -0700359 mCallbacks.setSystemUiVisibility(msg.arg1, msg.arg2);
Joe Onorato93056472010-09-10 10:30:46 -0400360 break;
Dianne Hackborn7d049322011-06-14 15:00:32 -0700361 case MSG_TOP_APP_WINDOW_CHANGED:
362 mCallbacks.topAppWindowChanged(msg.arg1 != 0);
Daniel Sandlere02d8082010-10-08 15:13:22 -0400363 break;
satok06487a52010-10-29 11:37:18 +0900364 case MSG_SHOW_IME_BUTTON:
Jason Monkb605fec2014-05-02 17:04:10 -0400365 mCallbacks.setImeWindowStatus((IBinder) msg.obj, msg.arg1, msg.arg2,
366 msg.getData().getBoolean(SHOW_IME_SWITCHER_KEY, false));
satok06487a52010-10-29 11:37:18 +0900367 break;
Winson Chung1e8d71b2014-05-16 17:05:22 -0700368 case MSG_SHOW_RECENT_APPS:
369 mCallbacks.showRecentApps(msg.arg1 != 0);
370 break;
371 case MSG_HIDE_RECENT_APPS:
Winson Chungcdcd4872014-08-05 18:00:13 -0700372 mCallbacks.hideRecentApps(msg.arg1 != 0, msg.arg2 != 0);
Winson Chung1e8d71b2014-05-16 17:05:22 -0700373 break;
Michael Jurka3b1fc472011-06-13 10:54:40 -0700374 case MSG_TOGGLE_RECENT_APPS:
375 mCallbacks.toggleRecentApps();
376 break;
Michael Jurka7f2668c2012-03-27 07:49:52 -0700377 case MSG_PRELOAD_RECENT_APPS:
378 mCallbacks.preloadRecentApps();
379 break;
380 case MSG_CANCEL_PRELOAD_RECENT_APPS:
381 mCallbacks.cancelPreloadRecentApps();
382 break;
Andrei Stingaceanuc22ab792016-01-07 12:39:38 +0000383 case MSG_TOGGLE_KEYBOARD_SHORTCUTS:
384 mCallbacks.toggleKeyboardShortcutsMenu();
Clara Bayarrif2debb12015-07-10 14:47:17 +0100385 break;
John Spurlock97642182013-07-29 17:58:39 -0400386 case MSG_SET_WINDOW_STATE:
387 mCallbacks.setWindowState(msg.arg1, msg.arg2);
388 break;
John Spurlockcad57682014-07-26 17:09:56 -0400389 case MSG_BUZZ_BEEP_BLINKED:
390 mCallbacks.buzzBeepBlinked();
391 break;
John Spurlockcb566aa2014-08-03 22:58:28 -0400392 case MSG_NOTIFICATION_LIGHT_OFF:
393 mCallbacks.notificationLightOff();
394 break;
395 case MSG_NOTIFICATION_LIGHT_PULSE:
396 mCallbacks.notificationLightPulse((Integer) msg.obj, msg.arg1, msg.arg2);
397 break;
Jason Monk5565cb42014-09-12 10:59:21 -0400398 case MSG_SHOW_SCREEN_PIN_REQUEST:
399 mCallbacks.showScreenPinningRequest();
400 break;
Jorim Jaggi24bec7c2015-02-04 12:40:14 +0100401 case MSG_APP_TRANSITION_PENDING:
402 mCallbacks.appTransitionPending();
403 break;
404 case MSG_APP_TRANSITION_CANCELLED:
405 mCallbacks.appTransitionCancelled();
406 break;
407 case MSG_APP_TRANSITION_STARTING:
408 Pair<Long, Long> data = (Pair<Long, Long>) msg.obj;
409 mCallbacks.appTransitionStarting(data.first, data.second);
410 break;
Adrian Roos4f43dc02015-06-17 16:43:38 -0700411 case MSG_ASSIST_DISCLOSURE:
412 mCallbacks.showAssistDisclosure();
413 break;
Jorim Jaggi165ce062015-07-06 16:18:11 -0700414 case MSG_START_ASSIST:
415 mCallbacks.startAssist((Bundle) msg.obj);
416 break;
Selim Cinek372d1bd2015-08-14 13:19:37 -0700417 case MSG_CAMERA_LAUNCH_GESTURE:
Jorim Jaggi40aa8812015-09-23 12:59:22 -0700418 mCallbacks.onCameraLaunchGestureDetected(msg.arg1);
Selim Cinek372d1bd2015-08-14 13:19:37 -0700419 break;
Joe Onorato0cbda992010-05-02 16:28:15 -0700420 }
421 }
422 }
423}
424