From a8f951462791a16f47e8c07e552232f31dcefac5 Mon Sep 17 00:00:00 2001 From: RoboErik Date: Mon, 5 May 2014 14:23:49 -0700 Subject: Add a class for managing Session priority Priority is given first to the system priorty session, then to active local sessions, then to active remote sessions, then to the rest of the sessions. Ordering within categories is by whoever last performed an action we associate with the user. The stack has methods for getting filtered sets of this priority. This also: -Changes publish to setActive(boolean) -Adds a flag for handling media buttons. -Adds a flag for transport controls instead of enabling once. -Unhides the setFlags API. -Updates the legacy helper to use the flags. Change-Id: I6ebeb27410de1b24149fd6e1785613ac444f0774 --- tests/OneMedia/src/com/android/onemedia/PlayerSession.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/OneMedia/src/com/android/onemedia/PlayerSession.java b/tests/OneMedia/src/com/android/onemedia/PlayerSession.java index 2e029f0..b7dcef7 100644 --- a/tests/OneMedia/src/com/android/onemedia/PlayerSession.java +++ b/tests/OneMedia/src/com/android/onemedia/PlayerSession.java @@ -84,11 +84,12 @@ public class PlayerSession { Log.d(TAG, "Creating session for package " + mContext.getBasePackageName()); mSession = man.createSession("OneMedia"); mSession.addCallback(mCallback); - mPerformer = mSession.setTransportPerformerEnabled(); + mPerformer = mSession.getTransportPerformer(); mPerformer.addListener(new TransportListener()); mPerformer.setPlaybackState(mPlaybackState); + mSession.setFlags(Session.FLAG_HANDLES_TRANSPORT_CONTROLS); mSession.setRouteOptions(mRouteOptions); - mSession.publish(); + mSession.setActive(true); } public void onDestroy() { -- cgit v1.1