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