Adds a TransportController and TransportPerformer to session
This makes transport controls a primitive interface on sessions with
a way to create the performer, register callbacks, and send commands
and updates between controllers and performers. This still needs some
cleanup but has been tested with OneMedia.
Change-Id: I373d35f7ccc383b8421bd14044457467d80425f3
diff --git a/services/core/java/com/android/server/media/MediaSessionService.java b/services/core/java/com/android/server/media/MediaSessionService.java
index a7ff926..8fe6055 100644
--- a/services/core/java/com/android/server/media/MediaSessionService.java
+++ b/services/core/java/com/android/server/media/MediaSessionService.java
@@ -21,6 +21,7 @@
import android.media.session.IMediaSessionCallback;
import android.media.session.IMediaSessionManager;
import android.os.Binder;
+import android.os.Handler;
import android.os.RemoteException;
import android.text.TextUtils;
import android.util.Log;
@@ -41,6 +42,8 @@
private final ArrayList<MediaSessionRecord> mSessions
= new ArrayList<MediaSessionRecord>();
private final Object mLock = new Object();
+ // TODO do we want a separate thread for handling mediasession messages?
+ private final Handler mHandler = new Handler();
public MediaSessionService(Context context) {
super(context);
@@ -91,7 +94,8 @@
private MediaSessionRecord createSessionLocked(int pid, String packageName,
IMediaSessionCallback cb, String tag) {
- final MediaSessionRecord session = new MediaSessionRecord(pid, packageName, cb, tag, this);
+ final MediaSessionRecord session = new MediaSessionRecord(pid, packageName, cb, tag, this,
+ mHandler);
try {
cb.asBinder().linkToDeath(session, 0);
} catch (RemoteException e) {