summaryrefslogtreecommitdiff
path: root/tools/aapt2/java/JavaClassGenerator_test.cpp
diff options
context:
space:
mode:
authorJaewan Kim <jaewan@google.com>2018-03-23 00:13:51 +0900
committerJaewan Kim <jaewan@google.com>2018-03-29 11:19:20 +0900
commitb0e32b0856ac398ccac475cd0fac0fce88cc4ce2 (patch)
tree5361a16cc55e8fba917d295585dd50ca38834e94 /tools/aapt2/java/JavaClassGenerator_test.cpp
parent1c73370df4c6b8399a264923e1f370b64019fca3 (diff)
MediaSessionManager: Add isTrustedForMediaControl()
The API checks whether an app is granted MEDIA_CONTENT_CONTROL permisison or has enabled notification listener. Such apps can be considered as the system component (e.g. Bluetooth) or equivalent (e.g. Auto/Wearable companion app), so sessions shouldn't refuse connection request from it. It needs to be public because API for checking whether an app has an enabled notification listener can only be called by the system service. (see: NotificationManager.getEnabledNotificationListeners(int)) With the MediaSessionManager#isTrustedForMediaControl(), MediaSessionService will query the information indirectly for a session to tell an app is trusted. Note that this isn't workaround for bypassing permission check of NotificationManager API calls. It's indirectly available through the android.provider.Settings.Secure with the *deprecated* key ENABLD_NOTIFICATION_LISTENERS and it doesn't need any permission. MediaSessionManager#isTrustedForMediaControl() is needed to avoid using deprecated key for querying notification listeners. Bug: 75500592 Test: Build Change-Id: I8d1183aa946aa0d2ec35dbd7f31933d1c2717f99
Diffstat (limited to 'tools/aapt2/java/JavaClassGenerator_test.cpp')
0 files changed, 0 insertions, 0 deletions