summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server
diff options
context:
space:
mode:
authorJoe Onorato <joeo@android.com>2010-05-13 18:49:00 -0700
committerJoe Onorato <joeo@android.com>2010-06-02 14:48:41 -0700
commit514ad663f0a8b239cc59409175e0bd489c591aa0 (patch)
tree9e768d8f86c6e7e6c8ff6cb93a8799f0c584c657 /services/java/com/android/server
parentfb78cd99f9b08d70f1b4bfdbd847d5d746507052 (diff)
downloadframeworks_base-514ad663f0a8b239cc59409175e0bd489c591aa0.zip
frameworks_base-514ad663f0a8b239cc59409175e0bd489c591aa0.tar.gz
frameworks_base-514ad663f0a8b239cc59409175e0bd489c591aa0.tar.bz2
Set the visibility of the icons.
Change-Id: Ib414718f1c51f1d306308a989d5d31d8e3ea7fd1
Diffstat (limited to 'services/java/com/android/server')
-rw-r--r--services/java/com/android/server/status/StatusBarManagerService.java27
1 files changed, 23 insertions, 4 deletions
diff --git a/services/java/com/android/server/status/StatusBarManagerService.java b/services/java/com/android/server/status/StatusBarManagerService.java
index 3072fe5..31e42e9 100644
--- a/services/java/com/android/server/status/StatusBarManagerService.java
+++ b/services/java/com/android/server/status/StatusBarManagerService.java
@@ -184,7 +184,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub
}
public void setIcon(String slot, CharSequence text) {
-
}
public void setIcon(String slot, String iconPackage, int iconId, int iconLevel) {
@@ -212,6 +211,29 @@ public class StatusBarManagerService extends IStatusBarService.Stub
public void setIconVisibility(String slot, boolean visible) {
enforceStatusBar();
+ synchronized (mIcons) {
+ int index = mIcons.getSlotIndex(slot);
+ if (index < 0) {
+ throw new SecurityException("invalid status bar icon slot: " + slot);
+ }
+
+ StatusBarIcon icon = mIcons.getIcon(index);
+ if (icon == null) {
+ return;
+ }
+
+ if (icon.visible != visible) {
+ icon.visible = visible;
+
+ // Tell the client. If it fails, it'll restart soon and we'll sync up.
+ if (mBar != null) {
+ try {
+ mBar.setIcon(index, icon);
+ } catch (RemoteException ex) {
+ }
+ }
+ }
+ }
}
public void removeIcon(String slot) {
@@ -380,9 +402,6 @@ public class StatusBarManagerService extends IStatusBarService.Stub
return;
}
- Slog.d(TAG, "dump!!!");
- pw.println("status!");
-
synchronized (mIcons) {
mIcons.dump(pw);
}