From 8bc6c5141974dbc36a6fe416853f558921be9f24 Mon Sep 17 00:00:00 2001 From: Joe Onorato Date: Fri, 4 Jun 2010 16:21:12 -0400 Subject: [PATCH] Require the STATUS_BAR_SERVICE permission for something to be the status bar. Change-Id: I57b2d296e0d0cef0d256ae6697fffc47188d14df --- .../internal/statusbar/IStatusBarService.aidl | 1 + core/res/AndroidManifest.xml | 7 +++++++ core/res/res/values/strings.xml | 5 +++++ packages/SystemUI/AndroidManifest.xml | 2 ++ .../internal/policy/impl/PhoneWindowManager.java | 8 ++++++++ .../server/status/StatusBarManagerService.java | 16 +++++++++++++++- 6 files changed, 38 insertions(+), 1 deletion(-) diff --git a/core/java/com/android/internal/statusbar/IStatusBarService.aidl b/core/java/com/android/internal/statusbar/IStatusBarService.aidl index be3ded1685b74..e3862ffae1a51 100644 --- a/core/java/com/android/internal/statusbar/IStatusBarService.aidl +++ b/core/java/com/android/internal/statusbar/IStatusBarService.aidl @@ -32,6 +32,7 @@ interface IStatusBarService void removeIcon(String slot); // ---- Methods below are for use by the status bar policy services ---- + // You need the STATUS_BAR_SERVICE permission void registerStatusBar(IStatusBar callbacks, out StatusBarIconList iconList, out List notificationKeys, out List notifications); void visibilityChanged(boolean visible); diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml index 2ddb6b95ad9e4..aff94531a16c0 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -908,6 +908,13 @@ android:description="@string/permdesc_statusBar" android:protectionLevel="signatureOrSystem" /> + + + Allows application to disable the status bar or add and remove system icons. + + status bar + + Allows the application to be the status bar. + expand/collapse status bar diff --git a/packages/SystemUI/AndroidManifest.xml b/packages/SystemUI/AndroidManifest.xml index aba5e05745a0e..d8e05bb1dda8c 100644 --- a/packages/SystemUI/AndroidManifest.xml +++ b/packages/SystemUI/AndroidManifest.xml @@ -2,6 +2,8 @@ package="com.android.systemui" android:sharedUserId="android.uid.system"> + + notificationKeys, List notifications) { + enforceStatusBarService(); + Slog.i(TAG, "registerStatusBar bar=" + bar); mBar = bar; synchronized (mIcons) { @@ -273,20 +280,27 @@ public class StatusBarManagerService extends IStatusBarService.Stub * the status bar is visible or not. */ public void visibilityChanged(boolean visible) { + enforceStatusBarService(); + //Slog.d(TAG, "visibilityChanged visible=" + visible); } public void onNotificationClick(String pkg, String tag, int id) { + enforceStatusBarService(); + mNotificationCallbacks.onNotificationClick(pkg, tag, id); } public void onNotificationError(String pkg, String tag, int id, String message) { - Slog.d(TAG, "onNotificationError message=" + message); + enforceStatusBarService(); + // WARNING: this will call back into us to do the remove. Don't hold any locks. mNotificationCallbacks.onNotificationError(pkg, tag, id, message); } public void onClearAllNotifications() { + enforceStatusBarService(); + mNotificationCallbacks.onClearAll(); }