summaryrefslogtreecommitdiffstats
path: root/services/java/com/android/server
diff options
context:
space:
mode:
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);
}