From 4b749ef5f2d510b84b99aa269d5c77af22457d04 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Mon, 18 Mar 2013 21:53:04 -0400 Subject: Allow whitelisted non-system packages to listen for notifications. The allowed packages are listed in Settings.Secure.ENABLED_NOTIFICATION_LISTENERS. (Don't let the plural fool you: only one listener will be supported in the UI.) Change-Id: Ia69f2ba05d8e555fd4d40b0cc89c62ed14af3cac --- core/java/android/app/INotificationManager.aidl | 2 +- core/java/android/provider/Settings.java | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'core/java') diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl index 14bcc0d7fba4..3d9b2ae83518 100644 --- a/core/java/android/app/INotificationManager.aidl +++ b/core/java/android/app/INotificationManager.aidl @@ -41,7 +41,7 @@ interface INotificationManager StatusBarNotification[] getActiveNotifications(String callingPkg); StatusBarNotification[] getHistoricalNotifications(String callingPkg, int count); - void registerListener(in INotificationListener listener, int userid); + void registerListener(in INotificationListener listener, String pkg, int userid); void unregisterListener(in INotificationListener listener, int userid); } diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index d251ca25e068..4cb1ae84480d 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -4038,6 +4038,14 @@ public final class Settings { */ public static final String SCREENSAVER_DEFAULT_COMPONENT = "screensaver_default_component"; + /** + * Name of a package that the current user has explicitly allowed to see all of that + * user's notifications. + * + * @hide + */ + public static final String ENABLED_NOTIFICATION_LISTENERS = "enabled_notification_listeners"; + /** * This are the settings to be backed up. * -- cgit v1.2.3