summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--media/java/android/media/AudioManager.java11
-rw-r--r--media/java/android/media/AudioService.java9
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 */) );
}
/**