| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 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 | 7a0f36b | 2010-06-07 10:24:36 -0700 | [diff] [blame] | 17 | package com.android.server; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 18 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 19 | import android.app.StatusBarManager; |
| 20 | import android.content.BroadcastReceiver; |
| 21 | import android.content.Context; |
| 22 | import android.content.Intent; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 23 | import android.content.pm.PackageManager; |
| 24 | import android.content.res.Resources; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | import android.os.Binder; |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 26 | import android.os.Handler; |
| Svetoslav Ganov | 6179ea3 | 2011-06-28 01:12:41 -0700 | [diff] [blame] | 27 | import android.os.IBinder; |
| 28 | import android.os.RemoteException; |
| Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 29 | import android.os.UserHandle; |
| Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 30 | import android.util.Slog; |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 31 | |
| 32 | import com.android.internal.statusbar.IStatusBar; |
| 33 | import com.android.internal.statusbar.IStatusBarService; |
| 34 | import com.android.internal.statusbar.StatusBarIcon; |
| 35 | import com.android.internal.statusbar.StatusBarIconList; |
| Joe Onorato | 18e69df | 2010-05-17 22:26:12 -0700 | [diff] [blame] | 36 | import com.android.internal.statusbar.StatusBarNotification; |
| Dianne Hackborn | a924dc0d | 2011-02-17 14:22:17 -0800 | [diff] [blame] | 37 | import com.android.server.wm.WindowManagerService; |
| The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 38 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | import java.io.FileDescriptor; |
| 40 | import java.io.PrintWriter; |
| 41 | import java.util.ArrayList; |
| 42 | import java.util.HashMap; |
| Joe Onorato | 75199e3 | 2010-05-29 17:22:51 -0400 | [diff] [blame] | 43 | import java.util.List; |
| 44 | import java.util.Map; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | |
| 46 | |
| 47 | /** |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 48 | * A note on locking: We rely on the fact that calls onto mBar are oneway or |
| 49 | * if they are local, that they just enqueue messages to not deadlock. |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 50 | */ |
| Joe Onorato | 089de88 | 2010-04-12 08:18:45 -0700 | [diff] [blame] | 51 | public class StatusBarManagerService extends IStatusBarService.Stub |
| Jeff Brown | 2992ea7 | 2011-01-28 22:04:14 -0800 | [diff] [blame] | 52 | implements WindowManagerService.OnHardKeyboardStatusChangeListener |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | { |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 54 | static final String TAG = "StatusBarManagerService"; |
| Joe Onorato | 431bb22 | 2010-10-18 19:13:23 -0400 | [diff] [blame] | 55 | static final boolean SPEW = false; |
| Joe Onorato | df7dbb6 | 2009-11-17 10:43:37 -0800 | [diff] [blame] | 56 | |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 57 | final Context mContext; |
| Jeff Brown | 2992ea7 | 2011-01-28 22:04:14 -0800 | [diff] [blame] | 58 | final WindowManagerService mWindowManager; |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 59 | Handler mHandler = new Handler(); |
| 60 | NotificationCallbacks mNotificationCallbacks; |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 61 | volatile IStatusBar mBar; |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 62 | StatusBarIconList mIcons = new StatusBarIconList(); |
| Joe Onorato | 75199e3 | 2010-05-29 17:22:51 -0400 | [diff] [blame] | 63 | HashMap<IBinder,StatusBarNotification> mNotifications |
| 64 | = new HashMap<IBinder,StatusBarNotification>(); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 65 | |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 66 | // for disabling the status bar |
| 67 | ArrayList<DisableRecord> mDisableRecords = new ArrayList<DisableRecord>(); |
| Joe Onorato | 7bb8eeb | 2011-01-27 16:00:58 -0800 | [diff] [blame] | 68 | IBinder mSysUiVisToken = new Binder(); |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 69 | int mDisabled = 0; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 70 | |
| Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 71 | Object mLock = new Object(); |
| Daniel Sandler | 60ee256 | 2011-07-22 12:34:33 -0400 | [diff] [blame] | 72 | // encompasses lights-out mode and other flags defined on View |
| 73 | int mSystemUiVisibility = 0; |
| Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 74 | boolean mMenuVisible = false; |
| Joe Onorato | 857fd9b | 2011-01-27 15:08:35 -0800 | [diff] [blame] | 75 | int mImeWindowVis = 0; |
| 76 | int mImeBackDisposition; |
| 77 | IBinder mImeToken = null; |
| satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 78 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 79 | private class DisableRecord implements IBinder.DeathRecipient { |
| 80 | String pkg; |
| 81 | int what; |
| 82 | IBinder token; |
| 83 | |
| 84 | public void binderDied() { |
| Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 85 | Slog.i(TAG, "binder died for pkg=" + pkg); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | disable(0, token, pkg); |
| Suchi Amalapurapu | fff2fda | 2009-06-30 21:36:16 -0700 | [diff] [blame] | 87 | token.unlinkToDeath(this, 0); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 88 | } |
| 89 | } |
| 90 | |
| 91 | public interface NotificationCallbacks { |
| 92 | void onSetDisabled(int status); |
| 93 | void onClearAll(); |
| Fred Quintana | 6ecaff1 | 2009-09-25 14:23:13 -0700 | [diff] [blame] | 94 | void onNotificationClick(String pkg, String tag, int id); |
| Daniel Sandler | 0f0b11c | 2010-08-04 15:54:58 -0400 | [diff] [blame] | 95 | void onNotificationClear(String pkg, String tag, int id); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 96 | void onPanelRevealed(); |
| Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 97 | void onNotificationError(String pkg, String tag, int id, |
| 98 | int uid, int initialPid, String message); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 99 | } |
| 100 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 101 | /** |
| 102 | * Construct the service, add the status bar view to the window manager |
| 103 | */ |
| Jeff Brown | 2992ea7 | 2011-01-28 22:04:14 -0800 | [diff] [blame] | 104 | public StatusBarManagerService(Context context, WindowManagerService windowManager) { |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 105 | mContext = context; |
| Jeff Brown | 2992ea7 | 2011-01-28 22:04:14 -0800 | [diff] [blame] | 106 | mWindowManager = windowManager; |
| 107 | mWindowManager.setOnHardKeyboardStatusChangeListener(this); |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 108 | |
| 109 | final Resources res = context.getResources(); |
| Joe Onorato | 75144ea | 2010-06-07 12:36:25 -0700 | [diff] [blame] | 110 | mIcons.defineSlots(res.getStringArray(com.android.internal.R.array.config_statusBarIcons)); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 111 | } |
| 112 | |
| 113 | public void setNotificationCallbacks(NotificationCallbacks listener) { |
| 114 | mNotificationCallbacks = listener; |
| 115 | } |
| 116 | |
| 117 | // ================================================================================ |
| Joe Onorato | 25f95f9 | 2010-04-08 18:37:10 -0500 | [diff] [blame] | 118 | // From IStatusBarService |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 119 | // ================================================================================ |
| Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 120 | public void expandNotifications() { |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 121 | enforceExpandStatusBar(); |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 122 | |
| 123 | if (mBar != null) { |
| 124 | try { |
| Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 125 | mBar.animateExpandNotifications(); |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 126 | } catch (RemoteException ex) { |
| 127 | } |
| 128 | } |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 129 | } |
| 130 | |
| Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 131 | public void collapseNotifications() { |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 132 | enforceExpandStatusBar(); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 133 | |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 134 | if (mBar != null) { |
| 135 | try { |
| Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 136 | mBar.animateCollapseNotifications(); |
| 137 | } catch (RemoteException ex) { |
| 138 | } |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | public void expandQuickSettings() { |
| 143 | enforceExpandStatusBar(); |
| 144 | |
| 145 | if (mBar != null) { |
| 146 | try { |
| 147 | mBar.animateExpandQuickSettings(); |
| 148 | } catch (RemoteException ex) { |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | public void collapseQuickSettings() { |
| 154 | enforceExpandStatusBar(); |
| 155 | |
| 156 | if (mBar != null) { |
| 157 | try { |
| 158 | mBar.animateCollapseQuickSettings(); |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 159 | } catch (RemoteException ex) { |
| 160 | } |
| 161 | } |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 162 | } |
| 163 | |
| 164 | public void disable(int what, IBinder token, String pkg) { |
| 165 | enforceStatusBar(); |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 166 | |
| Joe Onorato | 7bb8eeb | 2011-01-27 16:00:58 -0800 | [diff] [blame] | 167 | synchronized (mLock) { |
| 168 | disableLocked(what, token, pkg); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | private void disableLocked(int what, IBinder token, String pkg) { |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 173 | // It's important that the the callback and the call to mBar get done |
| 174 | // in the same order when multiple threads are calling this function |
| 175 | // so they are paired correctly. The messages on the handler will be |
| 176 | // handled in the order they were enqueued, but will be outside the lock. |
| Joe Onorato | 7bb8eeb | 2011-01-27 16:00:58 -0800 | [diff] [blame] | 177 | manageDisableListLocked(what, token, pkg); |
| 178 | final int net = gatherDisableActionsLocked(); |
| 179 | if (net != mDisabled) { |
| 180 | mDisabled = net; |
| 181 | mHandler.post(new Runnable() { |
| 182 | public void run() { |
| 183 | mNotificationCallbacks.onSetDisabled(net); |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 184 | } |
| Joe Onorato | 7bb8eeb | 2011-01-27 16:00:58 -0800 | [diff] [blame] | 185 | }); |
| 186 | if (mBar != null) { |
| 187 | try { |
| 188 | mBar.disable(net); |
| 189 | } catch (RemoteException ex) { |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 190 | } |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 191 | } |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 192 | } |
| 193 | } |
| 194 | |
| Svetoslav Ganov | 6179ea3 | 2011-06-28 01:12:41 -0700 | [diff] [blame] | 195 | public void setIcon(String slot, String iconPackage, int iconId, int iconLevel, |
| 196 | String contentDescription) { |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 197 | enforceStatusBar(); |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 198 | |
| 199 | synchronized (mIcons) { |
| 200 | int index = mIcons.getSlotIndex(slot); |
| 201 | if (index < 0) { |
| 202 | throw new SecurityException("invalid status bar icon slot: " + slot); |
| 203 | } |
| 204 | |
| Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 205 | StatusBarIcon icon = new StatusBarIcon(iconPackage, UserHandle.OWNER, iconId, |
| 206 | iconLevel, 0, |
| Svetoslav Ganov | 6179ea3 | 2011-06-28 01:12:41 -0700 | [diff] [blame] | 207 | contentDescription); |
| Joe Onorato | 66d7d01 | 2010-05-14 10:05:10 -0700 | [diff] [blame] | 208 | //Slog.d(TAG, "setIcon slot=" + slot + " index=" + index + " icon=" + icon); |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 209 | mIcons.setIcon(index, icon); |
| 210 | |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 211 | if (mBar != null) { |
| 212 | try { |
| 213 | mBar.setIcon(index, icon); |
| 214 | } catch (RemoteException ex) { |
| 215 | } |
| 216 | } |
| 217 | } |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 218 | } |
| 219 | |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 220 | public void setIconVisibility(String slot, boolean visible) { |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 221 | enforceStatusBar(); |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 222 | |
| Joe Onorato | 514ad663 | 2010-05-13 18:49:00 -0700 | [diff] [blame] | 223 | synchronized (mIcons) { |
| 224 | int index = mIcons.getSlotIndex(slot); |
| 225 | if (index < 0) { |
| 226 | throw new SecurityException("invalid status bar icon slot: " + slot); |
| 227 | } |
| 228 | |
| 229 | StatusBarIcon icon = mIcons.getIcon(index); |
| 230 | if (icon == null) { |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | if (icon.visible != visible) { |
| 235 | icon.visible = visible; |
| 236 | |
| Joe Onorato | 514ad663 | 2010-05-13 18:49:00 -0700 | [diff] [blame] | 237 | if (mBar != null) { |
| 238 | try { |
| 239 | mBar.setIcon(index, icon); |
| 240 | } catch (RemoteException ex) { |
| 241 | } |
| 242 | } |
| 243 | } |
| 244 | } |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 245 | } |
| 246 | |
| 247 | public void removeIcon(String slot) { |
| 248 | enforceStatusBar(); |
| 249 | |
| 250 | synchronized (mIcons) { |
| 251 | int index = mIcons.getSlotIndex(slot); |
| 252 | if (index < 0) { |
| 253 | throw new SecurityException("invalid status bar icon slot: " + slot); |
| 254 | } |
| 255 | |
| 256 | mIcons.removeIcon(index); |
| 257 | |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 258 | if (mBar != null) { |
| 259 | try { |
| 260 | mBar.removeIcon(index); |
| 261 | } catch (RemoteException ex) { |
| 262 | } |
| 263 | } |
| 264 | } |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 265 | } |
| 266 | |
| Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 267 | /** |
| 268 | * Hide or show the on-screen Menu key. Only call this from the window manager, typically in |
| 269 | * response to a window with FLAG_NEEDS_MENU_KEY set. |
| 270 | */ |
| Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 271 | public void topAppWindowChanged(final boolean menuVisible) { |
| Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 272 | enforceStatusBar(); |
| 273 | |
| Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 274 | if (SPEW) Slog.d(TAG, (menuVisible?"showing":"hiding") + " MENU key"); |
| Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 275 | |
| 276 | synchronized(mLock) { |
| Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 277 | mMenuVisible = menuVisible; |
| 278 | mHandler.post(new Runnable() { |
| 279 | public void run() { |
| 280 | if (mBar != null) { |
| 281 | try { |
| 282 | mBar.topAppWindowChanged(menuVisible); |
| 283 | } catch (RemoteException ex) { |
| Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 284 | } |
| 285 | } |
| Dianne Hackborn | 7d04932 | 2011-06-14 15:00:32 -0700 | [diff] [blame] | 286 | } |
| 287 | }); |
| Daniel Sandler | e02d808 | 2010-10-08 15:13:22 -0400 | [diff] [blame] | 288 | } |
| 289 | } |
| 290 | |
| Joe Onorato | 857fd9b | 2011-01-27 15:08:35 -0800 | [diff] [blame] | 291 | public void setImeWindowStatus(final IBinder token, final int vis, final int backDisposition) { |
| satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 292 | enforceStatusBar(); |
| 293 | |
| Joe Onorato | 857fd9b | 2011-01-27 15:08:35 -0800 | [diff] [blame] | 294 | if (SPEW) { |
| 295 | Slog.d(TAG, "swetImeWindowStatus vis=" + vis + " backDisposition=" + backDisposition); |
| 296 | } |
| satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 297 | |
| 298 | synchronized(mLock) { |
| Joe Onorato | 857fd9b | 2011-01-27 15:08:35 -0800 | [diff] [blame] | 299 | // In case of IME change, we need to call up setImeWindowStatus() regardless of |
| 300 | // mImeWindowVis because mImeWindowVis may not have been set to false when the |
| satok | 06e0744 | 2010-11-02 19:46:55 +0900 | [diff] [blame] | 301 | // previous IME was destroyed. |
| Joe Onorato | 857fd9b | 2011-01-27 15:08:35 -0800 | [diff] [blame] | 302 | mImeWindowVis = vis; |
| 303 | mImeBackDisposition = backDisposition; |
| 304 | mImeToken = token; |
| satok | 06e0744 | 2010-11-02 19:46:55 +0900 | [diff] [blame] | 305 | mHandler.post(new Runnable() { |
| 306 | public void run() { |
| 307 | if (mBar != null) { |
| 308 | try { |
| Joe Onorato | 857fd9b | 2011-01-27 15:08:35 -0800 | [diff] [blame] | 309 | mBar.setImeWindowStatus(token, vis, backDisposition); |
| satok | 06e0744 | 2010-11-02 19:46:55 +0900 | [diff] [blame] | 310 | } catch (RemoteException ex) { |
| satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 311 | } |
| 312 | } |
| satok | 06e0744 | 2010-11-02 19:46:55 +0900 | [diff] [blame] | 313 | } |
| 314 | }); |
| satok | 06487a5 | 2010-10-29 11:37:18 +0900 | [diff] [blame] | 315 | } |
| 316 | } |
| 317 | |
| Dianne Hackborn | 3a3a6cf | 2012-03-26 10:24:04 -0700 | [diff] [blame] | 318 | public void setSystemUiVisibility(int vis, int mask) { |
| Joe Onorato | 55bf380 | 2011-01-25 13:42:10 -0800 | [diff] [blame] | 319 | // also allows calls from window manager which is in this process. |
| Joe Onorato | f63b0f4 | 2010-09-12 17:03:19 -0400 | [diff] [blame] | 320 | enforceStatusBarService(); |
| 321 | |
| Jeff Sharkey | 4519a02 | 2011-09-07 23:24:53 -0700 | [diff] [blame] | 322 | if (SPEW) Slog.d(TAG, "setSystemUiVisibility(0x" + Integer.toHexString(vis) + ")"); |
| Daniel Sandler | 60ee256 | 2011-07-22 12:34:33 -0400 | [diff] [blame] | 323 | |
| Joe Onorato | f63b0f4 | 2010-09-12 17:03:19 -0400 | [diff] [blame] | 324 | synchronized (mLock) { |
| Dianne Hackborn | 3a3a6cf | 2012-03-26 10:24:04 -0700 | [diff] [blame] | 325 | updateUiVisibilityLocked(vis, mask); |
| Joe Onorato | 7bb8eeb | 2011-01-27 16:00:58 -0800 | [diff] [blame] | 326 | disableLocked(vis & StatusBarManager.DISABLE_MASK, mSysUiVisToken, |
| 327 | "WindowManager.LayoutParams"); |
| Joe Onorato | f63b0f4 | 2010-09-12 17:03:19 -0400 | [diff] [blame] | 328 | } |
| 329 | } |
| 330 | |
| Dianne Hackborn | 3a3a6cf | 2012-03-26 10:24:04 -0700 | [diff] [blame] | 331 | private void updateUiVisibilityLocked(final int vis, final int mask) { |
| Daniel Sandler | 60ee256 | 2011-07-22 12:34:33 -0400 | [diff] [blame] | 332 | if (mSystemUiVisibility != vis) { |
| 333 | mSystemUiVisibility = vis; |
| Joe Onorato | f63b0f4 | 2010-09-12 17:03:19 -0400 | [diff] [blame] | 334 | mHandler.post(new Runnable() { |
| 335 | public void run() { |
| 336 | if (mBar != null) { |
| 337 | try { |
| Dianne Hackborn | 3a3a6cf | 2012-03-26 10:24:04 -0700 | [diff] [blame] | 338 | mBar.setSystemUiVisibility(vis, mask); |
| Joe Onorato | f63b0f4 | 2010-09-12 17:03:19 -0400 | [diff] [blame] | 339 | } catch (RemoteException ex) { |
| Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 340 | } |
| 341 | } |
| Joe Onorato | f63b0f4 | 2010-09-12 17:03:19 -0400 | [diff] [blame] | 342 | } |
| 343 | }); |
| Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 344 | } |
| 345 | } |
| 346 | |
| Jeff Brown | 2992ea7 | 2011-01-28 22:04:14 -0800 | [diff] [blame] | 347 | public void setHardKeyboardEnabled(final boolean enabled) { |
| 348 | mHandler.post(new Runnable() { |
| 349 | public void run() { |
| 350 | mWindowManager.setHardKeyboardEnabled(enabled); |
| 351 | } |
| 352 | }); |
| 353 | } |
| 354 | |
| 355 | @Override |
| 356 | public void onHardKeyboardStatusChange(final boolean available, final boolean enabled) { |
| 357 | mHandler.post(new Runnable() { |
| 358 | public void run() { |
| 359 | if (mBar != null) { |
| 360 | try { |
| 361 | mBar.setHardKeyboardStatus(available, enabled); |
| 362 | } catch (RemoteException ex) { |
| 363 | } |
| 364 | } |
| 365 | } |
| 366 | }); |
| 367 | } |
| 368 | |
| Michael Jurka | 3b1fc47 | 2011-06-13 10:54:40 -0700 | [diff] [blame] | 369 | @Override |
| 370 | public void toggleRecentApps() { |
| 371 | if (mBar != null) { |
| 372 | try { |
| 373 | mBar.toggleRecentApps(); |
| 374 | } catch (RemoteException ex) {} |
| 375 | } |
| 376 | } |
| 377 | |
| Michael Jurka | 7f2668c | 2012-03-27 07:49:52 -0700 | [diff] [blame] | 378 | @Override |
| 379 | public void preloadRecentApps() { |
| 380 | if (mBar != null) { |
| 381 | try { |
| 382 | mBar.preloadRecentApps(); |
| 383 | } catch (RemoteException ex) {} |
| 384 | } |
| 385 | } |
| 386 | |
| 387 | @Override |
| 388 | public void cancelPreloadRecentApps() { |
| 389 | if (mBar != null) { |
| 390 | try { |
| 391 | mBar.cancelPreloadRecentApps(); |
| 392 | } catch (RemoteException ex) {} |
| 393 | } |
| 394 | } |
| 395 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 396 | private void enforceStatusBar() { |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 397 | mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR, |
| Joe Onorato | 089de88 | 2010-04-12 08:18:45 -0700 | [diff] [blame] | 398 | "StatusBarManagerService"); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 399 | } |
| 400 | |
| 401 | private void enforceExpandStatusBar() { |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 402 | mContext.enforceCallingOrSelfPermission(android.Manifest.permission.EXPAND_STATUS_BAR, |
| Joe Onorato | 089de88 | 2010-04-12 08:18:45 -0700 | [diff] [blame] | 403 | "StatusBarManagerService"); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 404 | } |
| 405 | |
| Joe Onorato | 8bc6c51 | 2010-06-04 16:21:12 -0400 | [diff] [blame] | 406 | private void enforceStatusBarService() { |
| 407 | mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR_SERVICE, |
| 408 | "StatusBarManagerService"); |
| 409 | } |
| 410 | |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 411 | // ================================================================================ |
| 412 | // Callbacks from the status bar service. |
| 413 | // ================================================================================ |
| Joe Onorato | 75199e3 | 2010-05-29 17:22:51 -0400 | [diff] [blame] | 414 | public void registerStatusBar(IStatusBar bar, StatusBarIconList iconList, |
| Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 415 | List<IBinder> notificationKeys, List<StatusBarNotification> notifications, |
| satok | cd7cd29 | 2010-11-20 15:46:23 +0900 | [diff] [blame] | 416 | int switches[], List<IBinder> binders) { |
| Joe Onorato | 8bc6c51 | 2010-06-04 16:21:12 -0400 | [diff] [blame] | 417 | enforceStatusBarService(); |
| 418 | |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 419 | Slog.i(TAG, "registerStatusBar bar=" + bar); |
| 420 | mBar = bar; |
| Joe Onorato | 75199e3 | 2010-05-29 17:22:51 -0400 | [diff] [blame] | 421 | synchronized (mIcons) { |
| 422 | iconList.copyFrom(mIcons); |
| 423 | } |
| 424 | synchronized (mNotifications) { |
| 425 | for (Map.Entry<IBinder,StatusBarNotification> e: mNotifications.entrySet()) { |
| 426 | notificationKeys.add(e.getKey()); |
| 427 | notifications.add(e.getValue()); |
| 428 | } |
| 429 | } |
| Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 430 | synchronized (mLock) { |
| Joe Onorato | e4c7b3f | 2010-10-30 12:15:03 -0700 | [diff] [blame] | 431 | switches[0] = gatherDisableActionsLocked(); |
| Daniel Sandler | 60ee256 | 2011-07-22 12:34:33 -0400 | [diff] [blame] | 432 | switches[1] = mSystemUiVisibility; |
| Joe Onorato | e4c7b3f | 2010-10-30 12:15:03 -0700 | [diff] [blame] | 433 | switches[2] = mMenuVisible ? 1 : 0; |
| Joe Onorato | 857fd9b | 2011-01-27 15:08:35 -0800 | [diff] [blame] | 434 | switches[3] = mImeWindowVis; |
| 435 | switches[4] = mImeBackDisposition; |
| 436 | binders.add(mImeToken); |
| Joe Onorato | 9305647 | 2010-09-10 10:30:46 -0400 | [diff] [blame] | 437 | } |
| Jeff Brown | 2992ea7 | 2011-01-28 22:04:14 -0800 | [diff] [blame] | 438 | switches[5] = mWindowManager.isHardKeyboardAvailable() ? 1 : 0; |
| 439 | switches[6] = mWindowManager.isHardKeyboardEnabled() ? 1 : 0; |
| Joe Onorato | 2314aab | 2010-04-08 16:41:23 -0500 | [diff] [blame] | 440 | } |
| Joe Onorato | aaba60b | 2010-05-23 15:18:41 -0400 | [diff] [blame] | 441 | |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 442 | /** |
| Joe Onorato | f1f2591 | 2010-06-07 11:52:41 -0700 | [diff] [blame] | 443 | * The status bar service should call this each time the user brings the panel from |
| 444 | * invisible to visible in order to clear the notification light. |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 445 | */ |
| Joe Onorato | f1f2591 | 2010-06-07 11:52:41 -0700 | [diff] [blame] | 446 | public void onPanelRevealed() { |
| Joe Onorato | 8bc6c51 | 2010-06-04 16:21:12 -0400 | [diff] [blame] | 447 | enforceStatusBarService(); |
| 448 | |
| Joe Onorato | f1f2591 | 2010-06-07 11:52:41 -0700 | [diff] [blame] | 449 | // tell the notification manager to turn off the lights. |
| 450 | mNotificationCallbacks.onPanelRevealed(); |
| Joe Onorato | 4762c2d | 2010-05-17 15:42:59 -0700 | [diff] [blame] | 451 | } |
| 452 | |
| Joe Onorato | aaba60b | 2010-05-23 15:18:41 -0400 | [diff] [blame] | 453 | public void onNotificationClick(String pkg, String tag, int id) { |
| Joe Onorato | 8bc6c51 | 2010-06-04 16:21:12 -0400 | [diff] [blame] | 454 | enforceStatusBarService(); |
| 455 | |
| Joe Onorato | aaba60b | 2010-05-23 15:18:41 -0400 | [diff] [blame] | 456 | mNotificationCallbacks.onNotificationClick(pkg, tag, id); |
| 457 | } |
| 458 | |
| Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 459 | public void onNotificationError(String pkg, String tag, int id, |
| 460 | int uid, int initialPid, String message) { |
| Joe Onorato | 8bc6c51 | 2010-06-04 16:21:12 -0400 | [diff] [blame] | 461 | enforceStatusBarService(); |
| 462 | |
| Joe Onorato | 005847b | 2010-06-04 16:08:02 -0400 | [diff] [blame] | 463 | // WARNING: this will call back into us to do the remove. Don't hold any locks. |
| Dianne Hackborn | 9d39d0c | 2010-06-24 15:57:42 -0700 | [diff] [blame] | 464 | mNotificationCallbacks.onNotificationError(pkg, tag, id, uid, initialPid, message); |
| Joe Onorato | 005847b | 2010-06-04 16:08:02 -0400 | [diff] [blame] | 465 | } |
| 466 | |
| Daniel Sandler | 0f0b11c | 2010-08-04 15:54:58 -0400 | [diff] [blame] | 467 | public void onNotificationClear(String pkg, String tag, int id) { |
| 468 | enforceStatusBarService(); |
| 469 | |
| 470 | mNotificationCallbacks.onNotificationClear(pkg, tag, id); |
| 471 | } |
| 472 | |
| Joe Onorato | aaba60b | 2010-05-23 15:18:41 -0400 | [diff] [blame] | 473 | public void onClearAllNotifications() { |
| Joe Onorato | 8bc6c51 | 2010-06-04 16:21:12 -0400 | [diff] [blame] | 474 | enforceStatusBarService(); |
| 475 | |
| Joe Onorato | aaba60b | 2010-05-23 15:18:41 -0400 | [diff] [blame] | 476 | mNotificationCallbacks.onClearAll(); |
| 477 | } |
| 478 | |
| Joe Onorato | 18e69df | 2010-05-17 22:26:12 -0700 | [diff] [blame] | 479 | // ================================================================================ |
| 480 | // Callbacks for NotificationManagerService. |
| 481 | // ================================================================================ |
| 482 | public IBinder addNotification(StatusBarNotification notification) { |
| 483 | synchronized (mNotifications) { |
| Joe Onorato | a0c56fe | 2010-05-20 10:21:52 -0700 | [diff] [blame] | 484 | IBinder key = new Binder(); |
| Joe Onorato | 75199e3 | 2010-05-29 17:22:51 -0400 | [diff] [blame] | 485 | mNotifications.put(key, notification); |
| Joe Onorato | e345fff | 2010-05-23 15:18:27 -0400 | [diff] [blame] | 486 | if (mBar != null) { |
| 487 | try { |
| 488 | mBar.addNotification(key, notification); |
| 489 | } catch (RemoteException ex) { |
| 490 | } |
| 491 | } |
| Joe Onorato | 18e69df | 2010-05-17 22:26:12 -0700 | [diff] [blame] | 492 | return key; |
| 493 | } |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 494 | } |
| 495 | |
| Joe Onorato | 18e69df | 2010-05-17 22:26:12 -0700 | [diff] [blame] | 496 | public void updateNotification(IBinder key, StatusBarNotification notification) { |
| 497 | synchronized (mNotifications) { |
| Joe Onorato | 75199e3 | 2010-05-29 17:22:51 -0400 | [diff] [blame] | 498 | if (!mNotifications.containsKey(key)) { |
| 499 | throw new IllegalArgumentException("updateNotification key not found: " + key); |
| 500 | } |
| 501 | mNotifications.put(key, notification); |
| Joe Onorato | e345fff | 2010-05-23 15:18:27 -0400 | [diff] [blame] | 502 | if (mBar != null) { |
| 503 | try { |
| 504 | mBar.updateNotification(key, notification); |
| 505 | } catch (RemoteException ex) { |
| 506 | } |
| 507 | } |
| Joe Onorato | 18e69df | 2010-05-17 22:26:12 -0700 | [diff] [blame] | 508 | } |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 509 | } |
| 510 | |
| 511 | public void removeNotification(IBinder key) { |
| Joe Onorato | 18e69df | 2010-05-17 22:26:12 -0700 | [diff] [blame] | 512 | synchronized (mNotifications) { |
| Joe Onorato | 75199e3 | 2010-05-29 17:22:51 -0400 | [diff] [blame] | 513 | final StatusBarNotification n = mNotifications.remove(key); |
| 514 | if (n == null) { |
| Daniel Sandler | fe0806a | 2012-05-16 12:41:33 -0400 | [diff] [blame] | 515 | Slog.e(TAG, "removeNotification key not found: " + key); |
| 516 | return; |
| Joe Onorato | 75199e3 | 2010-05-29 17:22:51 -0400 | [diff] [blame] | 517 | } |
| Joe Onorato | e345fff | 2010-05-23 15:18:27 -0400 | [diff] [blame] | 518 | if (mBar != null) { |
| 519 | try { |
| 520 | mBar.removeNotification(key); |
| 521 | } catch (RemoteException ex) { |
| 522 | } |
| 523 | } |
| Joe Onorato | 18e69df | 2010-05-17 22:26:12 -0700 | [diff] [blame] | 524 | } |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 525 | } |
| Joe Onorato | 2314aab | 2010-04-08 16:41:23 -0500 | [diff] [blame] | 526 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 527 | // ================================================================================ |
| 528 | // Can be called from any thread |
| 529 | // ================================================================================ |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 530 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 531 | // lock on mDisableRecords |
| 532 | void manageDisableListLocked(int what, IBinder token, String pkg) { |
| 533 | if (SPEW) { |
| Joe Onorato | f3f0e05 | 2010-05-14 18:49:29 -0700 | [diff] [blame] | 534 | Slog.d(TAG, "manageDisableList what=0x" + Integer.toHexString(what) + " pkg=" + pkg); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 535 | } |
| 536 | // update the list |
| Joe Onorato | 7bb8eeb | 2011-01-27 16:00:58 -0800 | [diff] [blame] | 537 | final int N = mDisableRecords.size(); |
| 538 | DisableRecord tok = null; |
| 539 | int i; |
| 540 | for (i=0; i<N; i++) { |
| 541 | DisableRecord t = mDisableRecords.get(i); |
| 542 | if (t.token == token) { |
| 543 | tok = t; |
| 544 | break; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 545 | } |
| Joe Onorato | 7bb8eeb | 2011-01-27 16:00:58 -0800 | [diff] [blame] | 546 | } |
| 547 | if (what == 0 || !token.isBinderAlive()) { |
| 548 | if (tok != null) { |
| 549 | mDisableRecords.remove(i); |
| 550 | tok.token.unlinkToDeath(tok, 0); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 551 | } |
| Joe Onorato | 7bb8eeb | 2011-01-27 16:00:58 -0800 | [diff] [blame] | 552 | } else { |
| 553 | if (tok == null) { |
| 554 | tok = new DisableRecord(); |
| 555 | try { |
| 556 | token.linkToDeath(tok, 0); |
| 557 | } |
| 558 | catch (RemoteException ex) { |
| 559 | return; // give up |
| 560 | } |
| 561 | mDisableRecords.add(tok); |
| 562 | } |
| 563 | tok.what = what; |
| 564 | tok.token = token; |
| 565 | tok.pkg = pkg; |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 566 | } |
| 567 | } |
| 568 | |
| 569 | // lock on mDisableRecords |
| 570 | int gatherDisableActionsLocked() { |
| 571 | final int N = mDisableRecords.size(); |
| 572 | // gather the new net flags |
| 573 | int net = 0; |
| 574 | for (int i=0; i<N; i++) { |
| 575 | net |= mDisableRecords.get(i).what; |
| 576 | } |
| 577 | return net; |
| 578 | } |
| 579 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 580 | // ================================================================================ |
| 581 | // Always called from UI thread |
| 582 | // ================================================================================ |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 583 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 584 | protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) { |
| 585 | if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP) |
| 586 | != PackageManager.PERMISSION_GRANTED) { |
| 587 | pw.println("Permission Denial: can't dump StatusBar from from pid=" |
| 588 | + Binder.getCallingPid() |
| 589 | + ", uid=" + Binder.getCallingUid()); |
| 590 | return; |
| 591 | } |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 592 | |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 593 | synchronized (mIcons) { |
| 594 | mIcons.dump(pw); |
| 595 | } |
| Joe Onorato | 18e69df | 2010-05-17 22:26:12 -0700 | [diff] [blame] | 596 | |
| 597 | synchronized (mNotifications) { |
| Joe Onorato | 75199e3 | 2010-05-29 17:22:51 -0400 | [diff] [blame] | 598 | int i=0; |
| 599 | pw.println("Notification list:"); |
| 600 | for (Map.Entry<IBinder,StatusBarNotification> e: mNotifications.entrySet()) { |
| 601 | pw.printf(" %2d: %s\n", i, e.getValue().toString()); |
| 602 | i++; |
| 603 | } |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 604 | } |
| Joe Onorato | 18e69df | 2010-05-17 22:26:12 -0700 | [diff] [blame] | 605 | |
| Joe Onorato | 7bb8eeb | 2011-01-27 16:00:58 -0800 | [diff] [blame] | 606 | synchronized (mLock) { |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 607 | final int N = mDisableRecords.size(); |
| 608 | pw.println(" mDisableRecords.size=" + N |
| 609 | + " mDisabled=0x" + Integer.toHexString(mDisabled)); |
| 610 | for (int i=0; i<N; i++) { |
| 611 | DisableRecord tok = mDisableRecords.get(i); |
| 612 | pw.println(" [" + i + "] what=0x" + Integer.toHexString(tok.what) |
| 613 | + " pkg=" + tok.pkg + " token=" + tok.token); |
| 614 | } |
| 615 | } |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 616 | } |
| 617 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 618 | private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { |
| 619 | public void onReceive(Context context, Intent intent) { |
| 620 | String action = intent.getAction(); |
| Joe Onorato | f9e0e6b | 2009-09-08 16:24:36 -0400 | [diff] [blame] | 621 | if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action) |
| 622 | || Intent.ACTION_SCREEN_OFF.equals(action)) { |
| Svetoslav Ganov | e20a177 | 2012-09-25 16:07:46 -0700 | [diff] [blame] | 623 | collapseNotifications(); |
| 624 | collapseQuickSettings(); |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 625 | } |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 626 | /* |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 627 | else if (Telephony.Intents.SPN_STRINGS_UPDATED_ACTION.equals(action)) { |
| 628 | updateNetworkName(intent.getBooleanExtra(Telephony.Intents.EXTRA_SHOW_SPN, false), |
| 629 | intent.getStringExtra(Telephony.Intents.EXTRA_SPN), |
| 630 | intent.getBooleanExtra(Telephony.Intents.EXTRA_SHOW_PLMN, false), |
| 631 | intent.getStringExtra(Telephony.Intents.EXTRA_PLMN)); |
| 632 | } |
| 633 | else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) { |
| 634 | updateResources(); |
| 635 | } |
| Joe Onorato | 0cbda99 | 2010-05-02 16:28:15 -0700 | [diff] [blame] | 636 | */ |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 637 | } |
| 638 | }; |
| 639 | |
| The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 640 | } |