24 Commits

Author SHA1 Message Date
RoboErik
14f717a506 rename add/removeCallback to register/unregisterCallback
bug:17390821
Change-Id: Id610b481083686dba2a28b6c7c47b747f89eef4f
2014-09-05 11:40:33 -07:00
RoboErik
3625bf72cb Update to MediaBrowser APIs per council feedback
Does all the updates in the bug except the loadIcon/loadBitmap
methods, which are removed per feedback from Sharkey.

bug:17205016
Change-Id: Ie84d4d25a59c6985ce16972c26c8d1e5c02ff5c9
2014-08-28 21:11:22 +00:00
Jeff Brown
b135d06cb8 Remove incomplete media router API. (DO NOT MERGE)
Change-Id: I310fadafb5a6b8190a32e5d87f3e1823c87bcef7
2014-08-19 20:08:52 -07:00
Daniel Sandler
45f7ee8201 Add metadata and notifications to OneMedia
This wires up a notification and some basic metadata for testing
in OneMedia.

Change-Id: I0f2e922536c85caa63f66dae7deb55ffe94fe231
2014-08-14 16:18:15 -07:00
RoboErik
477d1197c3 Combine MediaSession Callback and TransportControlsCallback
This combines them into a single Callback class and adds default
handling to media buttons to check the available actions and call
one of the other methods if appropriate.

Change-Id: If9897d8cf6d8d8046aa85a646c22382f1db1461b
2014-08-07 16:54:52 -07:00
RoboErik
75847b98f3 Add display metadata and change strings to CharSequences
This adds some fields for display purposes to MediaMetadata and also
makes the default for all text CharSequence instead of String. Also
adds a hidden method for getting a Description for the metadata.

bug: 11708293
Change-Id: I0ed58d9ac3aeff41325c4ccf5fed0539bbf03b4d
2014-08-05 14:30:27 -07:00
RoboErik
40495e0545 Fix checkbuild
Change-Id: I66321c6da4f921cee2db6f9f05312a6a8edc66d3
2014-07-29 15:51:07 +00:00
RoboErik
8b4bffcac9 Make MediaSession and MediaController constructors public
This makes the MediaSession/Controller constructors public and registers
with the system behind the scenes.

This also adds a bit about needing to call setActive(true) to start receiving
commands in MediaSession's docs.

Change-Id: If882d229b54c36bf0831aca0255052dda667a2bc
2014-07-16 12:03:45 -07:00
RoboErik
c785a78fb4 Make PlaybackState immutable with a builder
bug:15862252
Change-Id: I51f2e466bd2c41bbe80d20aa9785126a7ac6ab3f
2014-07-14 13:40:43 -07:00
RoboErik
550116576c Add API to set a default session in Activity
We may have multiple remote sessions at once so an app needs a way
to specify a default session to route media and volume commands to
when its activity is in the foreground. This adds an api that works
in parallel with the default stream api on Activity.

bug:15727927
Change-Id: I5b67cb3e20647f9437d90aa65be63efe8c7865cf
2014-07-14 11:17:06 -07:00
Jeff Brown
ff0215dd64 Update media session test application for new media router.
Change-Id: I3c19e008d211099b4d7320e3f195850cfb4dd927
2014-07-14 04:38:15 -07:00
Erik Pasternak
b2e93efcac Revert "Make PlaybackState immutable with a builder"
Will resubmit tomorrow for Build Breakage Friday as this change needs new SDK prebuilts for unbundled app branches.

This reverts commit aa746b27610680a2c0fbdf7d81a6455c4597f05e.

Change-Id: I28ba7e1b09234a5eb1b725aed043b9de98e1bc16
2014-07-10 22:51:34 +00:00
RoboErik
5a4e011143 Make PlaybackState immutable with a builder
bug:15862252
Change-Id: I8944b7753cd6a36a74b0091f71a386f77040c4ab
2014-07-10 22:39:03 +00:00
Jeff Brown
dba34ba35c Make MediaSessionToken an inner class of MediaSession.
Also add some missing AIDLs to the framework makefile to ensure
they are included in the SDK.

Change-Id: If85a3091c7591e0b3bbe6cc4bb74aba2284b4f42
2014-06-30 16:05:25 -07:00
RoboErik
b69ffd4dc2 Minimum work to make volume handling work with sessions
This is the minimum change to make adjusting volume work with
MediaSessions. This only affects adjusting the volume and adjusting
the volume with a suggested stream. Adjusting a specific stream or
setting a specific stream will still use the same code.

This does not fix existing remote volume handling in RCC, which
will require a separate change to MediaController.

Change-Id: I5b957ff4bece1ee11e2364e1f216e1c08343c983
2014-05-30 15:47:58 -07:00
RoboErik
c47fa84b0a Refactor transport controls APIs
This merges TransportPerformer into MediaSession + a
TransportControlsCallback and makes TransportController into an
inner class on MediaController called TransportControls. Also makes
the PlaybackState and Metadata part of the session APIs instead of
transport controls.

Change-Id: I16ad392e6d318abe3119ad5d89656d253af25e16
2014-05-30 10:35:44 -07:00
RoboErik
79fa4630bb API changes to sessions
Changes requested by API Council review. A second CL will refactor
TransportController and TransportPerformer based on feedback.

Change-Id: Ie26a7d01d7021232a66c2edf1eb58120437fdfde
2014-05-29 11:28:48 -07:00
RoboErik
42ea7eecd1 Rename session classes to have media prefix, hide routes
This renames several of the core session classes to be prefixed
with Media. It also adds @hide to all route references for now.

Change-Id: Idb42897d490cf24626e4e93ca975b2cb93ec054c
2014-05-16 16:40:17 -07:00
RoboErik
a8f9514627 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
2014-05-06 17:26:06 -07:00
RoboErik
f1372428f2 Add Session API calls to RCC and AudioManager
This makes RCC and MediaButtonReceiver (via AudioManager) also use the new Session APIs in parallel to their existing code. This will allow us to bring up the Session compatibility pieces without disrupting the old behavior and then switch everything over to just using the new APIs when ready.

Change-Id: I33ce0a044dea3ec763f2302b91a5e415be27d4a4
2014-05-01 17:14:01 +00:00
RoboErik
07c7077c54 Add RouteProviders to the new Media APIs
Compiles and works with OneMedia. This currently is a rough test of
the system for finding, connecting to, and sending messages to routes.
This will just connect to the first route it finds when a request to
open the route picker is made (and disconnect when another request is
made).

Change-Id: I5de5521a079471b9e02664be4654c0591dfd9a6d
2014-04-17 15:02:33 -07:00
RoboErik
8ae0f34db9 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
2014-03-12 15:09:42 -07:00
RoboErik
2f5b057da7 Move Session apis to android.media.session
This is to make it easier to distinguish the new apis from the old
ones.

Change-Id: Ic5eaf65e8bd054a844f87b9118c4bb18f30ac8a7
2014-02-25 16:01:55 -08:00
RoboErik
bfa153b64b Initial commit for MediaSession test app
This app creates a service and UI in separate processes and uses
the new MediaSession APIs. This is still a rough work in progress.

Change-Id: I9692c95bf2fdbee7255da86dff59044c893e3a1f
2014-02-19 13:41:38 -08:00