[Media ML] Replace observing changes in Settings value
Currently, MediaSessionService observes the
ENABLED_NOTIFICATION_LISTENERS value in Settings to be notified
when a previously "enabled" NotificationListener becomes "disabled".
Instead, this CL adds a new broadcast intent action that
NotificationManagerService can use to notify MediaSessionService
whenever the enabled value of a notification listener changes.
Bug: 160762852, Bug: 147019349
Test: Go to Settings > Apps & Notifications > Special app access
> Notification access
and check if allowing/disallowing Notification access for any
app causes onEnabledChanged to be called.
Change-Id: I3aefa40083fedb78214ae884c7cccaf8de206663
This commit is contained in:
@@ -281,6 +281,16 @@ public class NotificationManager {
|
||||
public static final String ACTION_INTERRUPTION_FILTER_CHANGED
|
||||
= "android.app.action.INTERRUPTION_FILTER_CHANGED";
|
||||
|
||||
/**
|
||||
* Intent that is broadcast when the state of
|
||||
* {@link #hasEnabledNotificationListener(String, UserHandle)} changes.
|
||||
* @hide
|
||||
*/
|
||||
@SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
|
||||
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
|
||||
public static final String ACTION_NOTIFICATION_LISTENER_ENABLED_CHANGED =
|
||||
"android.app.action.NOTIFICATION_LISTENER_ENABLED_CHANGED";
|
||||
|
||||
/**
|
||||
* Intent that is broadcast when the state of getCurrentInterruptionFilter() changes.
|
||||
* @hide
|
||||
|
||||
Reference in New Issue
Block a user