blob: dc86eeb3e81aacbce1c977592d753f223b662f56 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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 Onorato7a0f36b2010-06-07 10:24:36 -070017package com.android.server;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080018
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080019import android.app.PendingIntent;
20import android.app.StatusBarManager;
21import android.content.BroadcastReceiver;
Joe Onorato9e875fc2010-06-07 11:12:11 -070022import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080023import android.content.Context;
24import android.content.Intent;
25import android.content.IntentFilter;
26import android.content.pm.PackageManager;
27import android.content.res.Resources;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028import android.net.Uri;
29import android.os.IBinder;
30import android.os.RemoteException;
31import android.os.Binder;
Joe Onoratof3f0e052010-05-14 18:49:29 -070032import android.os.Handler;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080033import android.os.SystemClock;
Joe Onorato8a9b2202010-02-26 18:56:32 -080034import android.util.Slog;
Joe Onorato0cbda992010-05-02 16:28:15 -070035
36import com.android.internal.statusbar.IStatusBar;
37import com.android.internal.statusbar.IStatusBarService;
38import com.android.internal.statusbar.StatusBarIcon;
39import com.android.internal.statusbar.StatusBarIconList;
Joe Onorato18e69df2010-05-17 22:26:12 -070040import com.android.internal.statusbar.StatusBarNotification;
The Android Open Source Project10592532009-03-18 17:39:46 -070041
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042import java.io.FileDescriptor;
43import java.io.PrintWriter;
44import java.util.ArrayList;
45import java.util.HashMap;
Joe Onorato75199e32010-05-29 17:22:51 -040046import java.util.List;
47import java.util.Map;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048
49
50/**
Joe Onoratof3f0e052010-05-14 18:49:29 -070051 * A note on locking: We rely on the fact that calls onto mBar are oneway or
52 * if they are local, that they just enqueue messages to not deadlock.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053 */
Joe Onorato089de882010-04-12 08:18:45 -070054public class StatusBarManagerService extends IStatusBarService.Stub
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080055{
Joe Onorato4762c2d2010-05-17 15:42:59 -070056 static final String TAG = "StatusBarManagerService";
Joe Onoratof3f0e052010-05-14 18:49:29 -070057 static final boolean SPEW = true;
Joe Onoratodf7dbb62009-11-17 10:43:37 -080058
Joe Onoratof3f0e052010-05-14 18:49:29 -070059 final Context mContext;
60 Handler mHandler = new Handler();
61 NotificationCallbacks mNotificationCallbacks;
Joe Onorato4762c2d2010-05-17 15:42:59 -070062 volatile IStatusBar mBar;
Joe Onoratof3f0e052010-05-14 18:49:29 -070063 StatusBarIconList mIcons = new StatusBarIconList();
Joe Onorato75199e32010-05-29 17:22:51 -040064 HashMap<IBinder,StatusBarNotification> mNotifications
65 = new HashMap<IBinder,StatusBarNotification>();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080066
Joe Onoratof3f0e052010-05-14 18:49:29 -070067 // for disabling the status bar
68 ArrayList<DisableRecord> mDisableRecords = new ArrayList<DisableRecord>();
69 int mDisabled = 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080070
Joe Onorato93056472010-09-10 10:30:46 -040071 Object mLock = new Object();
72 // We usually call it lights out mode, but double negatives are annoying
73 boolean mLightsOn = true;
74
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075 private class DisableRecord implements IBinder.DeathRecipient {
76 String pkg;
77 int what;
78 IBinder token;
79
80 public void binderDied() {
Joe Onorato8a9b2202010-02-26 18:56:32 -080081 Slog.i(TAG, "binder died for pkg=" + pkg);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082 disable(0, token, pkg);
Suchi Amalapurapufff2fda2009-06-30 21:36:16 -070083 token.unlinkToDeath(this, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080084 }
85 }
86
87 public interface NotificationCallbacks {
88 void onSetDisabled(int status);
89 void onClearAll();
Fred Quintana6ecaff12009-09-25 14:23:13 -070090 void onNotificationClick(String pkg, String tag, int id);
Daniel Sandler0f0b11c2010-08-04 15:54:58 -040091 void onNotificationClear(String pkg, String tag, int id);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080092 void onPanelRevealed();
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -070093 void onNotificationError(String pkg, String tag, int id,
94 int uid, int initialPid, String message);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080095 }
96
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080097 /**
98 * Construct the service, add the status bar view to the window manager
99 */
Joe Onorato089de882010-04-12 08:18:45 -0700100 public StatusBarManagerService(Context context) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800101 mContext = context;
Joe Onorato0cbda992010-05-02 16:28:15 -0700102
103 final Resources res = context.getResources();
Joe Onorato75144ea2010-06-07 12:36:25 -0700104 mIcons.defineSlots(res.getStringArray(com.android.internal.R.array.config_statusBarIcons));
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105 }
106
107 public void setNotificationCallbacks(NotificationCallbacks listener) {
108 mNotificationCallbacks = listener;
109 }
110
111 // ================================================================================
112 // Constructing the view
113 // ================================================================================
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800114
115 public void systemReady() {
Joe Onorato2314aab2010-04-08 16:41:23 -0500116 }
117
118 public void systemReady2() {
Joe Onorato9e875fc2010-06-07 11:12:11 -0700119 ComponentName cn = ComponentName.unflattenFromString(
120 mContext.getString(com.android.internal.R.string.config_statusBarComponent));
121 Intent intent = new Intent();
122 intent.setComponent(cn);
123 Slog.i(TAG, "Starting service: " + cn);
124 mContext.startService(intent);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800125 }
Joe Onorato4762c2d2010-05-17 15:42:59 -0700126
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800127 // ================================================================================
Joe Onorato25f95f92010-04-08 18:37:10 -0500128 // From IStatusBarService
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800129 // ================================================================================
Joe Onoratof3f0e052010-05-14 18:49:29 -0700130 public void expand() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800131 enforceExpandStatusBar();
Joe Onorato4762c2d2010-05-17 15:42:59 -0700132
133 if (mBar != null) {
134 try {
135 mBar.animateExpand();
136 } catch (RemoteException ex) {
137 }
138 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800139 }
140
Joe Onoratof3f0e052010-05-14 18:49:29 -0700141 public void collapse() {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800142 enforceExpandStatusBar();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800143
Joe Onorato4762c2d2010-05-17 15:42:59 -0700144 if (mBar != null) {
145 try {
146 mBar.animateCollapse();
147 } catch (RemoteException ex) {
148 }
149 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800150 }
151
152 public void disable(int what, IBinder token, String pkg) {
153 enforceStatusBar();
Joe Onoratof3f0e052010-05-14 18:49:29 -0700154
155 // It's important that the the callback and the call to mBar get done
156 // in the same order when multiple threads are calling this function
157 // so they are paired correctly. The messages on the handler will be
158 // handled in the order they were enqueued, but will be outside the lock.
159 synchronized (mDisableRecords) {
160 manageDisableListLocked(what, token, pkg);
161 final int net = gatherDisableActionsLocked();
162 Slog.d(TAG, "disable... net=0x" + Integer.toHexString(net));
163 if (net != mDisabled) {
164 mDisabled = net;
165 mHandler.post(new Runnable() {
166 public void run() {
167 mNotificationCallbacks.onSetDisabled(net);
168 }
169 });
170 if (mBar != null) {
171 try {
172 mBar.disable(net);
173 } catch (RemoteException ex) {
174 }
175 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800176 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800177 }
178 }
179
Joe Onorato0cbda992010-05-02 16:28:15 -0700180 public void setIcon(String slot, String iconPackage, int iconId, int iconLevel) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800181 enforceStatusBar();
Joe Onorato0cbda992010-05-02 16:28:15 -0700182
183 synchronized (mIcons) {
184 int index = mIcons.getSlotIndex(slot);
185 if (index < 0) {
186 throw new SecurityException("invalid status bar icon slot: " + slot);
187 }
188
189 StatusBarIcon icon = new StatusBarIcon(iconPackage, iconId, iconLevel);
Joe Onorato66d7d012010-05-14 10:05:10 -0700190 //Slog.d(TAG, "setIcon slot=" + slot + " index=" + index + " icon=" + icon);
Joe Onorato0cbda992010-05-02 16:28:15 -0700191 mIcons.setIcon(index, icon);
192
Joe Onorato0cbda992010-05-02 16:28:15 -0700193 if (mBar != null) {
194 try {
195 mBar.setIcon(index, icon);
196 } catch (RemoteException ex) {
197 }
198 }
199 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800200 }
201
Joe Onorato0cbda992010-05-02 16:28:15 -0700202 public void setIconVisibility(String slot, boolean visible) {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800203 enforceStatusBar();
Joe Onorato0cbda992010-05-02 16:28:15 -0700204
Joe Onorato514ad6632010-05-13 18:49:00 -0700205 synchronized (mIcons) {
206 int index = mIcons.getSlotIndex(slot);
207 if (index < 0) {
208 throw new SecurityException("invalid status bar icon slot: " + slot);
209 }
210
211 StatusBarIcon icon = mIcons.getIcon(index);
212 if (icon == null) {
213 return;
214 }
215
216 if (icon.visible != visible) {
217 icon.visible = visible;
218
Joe Onorato514ad6632010-05-13 18:49:00 -0700219 if (mBar != null) {
220 try {
221 mBar.setIcon(index, icon);
222 } catch (RemoteException ex) {
223 }
224 }
225 }
226 }
Joe Onorato0cbda992010-05-02 16:28:15 -0700227 }
228
229 public void removeIcon(String slot) {
230 enforceStatusBar();
231
232 synchronized (mIcons) {
233 int index = mIcons.getSlotIndex(slot);
234 if (index < 0) {
235 throw new SecurityException("invalid status bar icon slot: " + slot);
236 }
237
238 mIcons.removeIcon(index);
239
Joe Onorato0cbda992010-05-02 16:28:15 -0700240 if (mBar != null) {
241 try {
242 mBar.removeIcon(index);
243 } catch (RemoteException ex) {
244 }
245 }
246 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800247 }
248
Joe Onorato93056472010-09-10 10:30:46 -0400249 public void setActiveWindowIsFullscreen(boolean fullscreen) {
250 // We could get away with a separate permission here, but STATUS_BAR is
251 // signatureOrSystem which is probably good enough. There is no public API
252 // for this, so the question is a security issue, not an API compatibility issue.
253 enforceStatusBar();
254
255 final boolean lightsOn = !fullscreen;
256 synchronized (mLock) {
257 if (mLightsOn != lightsOn) {
258 mLightsOn = lightsOn;
259 mHandler.post(new Runnable() {
260 public void run() {
261 if (mBar != null) {
262 try {
263 mBar.setLightsOn(lightsOn);
264 } catch (RemoteException ex) {
265 }
266 }
267 }
268 });
269 }
270 }
271 }
272
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800273 private void enforceStatusBar() {
Joe Onorato0cbda992010-05-02 16:28:15 -0700274 mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR,
Joe Onorato089de882010-04-12 08:18:45 -0700275 "StatusBarManagerService");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800276 }
277
278 private void enforceExpandStatusBar() {
Joe Onorato0cbda992010-05-02 16:28:15 -0700279 mContext.enforceCallingOrSelfPermission(android.Manifest.permission.EXPAND_STATUS_BAR,
Joe Onorato089de882010-04-12 08:18:45 -0700280 "StatusBarManagerService");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800281 }
282
Joe Onorato8bc6c512010-06-04 16:21:12 -0400283 private void enforceStatusBarService() {
284 mContext.enforceCallingOrSelfPermission(android.Manifest.permission.STATUS_BAR_SERVICE,
285 "StatusBarManagerService");
286 }
287
Joe Onorato4762c2d2010-05-17 15:42:59 -0700288
289 // ================================================================================
290 // Callbacks from the status bar service.
291 // ================================================================================
Joe Onorato75199e32010-05-29 17:22:51 -0400292 public void registerStatusBar(IStatusBar bar, StatusBarIconList iconList,
Joe Onorato93056472010-09-10 10:30:46 -0400293 List<IBinder> notificationKeys, List<StatusBarNotification> notifications,
294 boolean lightsOn[]) {
Joe Onorato8bc6c512010-06-04 16:21:12 -0400295 enforceStatusBarService();
296
Joe Onorato0cbda992010-05-02 16:28:15 -0700297 Slog.i(TAG, "registerStatusBar bar=" + bar);
298 mBar = bar;
Joe Onorato75199e32010-05-29 17:22:51 -0400299 synchronized (mIcons) {
300 iconList.copyFrom(mIcons);
301 }
302 synchronized (mNotifications) {
303 for (Map.Entry<IBinder,StatusBarNotification> e: mNotifications.entrySet()) {
304 notificationKeys.add(e.getKey());
305 notifications.add(e.getValue());
306 }
307 }
Joe Onorato93056472010-09-10 10:30:46 -0400308 synchronized (mLock) {
309 lightsOn[0] = mLightsOn;
310 }
Joe Onorato2314aab2010-04-08 16:41:23 -0500311 }
Joe Onoratoaaba60b2010-05-23 15:18:41 -0400312
Joe Onorato4762c2d2010-05-17 15:42:59 -0700313 /**
Joe Onoratof1f25912010-06-07 11:52:41 -0700314 * The status bar service should call this each time the user brings the panel from
315 * invisible to visible in order to clear the notification light.
Joe Onorato4762c2d2010-05-17 15:42:59 -0700316 */
Joe Onoratof1f25912010-06-07 11:52:41 -0700317 public void onPanelRevealed() {
Joe Onorato8bc6c512010-06-04 16:21:12 -0400318 enforceStatusBarService();
319
Joe Onoratof1f25912010-06-07 11:52:41 -0700320 // tell the notification manager to turn off the lights.
321 mNotificationCallbacks.onPanelRevealed();
Joe Onorato4762c2d2010-05-17 15:42:59 -0700322 }
323
Joe Onoratoaaba60b2010-05-23 15:18:41 -0400324 public void onNotificationClick(String pkg, String tag, int id) {
Joe Onorato8bc6c512010-06-04 16:21:12 -0400325 enforceStatusBarService();
326
Joe Onoratoaaba60b2010-05-23 15:18:41 -0400327 mNotificationCallbacks.onNotificationClick(pkg, tag, id);
328 }
329
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700330 public void onNotificationError(String pkg, String tag, int id,
331 int uid, int initialPid, String message) {
Joe Onorato8bc6c512010-06-04 16:21:12 -0400332 enforceStatusBarService();
333
Joe Onorato005847b2010-06-04 16:08:02 -0400334 // WARNING: this will call back into us to do the remove. Don't hold any locks.
Dianne Hackborn9d39d0c2010-06-24 15:57:42 -0700335 mNotificationCallbacks.onNotificationError(pkg, tag, id, uid, initialPid, message);
Joe Onorato005847b2010-06-04 16:08:02 -0400336 }
337
Daniel Sandler0f0b11c2010-08-04 15:54:58 -0400338 public void onNotificationClear(String pkg, String tag, int id) {
339 enforceStatusBarService();
340
341 mNotificationCallbacks.onNotificationClear(pkg, tag, id);
342 }
343
Joe Onoratoaaba60b2010-05-23 15:18:41 -0400344 public void onClearAllNotifications() {
Joe Onorato8bc6c512010-06-04 16:21:12 -0400345 enforceStatusBarService();
346
Joe Onoratoaaba60b2010-05-23 15:18:41 -0400347 mNotificationCallbacks.onClearAll();
348 }
349
Joe Onorato18e69df2010-05-17 22:26:12 -0700350 // ================================================================================
351 // Callbacks for NotificationManagerService.
352 // ================================================================================
353 public IBinder addNotification(StatusBarNotification notification) {
354 synchronized (mNotifications) {
Joe Onoratoa0c56fe2010-05-20 10:21:52 -0700355 IBinder key = new Binder();
Joe Onorato75199e32010-05-29 17:22:51 -0400356 mNotifications.put(key, notification);
Joe Onoratoe345fff2010-05-23 15:18:27 -0400357 if (mBar != null) {
358 try {
359 mBar.addNotification(key, notification);
360 } catch (RemoteException ex) {
361 }
362 }
Joe Onorato18e69df2010-05-17 22:26:12 -0700363 return key;
364 }
Joe Onorato0cbda992010-05-02 16:28:15 -0700365 }
366
Joe Onorato18e69df2010-05-17 22:26:12 -0700367 public void updateNotification(IBinder key, StatusBarNotification notification) {
368 synchronized (mNotifications) {
Joe Onorato75199e32010-05-29 17:22:51 -0400369 if (!mNotifications.containsKey(key)) {
370 throw new IllegalArgumentException("updateNotification key not found: " + key);
371 }
372 mNotifications.put(key, notification);
Joe Onoratoe345fff2010-05-23 15:18:27 -0400373 if (mBar != null) {
374 try {
375 mBar.updateNotification(key, notification);
376 } catch (RemoteException ex) {
377 }
378 }
Joe Onorato18e69df2010-05-17 22:26:12 -0700379 }
Joe Onorato0cbda992010-05-02 16:28:15 -0700380 }
381
382 public void removeNotification(IBinder key) {
Joe Onorato18e69df2010-05-17 22:26:12 -0700383 synchronized (mNotifications) {
Joe Onorato75199e32010-05-29 17:22:51 -0400384 final StatusBarNotification n = mNotifications.remove(key);
385 if (n == null) {
386 throw new IllegalArgumentException("removeNotification key not found: " + key);
387 }
Joe Onoratoe345fff2010-05-23 15:18:27 -0400388 if (mBar != null) {
389 try {
390 mBar.removeNotification(key);
391 } catch (RemoteException ex) {
392 }
393 }
Joe Onorato18e69df2010-05-17 22:26:12 -0700394 }
Joe Onorato0cbda992010-05-02 16:28:15 -0700395 }
Joe Onorato2314aab2010-04-08 16:41:23 -0500396
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800397 // ================================================================================
398 // Can be called from any thread
399 // ================================================================================
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800400
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800401 // lock on mDisableRecords
402 void manageDisableListLocked(int what, IBinder token, String pkg) {
403 if (SPEW) {
Joe Onoratof3f0e052010-05-14 18:49:29 -0700404 Slog.d(TAG, "manageDisableList what=0x" + Integer.toHexString(what) + " pkg=" + pkg);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800405 }
406 // update the list
407 synchronized (mDisableRecords) {
408 final int N = mDisableRecords.size();
409 DisableRecord tok = null;
410 int i;
411 for (i=0; i<N; i++) {
412 DisableRecord t = mDisableRecords.get(i);
413 if (t.token == token) {
414 tok = t;
415 break;
416 }
417 }
418 if (what == 0 || !token.isBinderAlive()) {
419 if (tok != null) {
420 mDisableRecords.remove(i);
Suchi Amalapurapufff2fda2009-06-30 21:36:16 -0700421 tok.token.unlinkToDeath(tok, 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800422 }
423 } else {
424 if (tok == null) {
425 tok = new DisableRecord();
426 try {
427 token.linkToDeath(tok, 0);
428 }
429 catch (RemoteException ex) {
430 return; // give up
431 }
432 mDisableRecords.add(tok);
433 }
434 tok.what = what;
435 tok.token = token;
436 tok.pkg = pkg;
437 }
438 }
439 }
440
441 // lock on mDisableRecords
442 int gatherDisableActionsLocked() {
443 final int N = mDisableRecords.size();
444 // gather the new net flags
445 int net = 0;
446 for (int i=0; i<N; i++) {
447 net |= mDisableRecords.get(i).what;
448 }
449 return net;
450 }
451
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800452 // ================================================================================
453 // Always called from UI thread
454 // ================================================================================
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800455
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800456 protected void dump(FileDescriptor fd, PrintWriter pw, String[] args) {
457 if (mContext.checkCallingOrSelfPermission(android.Manifest.permission.DUMP)
458 != PackageManager.PERMISSION_GRANTED) {
459 pw.println("Permission Denial: can't dump StatusBar from from pid="
460 + Binder.getCallingPid()
461 + ", uid=" + Binder.getCallingUid());
462 return;
463 }
Joe Onorato0cbda992010-05-02 16:28:15 -0700464
Joe Onorato0cbda992010-05-02 16:28:15 -0700465 synchronized (mIcons) {
466 mIcons.dump(pw);
467 }
Joe Onorato18e69df2010-05-17 22:26:12 -0700468
469 synchronized (mNotifications) {
Joe Onorato75199e32010-05-29 17:22:51 -0400470 int i=0;
471 pw.println("Notification list:");
472 for (Map.Entry<IBinder,StatusBarNotification> e: mNotifications.entrySet()) {
473 pw.printf(" %2d: %s\n", i, e.getValue().toString());
474 i++;
475 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800476 }
Joe Onorato18e69df2010-05-17 22:26:12 -0700477
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800478 synchronized (mDisableRecords) {
479 final int N = mDisableRecords.size();
480 pw.println(" mDisableRecords.size=" + N
481 + " mDisabled=0x" + Integer.toHexString(mDisabled));
482 for (int i=0; i<N; i++) {
483 DisableRecord tok = mDisableRecords.get(i);
484 pw.println(" [" + i + "] what=0x" + Integer.toHexString(tok.what)
485 + " pkg=" + tok.pkg + " token=" + tok.token);
486 }
487 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800488 }
489
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800490 private BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
491 public void onReceive(Context context, Intent intent) {
492 String action = intent.getAction();
Joe Onoratof9e0e6b2009-09-08 16:24:36 -0400493 if (Intent.ACTION_CLOSE_SYSTEM_DIALOGS.equals(action)
494 || Intent.ACTION_SCREEN_OFF.equals(action)) {
Joe Onoratof3f0e052010-05-14 18:49:29 -0700495 collapse();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800496 }
Joe Onorato0cbda992010-05-02 16:28:15 -0700497 /*
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800498 else if (Telephony.Intents.SPN_STRINGS_UPDATED_ACTION.equals(action)) {
499 updateNetworkName(intent.getBooleanExtra(Telephony.Intents.EXTRA_SHOW_SPN, false),
500 intent.getStringExtra(Telephony.Intents.EXTRA_SPN),
501 intent.getBooleanExtra(Telephony.Intents.EXTRA_SHOW_PLMN, false),
502 intent.getStringExtra(Telephony.Intents.EXTRA_PLMN));
503 }
504 else if (Intent.ACTION_CONFIGURATION_CHANGED.equals(action)) {
505 updateResources();
506 }
Joe Onorato0cbda992010-05-02 16:28:15 -0700507 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800508 }
509 };
510
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800511}