Loading api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -5592,6 +5592,7 @@ package android.app { method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public boolean isNotificationListenerAccessGranted(android.content.ComponentName); method public boolean isNotificationPolicyAccessGranted(); method public boolean isNotificationPolicyAccessGranted(); method public void notify(int, android.app.Notification); method public void notify(int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -5798,6 +5798,7 @@ package android.app { method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public boolean isNotificationListenerAccessGranted(android.content.ComponentName); method public boolean isNotificationPolicyAccessGranted(); method public boolean isNotificationPolicyAccessGranted(); method public void notify(int, android.app.Notification); method public void notify(int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); api/test-current.txt +2 −1 Original line number Original line Diff line number Diff line Loading @@ -5606,6 +5606,7 @@ package android.app { method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public boolean isNotificationListenerAccessGranted(android.content.ComponentName); method public boolean isNotificationPolicyAccessGranted(); method public boolean isNotificationPolicyAccessGranted(); method public void notify(int, android.app.Notification); method public void notify(int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); Loading Loading @@ -35028,7 +35029,7 @@ package android.provider { field public static final java.lang.String DISABLED_PRINT_SERVICES = "disabled_print_services"; field public static final java.lang.String DISABLED_PRINT_SERVICES = "disabled_print_services"; field public static final java.lang.String ENABLED_ACCESSIBILITY_SERVICES = "enabled_accessibility_services"; field public static final java.lang.String ENABLED_ACCESSIBILITY_SERVICES = "enabled_accessibility_services"; field public static final java.lang.String ENABLED_INPUT_METHODS = "enabled_input_methods"; field public static final java.lang.String ENABLED_INPUT_METHODS = "enabled_input_methods"; field public static final java.lang.String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = "enabled_notification_policy_access_packages"; field public static final deprecated java.lang.String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = "enabled_notification_policy_access_packages"; field public static final deprecated java.lang.String HTTP_PROXY = "http_proxy"; field public static final deprecated java.lang.String HTTP_PROXY = "http_proxy"; field public static final java.lang.String INPUT_METHOD_SELECTOR_VISIBILITY = "input_method_selector_visibility"; field public static final java.lang.String INPUT_METHOD_SELECTOR_VISIBILITY = "input_method_selector_visibility"; field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; core/java/android/app/INotificationManager.aidl +10 −1 Original line number Original line Diff line number Diff line Loading @@ -116,6 +116,16 @@ interface INotificationManager boolean matchesCallFilter(in Bundle extras); boolean matchesCallFilter(in Bundle extras); boolean isSystemConditionProviderEnabled(String path); boolean isSystemConditionProviderEnabled(String path); boolean isNotificationListenerAccessGranted(in ComponentName listener); boolean isNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId); boolean isNotificationAssistantAccessGranted(in ComponentName assistant); void setNotificationListenerAccessGranted(in ComponentName listener, boolean enabled); void setNotificationAssistantAccessGranted(in ComponentName assistant, boolean enabled); void setNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId, boolean enabled); void setNotificationAssistantAccessGrantedForUser(in ComponentName assistant, int userId, boolean enabled); List<String> getEnabledNotificationListenerPackages(); List<ComponentName> getEnabledNotificationListeners(int userId); int getZenMode(); int getZenMode(); ZenModeConfig getZenModeConfig(); ZenModeConfig getZenModeConfig(); oneway void setZenMode(int mode, in Uri conditionId, String reason); oneway void setZenMode(int mode, in Uri conditionId, String reason); Loading @@ -123,7 +133,6 @@ interface INotificationManager boolean isNotificationPolicyAccessGranted(String pkg); boolean isNotificationPolicyAccessGranted(String pkg); NotificationManager.Policy getNotificationPolicy(String pkg); NotificationManager.Policy getNotificationPolicy(String pkg); void setNotificationPolicy(String pkg, in NotificationManager.Policy policy); void setNotificationPolicy(String pkg, in NotificationManager.Policy policy); String[] getPackagesRequestingNotificationPolicyAccess(); boolean isNotificationPolicyAccessGrantedForPackage(String pkg); boolean isNotificationPolicyAccessGrantedForPackage(String pkg); void setNotificationPolicyAccessGranted(String pkg, boolean granted); void setNotificationPolicyAccessGranted(String pkg, boolean granted); AutomaticZenRule getAutomaticZenRule(String id); AutomaticZenRule getAutomaticZenRule(String id); Loading core/java/android/app/NotificationManager.java +71 −18 Original line number Original line Diff line number Diff line Loading @@ -18,14 +18,12 @@ package android.app; import android.annotation.IntDef; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SdkConstant; import android.annotation.SdkConstant; import android.annotation.SystemService; import android.annotation.SystemService; import android.annotation.TestApi; import android.annotation.TestApi; import android.app.Notification.Builder; import android.app.Notification.Builder; import android.content.ComponentName; import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.pm.ParceledListSlice; import android.content.pm.ParceledListSlice; import android.graphics.drawable.Icon; import android.graphics.drawable.Icon; import android.net.Uri; import android.net.Uri; Loading @@ -33,7 +31,6 @@ import android.os.Build; import android.os.Bundle; import android.os.Bundle; import android.os.Handler; import android.os.Handler; import android.os.IBinder; import android.os.IBinder; import android.os.Looper; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import android.os.RemoteException; import android.os.RemoteException; Loading @@ -41,10 +38,8 @@ import android.os.ServiceManager; import android.os.StrictMode; import android.os.StrictMode; import android.os.UserHandle; import android.os.UserHandle; import android.provider.Settings.Global; import android.provider.Settings.Global; import android.service.notification.NotificationListenerService.Ranking; import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification; import android.service.notification.ZenModeConfig; import android.service.notification.ZenModeConfig; import android.util.ArraySet; import android.util.Log; import android.util.Log; import java.lang.annotation.Retention; import java.lang.annotation.Retention; Loading Loading @@ -747,14 +742,14 @@ public class NotificationManager { } } /** /** * Checks the ability to read/modify notification policy for the calling package. * Checks the ability to read/modify notification do not disturb policy for the calling package. * * * <p> * <p> * Returns true if the calling package can read/modify notification policy. * Returns true if the calling package can read/modify notification policy. * * * <p> * <p> * Request policy access by sending the user to the activity that matches the system intent * Apps can request policy access by sending the user to the activity that matches the system * action {@link android.provider.Settings#ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS}. * intent action {@link android.provider.Settings#ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS}. * * * <p> * <p> * Use {@link #ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED} to listen for * Use {@link #ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED} to listen for Loading @@ -769,6 +764,39 @@ public class NotificationManager { } } } } /** * Checks whether the user has approved a given * {@link android.service.notification.NotificationListenerService}. * * <p> * The listener service must belong to the calling app. * * <p> * Apps can request notification listener access by sending the user to the activity that * matches the system intent action * {@link android.provider.Settings#ACTION_NOTIFICATION_LISTENER_SETTINGS}. */ public boolean isNotificationListenerAccessGranted(ComponentName listener) { INotificationManager service = getService(); try { return service.isNotificationListenerAccessGranted(listener); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide */ public boolean isNotificationAssistantAccessGranted(ComponentName assistant) { INotificationManager service = getService(); try { return service.isNotificationAssistantAccessGranted(assistant); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** @hide */ /** @hide */ public boolean isNotificationPolicyAccessGrantedForPackage(String pkg) { public boolean isNotificationPolicyAccessGrantedForPackage(String pkg) { INotificationManager service = getService(); INotificationManager service = getService(); Loading @@ -779,6 +807,18 @@ public class NotificationManager { } } } } /** * @hide */ public List<String> getEnabledNotificationListenerPackages() { INotificationManager service = getService(); try { return service.getEnabledNotificationListenerPackages(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** /** * Gets the current notification policy. * Gets the current notification policy. * * Loading Loading @@ -825,21 +865,34 @@ public class NotificationManager { } } /** @hide */ /** @hide */ public ArraySet<String> getPackagesRequestingNotificationPolicyAccess() { public void setNotificationListenerAccessGranted(ComponentName listener, boolean granted) { INotificationManager service = getService(); INotificationManager service = getService(); try { try { final String[] pkgs = service.getPackagesRequestingNotificationPolicyAccess(); service.setNotificationListenerAccessGranted(listener, granted); if (pkgs != null && pkgs.length > 0) { } catch (RemoteException e) { final ArraySet<String> rt = new ArraySet<>(pkgs.length); throw e.rethrowFromSystemServer(); for (int i = 0; i < pkgs.length; i++) { rt.add(pkgs[i]); } } return rt; } } /** @hide */ public void setNotificationListenerAccessGrantedForUser(ComponentName listener, int userId, boolean granted) { INotificationManager service = getService(); try { service.setNotificationListenerAccessGrantedForUser(listener, userId, granted); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** @hide */ public List<ComponentName> getEnabledNotificationListeners(int userId) { INotificationManager service = getService(); try { return service.getEnabledNotificationListeners(userId); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } return new ArraySet<>(); } } private Context mContext; private Context mContext; Loading Loading
api/current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -5592,6 +5592,7 @@ package android.app { method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public boolean isNotificationListenerAccessGranted(android.content.ComponentName); method public boolean isNotificationPolicyAccessGranted(); method public boolean isNotificationPolicyAccessGranted(); method public void notify(int, android.app.Notification); method public void notify(int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification);
api/system-current.txt +1 −0 Original line number Original line Diff line number Diff line Loading @@ -5798,6 +5798,7 @@ package android.app { method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public boolean isNotificationListenerAccessGranted(android.content.ComponentName); method public boolean isNotificationPolicyAccessGranted(); method public boolean isNotificationPolicyAccessGranted(); method public void notify(int, android.app.Notification); method public void notify(int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification);
api/test-current.txt +2 −1 Original line number Original line Diff line number Diff line Loading @@ -5606,6 +5606,7 @@ package android.app { method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannelGroup> getNotificationChannelGroups(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public java.util.List<android.app.NotificationChannel> getNotificationChannels(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public android.app.NotificationManager.Policy getNotificationPolicy(); method public boolean isNotificationListenerAccessGranted(android.content.ComponentName); method public boolean isNotificationPolicyAccessGranted(); method public boolean isNotificationPolicyAccessGranted(); method public void notify(int, android.app.Notification); method public void notify(int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); method public void notify(java.lang.String, int, android.app.Notification); Loading Loading @@ -35028,7 +35029,7 @@ package android.provider { field public static final java.lang.String DISABLED_PRINT_SERVICES = "disabled_print_services"; field public static final java.lang.String DISABLED_PRINT_SERVICES = "disabled_print_services"; field public static final java.lang.String ENABLED_ACCESSIBILITY_SERVICES = "enabled_accessibility_services"; field public static final java.lang.String ENABLED_ACCESSIBILITY_SERVICES = "enabled_accessibility_services"; field public static final java.lang.String ENABLED_INPUT_METHODS = "enabled_input_methods"; field public static final java.lang.String ENABLED_INPUT_METHODS = "enabled_input_methods"; field public static final java.lang.String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = "enabled_notification_policy_access_packages"; field public static final deprecated java.lang.String ENABLED_NOTIFICATION_POLICY_ACCESS_PACKAGES = "enabled_notification_policy_access_packages"; field public static final deprecated java.lang.String HTTP_PROXY = "http_proxy"; field public static final deprecated java.lang.String HTTP_PROXY = "http_proxy"; field public static final java.lang.String INPUT_METHOD_SELECTOR_VISIBILITY = "input_method_selector_visibility"; field public static final java.lang.String INPUT_METHOD_SELECTOR_VISIBILITY = "input_method_selector_visibility"; field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps"; field public static final deprecated java.lang.String INSTALL_NON_MARKET_APPS = "install_non_market_apps";
core/java/android/app/INotificationManager.aidl +10 −1 Original line number Original line Diff line number Diff line Loading @@ -116,6 +116,16 @@ interface INotificationManager boolean matchesCallFilter(in Bundle extras); boolean matchesCallFilter(in Bundle extras); boolean isSystemConditionProviderEnabled(String path); boolean isSystemConditionProviderEnabled(String path); boolean isNotificationListenerAccessGranted(in ComponentName listener); boolean isNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId); boolean isNotificationAssistantAccessGranted(in ComponentName assistant); void setNotificationListenerAccessGranted(in ComponentName listener, boolean enabled); void setNotificationAssistantAccessGranted(in ComponentName assistant, boolean enabled); void setNotificationListenerAccessGrantedForUser(in ComponentName listener, int userId, boolean enabled); void setNotificationAssistantAccessGrantedForUser(in ComponentName assistant, int userId, boolean enabled); List<String> getEnabledNotificationListenerPackages(); List<ComponentName> getEnabledNotificationListeners(int userId); int getZenMode(); int getZenMode(); ZenModeConfig getZenModeConfig(); ZenModeConfig getZenModeConfig(); oneway void setZenMode(int mode, in Uri conditionId, String reason); oneway void setZenMode(int mode, in Uri conditionId, String reason); Loading @@ -123,7 +133,6 @@ interface INotificationManager boolean isNotificationPolicyAccessGranted(String pkg); boolean isNotificationPolicyAccessGranted(String pkg); NotificationManager.Policy getNotificationPolicy(String pkg); NotificationManager.Policy getNotificationPolicy(String pkg); void setNotificationPolicy(String pkg, in NotificationManager.Policy policy); void setNotificationPolicy(String pkg, in NotificationManager.Policy policy); String[] getPackagesRequestingNotificationPolicyAccess(); boolean isNotificationPolicyAccessGrantedForPackage(String pkg); boolean isNotificationPolicyAccessGrantedForPackage(String pkg); void setNotificationPolicyAccessGranted(String pkg, boolean granted); void setNotificationPolicyAccessGranted(String pkg, boolean granted); AutomaticZenRule getAutomaticZenRule(String id); AutomaticZenRule getAutomaticZenRule(String id); Loading
core/java/android/app/NotificationManager.java +71 −18 Original line number Original line Diff line number Diff line Loading @@ -18,14 +18,12 @@ package android.app; import android.annotation.IntDef; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SdkConstant; import android.annotation.SdkConstant; import android.annotation.SystemService; import android.annotation.SystemService; import android.annotation.TestApi; import android.annotation.TestApi; import android.app.Notification.Builder; import android.app.Notification.Builder; import android.content.ComponentName; import android.content.ComponentName; import android.content.Context; import android.content.Context; import android.content.Intent; import android.content.pm.ParceledListSlice; import android.content.pm.ParceledListSlice; import android.graphics.drawable.Icon; import android.graphics.drawable.Icon; import android.net.Uri; import android.net.Uri; Loading @@ -33,7 +31,6 @@ import android.os.Build; import android.os.Bundle; import android.os.Bundle; import android.os.Handler; import android.os.Handler; import android.os.IBinder; import android.os.IBinder; import android.os.Looper; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import android.os.RemoteException; import android.os.RemoteException; Loading @@ -41,10 +38,8 @@ import android.os.ServiceManager; import android.os.StrictMode; import android.os.StrictMode; import android.os.UserHandle; import android.os.UserHandle; import android.provider.Settings.Global; import android.provider.Settings.Global; import android.service.notification.NotificationListenerService.Ranking; import android.service.notification.StatusBarNotification; import android.service.notification.StatusBarNotification; import android.service.notification.ZenModeConfig; import android.service.notification.ZenModeConfig; import android.util.ArraySet; import android.util.Log; import android.util.Log; import java.lang.annotation.Retention; import java.lang.annotation.Retention; Loading Loading @@ -747,14 +742,14 @@ public class NotificationManager { } } /** /** * Checks the ability to read/modify notification policy for the calling package. * Checks the ability to read/modify notification do not disturb policy for the calling package. * * * <p> * <p> * Returns true if the calling package can read/modify notification policy. * Returns true if the calling package can read/modify notification policy. * * * <p> * <p> * Request policy access by sending the user to the activity that matches the system intent * Apps can request policy access by sending the user to the activity that matches the system * action {@link android.provider.Settings#ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS}. * intent action {@link android.provider.Settings#ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS}. * * * <p> * <p> * Use {@link #ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED} to listen for * Use {@link #ACTION_NOTIFICATION_POLICY_ACCESS_GRANTED_CHANGED} to listen for Loading @@ -769,6 +764,39 @@ public class NotificationManager { } } } } /** * Checks whether the user has approved a given * {@link android.service.notification.NotificationListenerService}. * * <p> * The listener service must belong to the calling app. * * <p> * Apps can request notification listener access by sending the user to the activity that * matches the system intent action * {@link android.provider.Settings#ACTION_NOTIFICATION_LISTENER_SETTINGS}. */ public boolean isNotificationListenerAccessGranted(ComponentName listener) { INotificationManager service = getService(); try { return service.isNotificationListenerAccessGranted(listener); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * @hide */ public boolean isNotificationAssistantAccessGranted(ComponentName assistant) { INotificationManager service = getService(); try { return service.isNotificationAssistantAccessGranted(assistant); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** @hide */ /** @hide */ public boolean isNotificationPolicyAccessGrantedForPackage(String pkg) { public boolean isNotificationPolicyAccessGrantedForPackage(String pkg) { INotificationManager service = getService(); INotificationManager service = getService(); Loading @@ -779,6 +807,18 @@ public class NotificationManager { } } } } /** * @hide */ public List<String> getEnabledNotificationListenerPackages() { INotificationManager service = getService(); try { return service.getEnabledNotificationListenerPackages(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** /** * Gets the current notification policy. * Gets the current notification policy. * * Loading Loading @@ -825,21 +865,34 @@ public class NotificationManager { } } /** @hide */ /** @hide */ public ArraySet<String> getPackagesRequestingNotificationPolicyAccess() { public void setNotificationListenerAccessGranted(ComponentName listener, boolean granted) { INotificationManager service = getService(); INotificationManager service = getService(); try { try { final String[] pkgs = service.getPackagesRequestingNotificationPolicyAccess(); service.setNotificationListenerAccessGranted(listener, granted); if (pkgs != null && pkgs.length > 0) { } catch (RemoteException e) { final ArraySet<String> rt = new ArraySet<>(pkgs.length); throw e.rethrowFromSystemServer(); for (int i = 0; i < pkgs.length; i++) { rt.add(pkgs[i]); } } return rt; } } /** @hide */ public void setNotificationListenerAccessGrantedForUser(ComponentName listener, int userId, boolean granted) { INotificationManager service = getService(); try { service.setNotificationListenerAccessGrantedForUser(listener, userId, granted); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** @hide */ public List<ComponentName> getEnabledNotificationListeners(int userId) { INotificationManager service = getService(); try { return service.getEnabledNotificationListeners(userId); } catch (RemoteException e) { } catch (RemoteException e) { throw e.rethrowFromSystemServer(); throw e.rethrowFromSystemServer(); } } return new ArraySet<>(); } } private Context mContext; private Context mContext; Loading