From 514ad663f0a8b239cc59409175e0bd489c591aa0 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Thu, 13 May 2010 18:49:00 -0700 Subject: Set the visibility of the icons. Change-Id: Ib414718f1c51f1d306308a989d5d31d8e3ea7fd1 --- .../server/status/StatusBarManagerService.java | 27 ++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'services/java/com/android/server') 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); } -- cgit v1.1