OSDN Git Service

Remote volume handling
authorJean-Michel Trivi <jmtrivi@google.com>
Mon, 11 Jun 2012 22:03:52 +0000 (15:03 -0700)
committerJean-Michel Trivi <jmtrivi@google.com>
Tue, 19 Jun 2012 01:37:17 +0000 (18:37 -0700)
commit3114ce3861f20f9a5c2c59dd2629197a1f4874a8
treec23f8f5c493fecd904022333cac099451fb20d6b
parent4cb3b76caa004867bac43f0001072e24bfa8c120
Remote volume handling

Extend RemoteControlClient class to enable an applicaton to
 specify more information about how it's playing media, now covering
 usecases where media playback happens "remotely". This playback
 information can be used to set the volume and maximum volume
 used remotely.
Declare a new intent and associated extras in Intent,
 ACTION_VOLUME_UPDATE, so an application can be notified that
 the volume it handles should be updated. It can then use
 the new RemoteControlClient.setPlaybackInformation() method
 to notify AudioService what the volume is.
Extend AudioService to maintain playback information associated
 with the RemoteControlClient information in the stack of
 media button event receivers (mRCStack). The information
 about the active remote is cached so the stack doesn't have
 to be iterated over in order to retrieve remote playback info.
 Events to "adjust" the remote volume based on hardware key
 presses cause the client application to be notified of
 volume updates, and the volume panel to display the volume
 set by the app.
 Revise which stream type is controlled when none is specified
 according to latest guidelines for remote playback.
Update VolumePanel class to support a new pseudo stream type,
 AudioService.STREAM_REMOTE_MUSIC, that corresponds to the
 remote playback volume, and uses the new "media route" icon.
 Enable it to receive asynchronously new volume values for
 the remote that will be displayed if the UI is still up,
 and ignored otherwise.
 Now supports hiding/showing sliders dynamically so remote
 volume only appears when AudioService has a remote control
 client handling remote volume.
Define new java symbols for the two media route icons.
Modify lockscreen behavior: don't automatically control music
 volume when music is active, consider also remote playback.

Still to do:
- playback information set by RemoteControlClient should post
  a message for AudioService to update playback information
  instead of updating it synchronously

Change-Id: I557aa687239f9acfe33a609f05876c67fa7eb967
core/java/android/content/Intent.java
core/java/android/view/VolumePanel.java
core/res/res/values/public.xml
media/java/android/media/AudioManager.java
media/java/android/media/AudioService.java
media/java/android/media/IAudioService.aidl
media/java/android/media/RemoteControlClient.java
policy/src/com/android/internal/policy/impl/KeyguardViewBase.java