Add hasEnabledNotificationListener API
This CL adds a system API to NotificationManager for checking whether
the NotificationListener for the current package name and user id is
enabled or not.
This replaces existing implementation which was using binder calls
directly to NotificationManagerService.
Bug: 160762852
Test: atest CtsMediaHostTestCases:\
android.media.session.cts.MediaSessionManagerHostTest\
#testGetActiveSessions_withSession2
-> MediaSessionManager#getActiveSessions verifies call by checking if
the notification listener is currently enabled.
Change-Id: Ic730b0abfe08c40171062421b2015be9cc05310a
diff --git a/non-updatable-api/module-lib-current.txt b/non-updatable-api/module-lib-current.txt
index a5ca196..682c16d 100644
--- a/non-updatable-api/module-lib-current.txt
+++ b/non-updatable-api/module-lib-current.txt
@@ -5,6 +5,10 @@
field public static final String OPSTR_NO_ISOLATED_STORAGE = "android:no_isolated_storage";
}
+ public class NotificationManager {
+ method public boolean hasEnabledNotificationListener(@NonNull String, @NonNull android.os.UserHandle);
+ }
+
}
package android.content.rollback {