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