diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2011-08-15 17:12:33 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-15 17:12:33 -0700 |
commit | 837da7153f8ff144bbb02d68d37833f7dc106a0f (patch) | |
tree | 44a761402d1850340eb5bb854268adc370e4d0fc /media/java | |
parent | 994a74747ba3f83984c3d72dd30292a30b63ec98 (diff) | |
parent | 0a9faa8cf934ef38319cd945b600825c6bb88b9c (diff) | |
download | frameworks_base-837da7153f8ff144bbb02d68d37833f7dc106a0f.zip frameworks_base-837da7153f8ff144bbb02d68d37833f7dc106a0f.tar.gz frameworks_base-837da7153f8ff144bbb02d68d37833f7dc106a0f.tar.bz2 |
Merge "Bug 5045498 Send media button event receiver to remote control"
Diffstat (limited to 'media/java')
-rw-r--r-- | media/java/android/media/AudioManager.java | 11 | ||||
-rw-r--r-- | media/java/android/media/AudioService.java | 9 |
2 files changed, 18 insertions, 2 deletions
diff --git a/media/java/android/media/AudioManager.java b/media/java/android/media/AudioManager.java index 56a9933..6b5a49a 100644 --- a/media/java/android/media/AudioManager.java +++ b/media/java/android/media/AudioManager.java @@ -1830,6 +1830,17 @@ public class AudioManager { /** * @hide + * The media button event receiver associated with the IRemoteControlClient. + * The {@link android.content.ComponentName} value of the event receiver can be retrieved with + * {@link android.content.ComponentName#unflattenFromString(String)} + * + * @see #REMOTE_CONTROL_CLIENT_CHANGED_ACTION + */ + public static final String EXTRA_REMOTE_CONTROL_EVENT_RECEIVER = + "android.media.EXTRA_REMOTE_CONTROL_EVENT_RECEIVER"; + + /** + * @hide * The flags describing what information has changed in the current remote control client. * * @see #REMOTE_CONTROL_CLIENT_CHANGED_ACTION diff --git a/media/java/android/media/AudioService.java b/media/java/android/media/AudioService.java index 5951229..714810d 100644 --- a/media/java/android/media/AudioService.java +++ b/media/java/android/media/AudioService.java @@ -2167,8 +2167,10 @@ public class AudioService extends IAudioService.Stub { case MSG_RCDISPLAY_UPDATE: synchronized(mCurrentRcLock) { + // msg.obj is guaranteed to be non null + RemoteControlStackEntry rcse = (RemoteControlStackEntry)msg.obj; if ((mCurrentRcClient == null) || - (!mCurrentRcClient.equals((IRemoteControlClient)msg.obj))) { + (!mCurrentRcClient.equals(rcse.mRcClient))) { // the remote control display owner has changed between the // the message to update the display was sent, and the time it // gets to be processed (now) @@ -2183,6 +2185,9 @@ public class AudioService extends IAudioService.Stub { rcClientIntent.putExtra( AudioManager.EXTRA_REMOTE_CONTROL_CLIENT_INFO_CHANGED, msg.arg1); + rcClientIntent.putExtra( + AudioManager.EXTRA_REMOTE_CONTROL_EVENT_RECEIVER, + rcse.mReceiverComponent.flattenToString()); rcClientIntent.setFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY); mContext.sendBroadcast(rcClientIntent); } @@ -3131,7 +3136,7 @@ public class AudioService extends IAudioService.Stub { mCurrentRcClient = rcse.mRcClient; } mAudioHandler.sendMessage( mAudioHandler.obtainMessage(MSG_RCDISPLAY_UPDATE, - infoFlagsAboutToBeUsed /* arg1 */, 0, rcse.mRcClient /* obj */) ); + infoFlagsAboutToBeUsed /* arg1 */, 0, rcse /* obj, != null */) ); } /** |