OSDN Git Service

Also rely on enabled notification listeners for RemoteController registration
authorJean-Michel Trivi <jmtrivi@google.com>
Sat, 28 Sep 2013 01:37:36 +0000 (18:37 -0700)
committerJean-Michel Trivi <jmtrivi@google.com>
Sat, 5 Oct 2013 00:50:44 +0000 (17:50 -0700)
commitf108cdd9ee5efe354d87edd02a07b323298c116c
tree02f05dca3512226d004ecccfc5f3c481a1d85154
parenta48ccdd6fb671435ed2583830b2828450bfc3cde
Also rely on enabled notification listeners for RemoteController registration

Registration of a RemoteController may succeed only if:
 - the caller has the MEDIA_CONTENT_CONTROL permission,
 - or if the RemoteController.OnClientUpdateListener it
   registers if one of the enabled notification listeners.

For using the "enabled notification listener" functionality,
 the CL involved:
 - making OnClientUpdateListener an interface so a 3rd-party
   application may have its implementation extend
   NotificationListenerService, which is required for a
   listener to be enabled by the user.
 - add the concept of "enabled" status in an
   IRemoteControlDisplay, so a RemoteController (which
   encapsulates the IRemoteControlDisplay implementation)
   may be registered, but later temporarily disabled by
   the user, as a result of a user action in the security
   settings, or a user switch.
 - making MediaFocusControl, the component tied to
   AudioService, monitor changes in enabled notification
   listeners, and act upon enable/disable changes.

Bug 8209392

Change-Id: Ia8dfa2156c65668b2b0d4ae92048005912652d84
12 files changed:
api/current.txt
cmds/media/src/com/android/commands/media/Media.java
media/java/android/media/AudioManager.java
media/java/android/media/AudioService.java
media/java/android/media/IAudioService.aidl
media/java/android/media/IRemoteControlClient.aidl
media/java/android/media/IRemoteControlDisplay.aidl
media/java/android/media/MediaFocusControl.java
media/java/android/media/RemoteControlClient.java
media/java/android/media/RemoteController.java
packages/Keyguard/src/com/android/keyguard/KeyguardTransportControlView.java
packages/Keyguard/src/com/android/keyguard/KeyguardUpdateMonitor.java