summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorRoboErik <epastern@google.com>2014-05-21 19:59:10 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-21 19:59:11 +0000
commit5b53148a4e8d47b88362703445010c54f9fd6ecc (patch)
tree879e7fa812213756a040528de94894f34e061a5c /media
parentafe18ed6cd409f75315da8e834554a56f0ec4651 (diff)
parent9a9d0b5f6f4be758ed6c8b837a9dd01a451bc0c0 (diff)
downloadframeworks_base-5b53148a4e8d47b88362703445010c54f9fd6ecc.zip
frameworks_base-5b53148a4e8d47b88362703445010c54f9fd6ecc.tar.gz
frameworks_base-5b53148a4e8d47b88362703445010c54f9fd6ecc.tar.bz2
Merge changes I1cbdff1d,I23906b4c
* changes: Handle headsethook voice launching Add 5s timeout to wakelock
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/session/ISessionCallback.aidl2
-rw-r--r--media/java/android/media/session/MediaSession.java22
-rw-r--r--media/java/android/media/session/MediaSessionLegacyHelper.java2
3 files changed, 12 insertions, 14 deletions
diff --git a/media/java/android/media/session/ISessionCallback.aidl b/media/java/android/media/session/ISessionCallback.aidl
index 7b0412e..103c3f1 100644
--- a/media/java/android/media/session/ISessionCallback.aidl
+++ b/media/java/android/media/session/ISessionCallback.aidl
@@ -28,7 +28,7 @@ import android.os.ResultReceiver;
*/
oneway interface ISessionCallback {
void onCommand(String command, in Bundle extras, in ResultReceiver cb);
- void onMediaButton(in Intent mediaButtonIntent, in ResultReceiver cb);
+ void onMediaButton(in Intent mediaButtonIntent, int sequenceNumber, in ResultReceiver cb);
void onRequestRouteChange(in RouteInfo route);
void onRouteConnected(in RouteInfo route, in RouteOptions options);
void onRouteDisconnected(in RouteInfo route, int reason);
diff --git a/media/java/android/media/session/MediaSession.java b/media/java/android/media/session/MediaSession.java
index 5b9adaa..6a62dc2 100644
--- a/media/java/android/media/session/MediaSession.java
+++ b/media/java/android/media/session/MediaSession.java
@@ -119,13 +119,6 @@ public final class MediaSession {
*/
public static final int DISCONNECT_REASON_SESSION_DESTROYED = 5;
- /**
- * Status code indicating the call was handled.
- *
- * @hide
- */
- public static final int RESULT_SUCCESS = 0;
-
private static final int MSG_MEDIA_BUTTON = 1;
private static final int MSG_COMMAND = 2;
private static final int MSG_ROUTE_CHANGE = 3;
@@ -563,14 +556,17 @@ public final class MediaSession {
}
@Override
- public void onMediaButton(Intent mediaButtonIntent, ResultReceiver cb)
+ public void onMediaButton(Intent mediaButtonIntent, int sequenceNumber, ResultReceiver cb)
throws RemoteException {
MediaSession session = mMediaSession.get();
- if (session != null) {
- session.postMediaButton(mediaButtonIntent);
- }
- if (cb != null) {
- cb.send(RESULT_SUCCESS, null);
+ try {
+ if (session != null) {
+ session.postMediaButton(mediaButtonIntent);
+ }
+ } finally {
+ if (cb != null) {
+ cb.send(sequenceNumber, null);
+ }
}
}
diff --git a/media/java/android/media/session/MediaSessionLegacyHelper.java b/media/java/android/media/session/MediaSessionLegacyHelper.java
index 2e02a66..249b9c4 100644
--- a/media/java/android/media/session/MediaSessionLegacyHelper.java
+++ b/media/java/android/media/session/MediaSessionLegacyHelper.java
@@ -137,6 +137,8 @@ public class MediaSessionLegacyHelper {
return;
}
holder.mMediaButtonListener = new MediaButtonListener(pi, context);
+ // TODO determine if handling transport performer commands should also
+ // set this flag
holder.mFlags |= MediaSession.FLAG_HANDLES_MEDIA_BUTTONS;
holder.mSession.setFlags(holder.mFlags);
holder.mSession.getTransportPerformer().addListener(holder.mMediaButtonListener, mHandler);