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 | |
| 19 | import android.os.Handler; |
Joe Onorato | a0c56fe | 2010-05-20 10:21:52 -0700 | [diff] [blame] | 20 | import android.os.IBinder; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 21 | import android.os.Message; |
John Spurlock | de84f0e | 2013-06-12 12:41:00 -0400 | [diff] [blame] | 22 | |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 23 | import com.android.internal.statusbar.IStatusBar; |
| 24 | import com.android.internal.statusbar.StatusBarIcon; |
| 25 | import com.android.internal.statusbar.StatusBarIconList; |
| 26 | |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 27 | /** |
| 28 | * This class takes the functions from IStatusBar that come in on |
| 29 | * binder pool threads and posts messages to get them onto the main |
| 30 | * thread, and calls onto Callbacks. It also takes care of |
Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 31 | * coalescing these calls so they don't stack up. For the calls |
| 32 | * are coalesced, note that they are all idempotent. |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 33 | */ |
Joe Onorato | 808182d | 2010-07-09 18:52:06 -0400 | [diff] [blame] | 34 | public class CommandQueue extends IStatusBar.Stub { |
Daniel Sandler | 1d4d30a | 2011-04-28 12:35:29 -0400 | [diff] [blame] | 35 | private static final int INDEX_MASK = 0xffff; |
| 36 | private static final int MSG_SHIFT = 16; |
| 37 | private static final int MSG_MASK = 0xffff << MSG_SHIFT; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 38 | |
Daniel Sandler | 1d4d30a | 2011-04-28 12:35:29 -0400 | [diff] [blame] | 39 | private static final int OP_SET_ICON = 1; |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 40 | private static final int OP_REMOVE_ICON = 2; |
| 41 | |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 42 | private static final int MSG_ICON = 1 << MSG_SHIFT; |
Christoph Studer | e71fefc | 2014-06-24 16:16:49 +0200 | [diff] [blame] | 43 | private static final int MSG_DISABLE = 2 << MSG_SHIFT; |
| 44 | private static final int MSG_EXPAND_NOTIFICATIONS = 3 << MSG_SHIFT; |
| 45 | private static final int MSG_COLLAPSE_PANELS = 4 << MSG_SHIFT; |
| 46 | private static final int MSG_EXPAND_SETTINGS = 5 << MSG_SHIFT; |
| 47 | private static final int MSG_SET_SYSTEMUI_VISIBILITY = 6 << MSG_SHIFT; |
| 48 | private static final int MSG_TOP_APP_WINDOW_CHANGED = 7 << MSG_SHIFT; |
| 49 | private static final int MSG_SHOW_IME_BUTTON = 8 << MSG_SHIFT; |
| 50 | private static final int MSG_SET_HARD_KEYBOARD_STATUS = 9 << MSG_SHIFT; |
| 51 | private static final int MSG_TOGGLE_RECENT_APPS = 10 << MSG_SHIFT; |
| 52 | private static final int MSG_PRELOAD_RECENT_APPS = 11 << MSG_SHIFT; |
| 53 | private static final int MSG_CANCEL_PRELOAD_RECENT_APPS = 12 << MSG_SHIFT; |
| 54 | private static final int MSG_SET_WINDOW_STATE = 13 << MSG_SHIFT; |
| 55 | private static final int MSG_SHOW_RECENT_APPS = 14 << MSG_SHIFT; |
| 56 | private static final int MSG_HIDE_RECENT_APPS = 15 << MSG_SHIFT; |
John Spurlock | cad5768 | 2014-07-26 17:09:56 -0400 | [diff] [blame^] | 57 | private static final int MSG_BUZZ_BEEP_BLINKED = 16 << MSG_SHIFT; |
Daniel Sandler | 328310c | 2011-09-23 15:56:52 -0400 | [diff] [blame] | 58 | |
Jim Miller | 9a720f5 | 2012-05-30 03:19:43 -0700 | [diff] [blame] | 59 | public static final int FLAG_EXCLUDE_NONE = 0; |
| 60 | public static final int FLAG_EXCLUDE_SEARCH_PANEL = 1 << 0; |
| 61 | public static final int FLAG_EXCLUDE_RECENTS_PANEL = 1 << 1; |
| 62 | public static final int FLAG_EXCLUDE_NOTIFICATION_PANEL = 1 << 2; |
| 63 | public static final int FLAG_EXCLUDE_INPUT_METHODS_PANEL = 1 << 3; |
| 64 | public static final int FLAG_EXCLUDE_COMPAT_MODE_PANEL = 1 << 4; |
| 65 | |
Jason Monk | b605fec | 2014-05-02 17:04:10 -0400 | [diff] [blame] | 66 | private static final String SHOW_IME_SWITCHER_KEY = "showImeSwitcherKey"; |
| 67 | |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 68 | private StatusBarIconList mList; |
| 69 | private Callbacks mCallbacks; |
| 70 | private Handler mHandler = new H(); |
| 71 | |
| 72 | /** |
| 73 | * These methods are called back on the main thread. |
| 74 | */ |
| 75 | public interface Callbacks { |
| 76 | public void addIcon(String slot, int index, int viewIndex, StatusBarIcon icon); |
| 77 | public void updateIcon(String slot, int index, int viewIndex, |
| 78 | StatusBarIcon old, StatusBarIcon icon); |
| 79 | public void removeIcon(String slot, int index, int viewIndex); |
Jorim Jaggi | 2580a976 | 2014-06-25 03:08:25 +0200 | [diff] [blame] | 80 | public void disable(int state, boolean animate); |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 81 | public void animateExpandNotificationsPanel(); |
| 82 | public void animateCollapsePanels(int flags); |
| 83 | public void animateExpandSettingsPanel(); |
Dianne Hackborn | 3a3a6cf | 2012-03-26 10:24:04 -0700 | [diff] [blame] | 84 | public void setSystemUiVisibility(int vis, int mask); |
Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 85 | public void topAppWindowChanged(boolean visible); |
Jason Monk | b605fec | 2014-05-02 17:04:10 -0400 | [diff] [blame] | 86 | public void setImeWindowStatus(IBinder token, int vis, int backDisposition, |
| 87 | boolean showImeSwitcher); |
Jeff Brown | 2992ea7 | 2011-01-28 22:04:14 -0800 | [diff] [blame] | 88 | public void setHardKeyboardStatus(boolean available, boolean enabled); |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 89 | public void showRecentApps(boolean triggeredFromAltTab); |
Winson Chung | 6cb485f | 2014-05-19 10:30:43 -0700 | [diff] [blame] | 90 | public void hideRecentApps(boolean triggeredFromAltTab); |
Michael Jurka | 3b1fc47 | 2011-06-13 10:54:40 -0700 | [diff] [blame] | 91 | public void toggleRecentApps(); |
Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 92 | public void preloadRecentApps(); |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 93 | public void cancelPreloadRecentApps(); |
Jim Miller | e898ac5 | 2012-04-06 17:10:57 -0700 | [diff] [blame] | 94 | public void showSearchPanel(); |
| 95 | public void hideSearchPanel(); |
John Spurlock | 9764218 | 2013-07-29 17:58:39 -0400 | [diff] [blame] | 96 | public void setWindowState(int window, int state); |
John Spurlock | cad5768 | 2014-07-26 17:09:56 -0400 | [diff] [blame^] | 97 | public void buzzBeepBlinked(); |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | public CommandQueue(Callbacks callbacks, StatusBarIconList list) { |
| 101 | mCallbacks = callbacks; |
| 102 | mList = list; |
| 103 | } |
| 104 | |
| 105 | public void setIcon(int index, StatusBarIcon icon) { |
| 106 | synchronized (mList) { |
| 107 | int what = MSG_ICON | index; |
| 108 | mHandler.removeMessages(what); |
| 109 | mHandler.obtainMessage(what, OP_SET_ICON, 0, icon.clone()).sendToTarget(); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | public void removeIcon(int index) { |
| 114 | synchronized (mList) { |
| 115 | int what = MSG_ICON | index; |
| 116 | mHandler.removeMessages(what); |
| 117 | mHandler.obtainMessage(what, OP_REMOVE_ICON, 0, null).sendToTarget(); |
| 118 | } |
| 119 | } |
| 120 | |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 121 | public void disable(int state) { |
| 122 | synchronized (mList) { |
| 123 | mHandler.removeMessages(MSG_DISABLE); |
| 124 | mHandler.obtainMessage(MSG_DISABLE, state, 0, null).sendToTarget(); |
| 125 | } |
| 126 | } |
| 127 | |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 128 | public void animateExpandNotificationsPanel() { |
Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 129 | synchronized (mList) { |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 130 | mHandler.removeMessages(MSG_EXPAND_NOTIFICATIONS); |
| 131 | mHandler.sendEmptyMessage(MSG_EXPAND_NOTIFICATIONS); |
Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 132 | } |
| 133 | } |
| 134 | |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 135 | public void animateCollapsePanels() { |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 136 | synchronized (mList) { |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 137 | mHandler.removeMessages(MSG_COLLAPSE_PANELS); |
| 138 | mHandler.sendEmptyMessage(MSG_COLLAPSE_PANELS); |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 139 | } |
Jim Miller | 9a720f5 | 2012-05-30 03:19:43 -0700 | [diff] [blame] | 140 | } |
| 141 | |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 142 | public void animateExpandSettingsPanel() { |
Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 143 | synchronized (mList) { |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 144 | mHandler.removeMessages(MSG_EXPAND_SETTINGS); |
| 145 | mHandler.sendEmptyMessage(MSG_EXPAND_SETTINGS); |
Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 146 | } |
| 147 | } |
| 148 | |
Dianne Hackborn | 3a3a6cf | 2012-03-26 10:24:04 -0700 | [diff] [blame] | 149 | public void setSystemUiVisibility(int vis, int mask) { |
Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 150 | synchronized (mList) { |
Daniel Sandler | 60ee256 | 2011-07-22 12:34:33 -0400 | [diff] [blame] | 151 | mHandler.removeMessages(MSG_SET_SYSTEMUI_VISIBILITY); |
Dianne Hackborn | 3a3a6cf | 2012-03-26 10:24:04 -0700 | [diff] [blame] | 152 | mHandler.obtainMessage(MSG_SET_SYSTEMUI_VISIBILITY, vis, mask, null).sendToTarget(); |
Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 153 | } |
| 154 | } |
| 155 | |
Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 156 | public void topAppWindowChanged(boolean menuVisible) { |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 157 | synchronized (mList) { |
Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 158 | mHandler.removeMessages(MSG_TOP_APP_WINDOW_CHANGED); |
| 159 | mHandler.obtainMessage(MSG_TOP_APP_WINDOW_CHANGED, menuVisible ? 1 : 0, 0, |
| 160 | null).sendToTarget(); |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 161 | } |
| 162 | } |
| 163 | |
Jason Monk | b605fec | 2014-05-02 17:04:10 -0400 | [diff] [blame] | 164 | public void setImeWindowStatus(IBinder token, int vis, int backDisposition, |
| 165 | boolean showImeSwitcher) { |
satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 166 | synchronized (mList) { |
| 167 | mHandler.removeMessages(MSG_SHOW_IME_BUTTON); |
Jason Monk | b605fec | 2014-05-02 17:04:10 -0400 | [diff] [blame] | 168 | Message m = mHandler.obtainMessage(MSG_SHOW_IME_BUTTON, vis, backDisposition, token); |
| 169 | m.getData().putBoolean(SHOW_IME_SWITCHER_KEY, showImeSwitcher); |
| 170 | m.sendToTarget(); |
satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 171 | } |
| 172 | } |
| 173 | |
Jeff Brown | 2992ea7 | 2011-01-28 22:04:14 -0800 | [diff] [blame] | 174 | public void setHardKeyboardStatus(boolean available, boolean enabled) { |
| 175 | synchronized (mList) { |
| 176 | mHandler.removeMessages(MSG_SET_HARD_KEYBOARD_STATUS); |
| 177 | mHandler.obtainMessage(MSG_SET_HARD_KEYBOARD_STATUS, |
| 178 | available ? 1 : 0, enabled ? 1 : 0).sendToTarget(); |
| 179 | } |
| 180 | } |
| 181 | |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 182 | public void showRecentApps(boolean triggeredFromAltTab) { |
| 183 | synchronized (mList) { |
| 184 | mHandler.removeMessages(MSG_SHOW_RECENT_APPS); |
| 185 | mHandler.obtainMessage(MSG_SHOW_RECENT_APPS, |
| 186 | triggeredFromAltTab ? 1 : 0, 0, null).sendToTarget(); |
| 187 | } |
| 188 | } |
| 189 | |
Winson Chung | 6cb485f | 2014-05-19 10:30:43 -0700 | [diff] [blame] | 190 | public void hideRecentApps(boolean triggeredFromAltTab) { |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 191 | synchronized (mList) { |
| 192 | mHandler.removeMessages(MSG_HIDE_RECENT_APPS); |
Winson Chung | 6cb485f | 2014-05-19 10:30:43 -0700 | [diff] [blame] | 193 | mHandler.obtainMessage(MSG_HIDE_RECENT_APPS, |
| 194 | triggeredFromAltTab ? 1 : 0, 0, null).sendToTarget(); |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 195 | } |
| 196 | } |
| 197 | |
Michael Jurka | 3b1fc47 | 2011-06-13 10:54:40 -0700 | [diff] [blame] | 198 | public void toggleRecentApps() { |
| 199 | synchronized (mList) { |
| 200 | mHandler.removeMessages(MSG_TOGGLE_RECENT_APPS); |
| 201 | mHandler.obtainMessage(MSG_TOGGLE_RECENT_APPS, 0, 0, null).sendToTarget(); |
| 202 | } |
| 203 | } |
| 204 | |
Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 205 | public void preloadRecentApps() { |
| 206 | synchronized (mList) { |
| 207 | mHandler.removeMessages(MSG_PRELOAD_RECENT_APPS); |
| 208 | mHandler.obtainMessage(MSG_PRELOAD_RECENT_APPS, 0, 0, null).sendToTarget(); |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | public void cancelPreloadRecentApps() { |
| 213 | synchronized (mList) { |
| 214 | mHandler.removeMessages(MSG_CANCEL_PRELOAD_RECENT_APPS); |
| 215 | mHandler.obtainMessage(MSG_CANCEL_PRELOAD_RECENT_APPS, 0, 0, null).sendToTarget(); |
| 216 | } |
| 217 | } |
| 218 | |
John Spurlock | 9764218 | 2013-07-29 17:58:39 -0400 | [diff] [blame] | 219 | public void setWindowState(int window, int state) { |
| 220 | synchronized (mList) { |
John Spurlock | 5b9145b | 2013-08-20 15:13:47 -0400 | [diff] [blame] | 221 | // don't coalesce these |
John Spurlock | 9764218 | 2013-07-29 17:58:39 -0400 | [diff] [blame] | 222 | mHandler.obtainMessage(MSG_SET_WINDOW_STATE, window, state, null).sendToTarget(); |
| 223 | } |
| 224 | } |
| 225 | |
John Spurlock | cad5768 | 2014-07-26 17:09:56 -0400 | [diff] [blame^] | 226 | public void buzzBeepBlinked() { |
| 227 | synchronized (mList) { |
| 228 | mHandler.removeMessages(MSG_BUZZ_BEEP_BLINKED); |
| 229 | mHandler.sendEmptyMessage(MSG_BUZZ_BEEP_BLINKED); |
| 230 | } |
| 231 | } |
Jorim Jaggi | 380ecb8 | 2014-03-14 17:25:20 +0100 | [diff] [blame] | 232 | |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 233 | private final class H extends Handler { |
| 234 | public void handleMessage(Message msg) { |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 235 | final int what = msg.what & MSG_MASK; |
Joe Onorato | 66d7d01 | 2010-05-14 10:05:10 -0700 | [diff] [blame] | 236 | switch (what) { |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 237 | case MSG_ICON: { |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 238 | final int index = msg.what & INDEX_MASK; |
| 239 | final int viewIndex = mList.getViewIndex(index); |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 240 | switch (msg.arg1) { |
| 241 | case OP_SET_ICON: { |
| 242 | StatusBarIcon icon = (StatusBarIcon)msg.obj; |
| 243 | StatusBarIcon old = mList.getIcon(index); |
| 244 | if (old == null) { |
| 245 | mList.setIcon(index, icon); |
| 246 | mCallbacks.addIcon(mList.getSlot(index), index, viewIndex, icon); |
| 247 | } else { |
| 248 | mList.setIcon(index, icon); |
| 249 | mCallbacks.updateIcon(mList.getSlot(index), index, viewIndex, |
| 250 | old, icon); |
| 251 | } |
| 252 | break; |
| 253 | } |
| 254 | case OP_REMOVE_ICON: |
Joe Onorato | 795f284 | 2010-09-27 11:34:46 -0700 | [diff] [blame] | 255 | if (mList.getIcon(index) != null) { |
| 256 | mList.removeIcon(index); |
| 257 | mCallbacks.removeIcon(mList.getSlot(index), index, viewIndex); |
| 258 | } |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 259 | break; |
| 260 | } |
| 261 | break; |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 262 | } |
| 263 | case MSG_DISABLE: |
Jorim Jaggi | 2580a976 | 2014-06-25 03:08:25 +0200 | [diff] [blame] | 264 | mCallbacks.disable(msg.arg1, true /* animate */); |
Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 265 | break; |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 266 | case MSG_EXPAND_NOTIFICATIONS: |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 267 | mCallbacks.animateExpandNotificationsPanel(); |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 268 | break; |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 269 | case MSG_COLLAPSE_PANELS: |
| 270 | mCallbacks.animateCollapsePanels(0); |
Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 271 | break; |
Daniel Sandler | 11cf178 | 2012-09-27 14:03:08 -0400 | [diff] [blame] | 272 | case MSG_EXPAND_SETTINGS: |
| 273 | mCallbacks.animateExpandSettingsPanel(); |
Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 274 | break; |
Daniel Sandler | 60ee256 | 2011-07-22 12:34:33 -0400 | [diff] [blame] | 275 | case MSG_SET_SYSTEMUI_VISIBILITY: |
Dianne Hackborn | 3a3a6cf | 2012-03-26 10:24:04 -0700 | [diff] [blame] | 276 | mCallbacks.setSystemUiVisibility(msg.arg1, msg.arg2); |
Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 277 | break; |
Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 278 | case MSG_TOP_APP_WINDOW_CHANGED: |
| 279 | mCallbacks.topAppWindowChanged(msg.arg1 != 0); |
Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 280 | break; |
satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 281 | case MSG_SHOW_IME_BUTTON: |
Jason Monk | b605fec | 2014-05-02 17:04:10 -0400 | [diff] [blame] | 282 | mCallbacks.setImeWindowStatus((IBinder) msg.obj, msg.arg1, msg.arg2, |
| 283 | msg.getData().getBoolean(SHOW_IME_SWITCHER_KEY, false)); |
satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 284 | break; |
Jeff Brown | 2992ea7 | 2011-01-28 22:04:14 -0800 | [diff] [blame] | 285 | case MSG_SET_HARD_KEYBOARD_STATUS: |
| 286 | mCallbacks.setHardKeyboardStatus(msg.arg1 != 0, msg.arg2 != 0); |
| 287 | break; |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 288 | case MSG_SHOW_RECENT_APPS: |
| 289 | mCallbacks.showRecentApps(msg.arg1 != 0); |
| 290 | break; |
| 291 | case MSG_HIDE_RECENT_APPS: |
Winson Chung | 6cb485f | 2014-05-19 10:30:43 -0700 | [diff] [blame] | 292 | mCallbacks.hideRecentApps(msg.arg1 != 0); |
Winson Chung | 1e8d71b | 2014-05-16 17:05:22 -0700 | [diff] [blame] | 293 | break; |
Michael Jurka | 3b1fc47 | 2011-06-13 10:54:40 -0700 | [diff] [blame] | 294 | case MSG_TOGGLE_RECENT_APPS: |
| 295 | mCallbacks.toggleRecentApps(); |
| 296 | break; |
Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 297 | case MSG_PRELOAD_RECENT_APPS: |
| 298 | mCallbacks.preloadRecentApps(); |
| 299 | break; |
| 300 | case MSG_CANCEL_PRELOAD_RECENT_APPS: |
| 301 | mCallbacks.cancelPreloadRecentApps(); |
| 302 | break; |
John Spurlock | 9764218 | 2013-07-29 17:58:39 -0400 | [diff] [blame] | 303 | case MSG_SET_WINDOW_STATE: |
| 304 | mCallbacks.setWindowState(msg.arg1, msg.arg2); |
| 305 | break; |
John Spurlock | cad5768 | 2014-07-26 17:09:56 -0400 | [diff] [blame^] | 306 | case MSG_BUZZ_BEEP_BLINKED: |
| 307 | mCallbacks.buzzBeepBlinked(); |
| 308 | break; |
Jorim Jaggi | 5cf1787 | 2014-03-26 18:31:48 +0100 | [diff] [blame] | 309 | |
Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 310 | } |
| 311 | } |
| 312 | } |
| 313 | } |
| 314 | |