diff options
author | John Spurlock <jspurlock@google.com> | 2015-05-07 17:38:50 -0400 |
---|---|---|
committer | John Spurlock <jspurlock@google.com> | 2015-05-08 13:34:30 -0400 |
commit | 807749301fcbda892dfc8a5832b19acf7d1cf53b (patch) | |
tree | 7044f2b6737fc89a6193768c0afc3377eb41e6b4 /api | |
parent | a0698b617f1efc71d5301f98aead822e266ec5d6 (diff) | |
download | frameworks_base-807749301fcbda892dfc8a5832b19acf7d1cf53b.zip frameworks_base-807749301fcbda892dfc8a5832b19acf7d1cf53b.tar.gz frameworks_base-807749301fcbda892dfc8a5832b19acf7d1cf53b.tar.bz2 |
Zen: Simplify notification policy api, add zenmode api.
- Remove the concept of a notification policy management token
in favor of a simple grant/deny per app. Currently, all requests
are immediately granted.
- Add zen mode getter/setting, limit to apps that have been granted
policy access.
- Add intent for zen mode changes.
- Public name for zen mode = "interruption filter", moved from
NotificationListenerService to NotificationManager.
- Add settings metadata for new DND access Settings screen.
- Add the split sender settings for calls vs messages to the public
Policy api.
- This change is meant to finalize the public api, persisting
granted app status and showing the user-visible dialog will be
done as followups.
Bug: 18298798
Change-Id: I511be98d69939f057c0c7dc1a6dfe63d1c468193
Diffstat (limited to 'api')
-rw-r--r-- | api/current.txt | 41 | ||||
-rw-r--r-- | api/system-current.txt | 41 |
2 files changed, 44 insertions, 38 deletions
diff --git a/api/current.txt b/api/current.txt index cdc2404..d5b24c7 100644 --- a/api/current.txt +++ b/api/current.txt @@ -5145,17 +5145,31 @@ package android.app { method public void cancel(java.lang.String, int); method public void cancelAll(); method public android.service.notification.StatusBarNotification[] getActiveNotifications(); - method public android.app.NotificationManager.Policy getNotificationPolicy(android.app.NotificationManager.Policy.Token); - method public boolean isNotificationPolicyTokenValid(android.app.NotificationManager.Policy.Token); + method public final int getCurrentInterruptionFilter(); + method public android.app.NotificationManager.Policy getNotificationPolicy(); + method public boolean isNotificationPolicyAccessGranted(); method public void notify(int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); - method public void requestNotificationPolicyToken(android.app.NotificationManager.Policy.Token.RequestCallback, android.os.Handler); - method public void setNotificationPolicy(android.app.NotificationManager.Policy.Token, android.app.NotificationManager.Policy); + method public void requestPolicyAccess(android.app.NotificationManager.NotificationPolicyAccessRequestCallback, android.os.Handler); + method public final void setInterruptionFilter(int); + method public void setNotificationPolicy(android.app.NotificationManager.Policy); + field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED"; field public static final java.lang.String ACTION_NOTIFICATION_POLICY_CHANGED = "android.app.action.NOTIFICATION_POLICY_CHANGED"; + field public static final int INTERRUPTION_FILTER_ALARMS = 4; // 0x4 + field public static final int INTERRUPTION_FILTER_ALL = 1; // 0x1 + field public static final int INTERRUPTION_FILTER_NONE = 3; // 0x3 + field public static final int INTERRUPTION_FILTER_PRIORITY = 2; // 0x2 + field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0 + } + + public static abstract class NotificationManager.NotificationPolicyAccessRequestCallback { + ctor public NotificationManager.NotificationPolicyAccessRequestCallback(); + method public abstract void onAccessDenied(); + method public abstract void onAccessGranted(); } public static class NotificationManager.Policy implements android.os.Parcelable { - ctor public NotificationManager.Policy(int, int); + ctor public NotificationManager.Policy(int, int, int); method public int describeContents(); method public static java.lang.String priorityCategoriesToString(int); method public static java.lang.String prioritySendersToString(int); @@ -5169,20 +5183,9 @@ package android.app { field public static final int PRIORITY_SENDERS_ANY = 0; // 0x0 field public static final int PRIORITY_SENDERS_CONTACTS = 1; // 0x1 field public static final int PRIORITY_SENDERS_STARRED = 2; // 0x2 + field public final int priorityCallSenders; field public final int priorityCategories; - field public final int prioritySenders; - } - - public static class NotificationManager.Policy.Token implements android.os.Parcelable { - method public int describeContents(); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator<android.app.NotificationManager.Policy.Token> CREATOR; - } - - public static abstract class NotificationManager.Policy.Token.RequestCallback { - ctor public NotificationManager.Policy.Token.RequestCallback(); - method public abstract void onTokenDenied(); - method public abstract void onTokenGranted(android.app.NotificationManager.Policy.Token); + field public final int priorityMessageSenders; } public final class PendingIntent implements android.os.Parcelable { @@ -26544,6 +26547,7 @@ package android.provider { field public static final java.lang.String ACTION_WIFI_IP_SETTINGS = "android.settings.WIFI_IP_SETTINGS"; field public static final java.lang.String ACTION_WIFI_SETTINGS = "android.settings.WIFI_SETTINGS"; field public static final java.lang.String ACTION_WIRELESS_SETTINGS = "android.settings.WIRELESS_SETTINGS"; + field public static final java.lang.String ACTION_ZEN_ACCESS_SETTINGS = "android.settings.ZEN_ACCESS_SETTINGS"; field public static final java.lang.String AUTHORITY = "settings"; field public static final java.lang.String EXTRA_ACCOUNT_TYPES = "account_types"; field public static final java.lang.String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; @@ -28843,7 +28847,6 @@ package android.service.notification { method public final int getCurrentInterruptionFilter(); method public final int getCurrentListenerHints(); method public android.service.notification.NotificationListenerService.RankingMap getCurrentRanking(); - method public final android.app.NotificationManager.Policy.Token getNotificationPolicyToken(); method public android.os.IBinder onBind(android.content.Intent); method public void onInterruptionFilterChanged(int); method public void onListenerConnected(); diff --git a/api/system-current.txt b/api/system-current.txt index 7012773..458cfbb 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -5237,17 +5237,31 @@ package android.app { method public void cancel(java.lang.String, int); method public void cancelAll(); method public android.service.notification.StatusBarNotification[] getActiveNotifications(); - method public android.app.NotificationManager.Policy getNotificationPolicy(android.app.NotificationManager.Policy.Token); - method public boolean isNotificationPolicyTokenValid(android.app.NotificationManager.Policy.Token); + method public final int getCurrentInterruptionFilter(); + method public android.app.NotificationManager.Policy getNotificationPolicy(); + method public boolean isNotificationPolicyAccessGranted(); method public void notify(int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); - method public void requestNotificationPolicyToken(android.app.NotificationManager.Policy.Token.RequestCallback, android.os.Handler); - method public void setNotificationPolicy(android.app.NotificationManager.Policy.Token, android.app.NotificationManager.Policy); + method public void requestPolicyAccess(android.app.NotificationManager.NotificationPolicyAccessRequestCallback, android.os.Handler); + method public final void setInterruptionFilter(int); + method public void setNotificationPolicy(android.app.NotificationManager.Policy); + field public static final java.lang.String ACTION_INTERRUPTION_FILTER_CHANGED = "android.app.action.INTERRUPTION_FILTER_CHANGED"; field public static final java.lang.String ACTION_NOTIFICATION_POLICY_CHANGED = "android.app.action.NOTIFICATION_POLICY_CHANGED"; + field public static final int INTERRUPTION_FILTER_ALARMS = 4; // 0x4 + field public static final int INTERRUPTION_FILTER_ALL = 1; // 0x1 + field public static final int INTERRUPTION_FILTER_NONE = 3; // 0x3 + field public static final int INTERRUPTION_FILTER_PRIORITY = 2; // 0x2 + field public static final int INTERRUPTION_FILTER_UNKNOWN = 0; // 0x0 + } + + public static abstract class NotificationManager.NotificationPolicyAccessRequestCallback { + ctor public NotificationManager.NotificationPolicyAccessRequestCallback(); + method public abstract void onAccessDenied(); + method public abstract void onAccessGranted(); } public static class NotificationManager.Policy implements android.os.Parcelable { - ctor public NotificationManager.Policy(int, int); + ctor public NotificationManager.Policy(int, int, int); method public int describeContents(); method public static java.lang.String priorityCategoriesToString(int); method public static java.lang.String prioritySendersToString(int); @@ -5261,20 +5275,9 @@ package android.app { field public static final int PRIORITY_SENDERS_ANY = 0; // 0x0 field public static final int PRIORITY_SENDERS_CONTACTS = 1; // 0x1 field public static final int PRIORITY_SENDERS_STARRED = 2; // 0x2 + field public final int priorityCallSenders; field public final int priorityCategories; - field public final int prioritySenders; - } - - public static class NotificationManager.Policy.Token implements android.os.Parcelable { - method public int describeContents(); - method public void writeToParcel(android.os.Parcel, int); - field public static final android.os.Parcelable.Creator<android.app.NotificationManager.Policy.Token> CREATOR; - } - - public static abstract class NotificationManager.Policy.Token.RequestCallback { - ctor public NotificationManager.Policy.Token.RequestCallback(); - method public abstract void onTokenDenied(); - method public abstract void onTokenGranted(android.app.NotificationManager.Policy.Token); + field public final int priorityMessageSenders; } public final class PendingIntent implements android.os.Parcelable { @@ -28557,6 +28560,7 @@ package android.provider { field public static final java.lang.String ACTION_WIFI_IP_SETTINGS = "android.settings.WIFI_IP_SETTINGS"; field public static final java.lang.String ACTION_WIFI_SETTINGS = "android.settings.WIFI_SETTINGS"; field public static final java.lang.String ACTION_WIRELESS_SETTINGS = "android.settings.WIRELESS_SETTINGS"; + field public static final java.lang.String ACTION_ZEN_ACCESS_SETTINGS = "android.settings.ZEN_ACCESS_SETTINGS"; field public static final java.lang.String AUTHORITY = "settings"; field public static final java.lang.String EXTRA_ACCOUNT_TYPES = "account_types"; field public static final java.lang.String EXTRA_AIRPLANE_MODE_ENABLED = "airplane_mode_enabled"; @@ -30897,7 +30901,6 @@ package android.service.notification { method public final int getCurrentInterruptionFilter(); method public final int getCurrentListenerHints(); method public android.service.notification.NotificationListenerService.RankingMap getCurrentRanking(); - method public final android.app.NotificationManager.Policy.Token getNotificationPolicyToken(); method public android.os.IBinder onBind(android.content.Intent); method public void onInterruptionFilterChanged(int); method public void onListenerConnected(); |