History log of /frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
065bb144198ea18653f836ec591ead4afe907f97 28-Mar-2017 Hyundo Moon <hdmoon@google.com> Merge "MediaRouter: Do not use remote volume handling for BT routes" into nyc-support-25.4-dev
am: 684092232c

Change-Id: If8904c21a106179cc474e89be30cf790efa2e383
7e7e4aba6bfe8841ccda7e2e0bec7e9147dc547a 27-Mar-2017 Hyundo Moon <hdmoon@google.com> MediaRouter: Do not use remote volume handling for BT routes

Although a BT route is not a remote route, MediaRouter calls
MediaSessionCompat.setPlaybackToRemote() whenever a BT route is
selected. As a result, the volume dialog in system UI shows two volume
sliders for the one BT route, which is weird. This CL fixes the problem
by not using remote volume handling for BT routes.

Bug: 34919351
Test: Checked the volume UI with Support7Demos in API 19-25 and
Android O.
Change-Id: Ie92e75ba6625c770814adf051592e58323b60466
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
abc73958d264e1eed7fd401a18be1d9ede8304eb 06-Mar-2017 Aurimas Liutikas <aurimas@google.com> A pass at fixing unchecked javac warnings.

Add types where needed.
Suppress places where we intentionally skip types.

Test: ./gradlew assemble still works
Change-Id: If1350e896948c7e27c212cf7b1a94f08b9131193
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
cc0cb8d62143a398a1103411552a62dae22fc133 09-Feb-2017 Jae Seo <jaeseo@google.com> Revert "MediaRouter: Synchronize route selecting information"

This reverts commit c0b44f78f248e321d913db6077bf9a55976d7319.

Bug: 35198037
Test: build & manual
Change-Id: I51fd83933801eb0012be37016e80a82935412328
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
f5a0b18193b8ea1c759618987b3b34d75c3e0e8a 06-Feb-2017 Alan Viverette <alanv@google.com> Merge "Fix @links in support docs." into nyc-support-25.1-dev
6adc8ba4e18a8b97b0c6719975d7259f7a2500fe 02-Feb-2017 Sungsoo <sungsoo@google.com> MediaRouter: Fix syncSystemRoutes behavior

- Use a different approach to check whether the audio is routed to
bluetooth or not.
- Do not select other routes instead of the bluetooth route and
the default route.
- Uses isSystemLiveAudioOnlyRoute instead of isSystemBluetoothRoute.

Bug: 33791300, Bug: 34645668
Test: Manual with Support7Demos
Change-Id: Id2f798c33b4cef687e930cc990db42f6f351700b
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
377357a8c26c8c54ba8cb876ae775265635a8448 24-Jan-2017 Elliot Waite <elliotwaite@google.com> Fix @links in support docs.

Change-Id: I7acb3d14dee5227ac4d87710453f018c9d0f1b9d
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
1cc48d3ec09b9afc44ba18910e0e6f59818388d7 19-Jan-2017 Donghyun Cho <donghyun@google.com> Reuse a given MediaSessionCompat instead of creating another one

When MediaSessionCompat is set to MediaRouter, previous implementation
tries to extract the framework's MediaSession from it and recreate
another instance of MediaSessionCompat. This approach is not only
redundant but likely to override a previously set callback of
MediaSession. This change will just reuse the given MediaSessionCompat.

Bug: 34251045
Test: Tested with the music app and verified the playback control works.
Change-Id: I0b215c4396e70f5b70124ceb5752dd250cd66de5
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
8e10080c914d1ad0784394fa3026b85535535847 18-Nov-2016 Aurimas Liutikas <aurimas@google.com> Move from GROUP_ID to LIBRARY_GROUP annotations

- GROUP_ID was deprecated in favor of LIBRARY_GROUP.
- Fix import order in touched files.

Test: ./gradlew assemble assembleAndroidTest
Change-Id: I2a774e93215090f42262fb86cf8e841f2a546a4f
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
82dce5d15b58c3935c8b8bc89e869a0f83766625 26-Oct-2016 Sungsoo Lim <sungsoo@google.com> Merge "MediaRouter: Synchronize route selecting information"
c0b44f78f248e321d913db6077bf9a55976d7319 07-Oct-2016 Sungsoo <sungsoo@google.com> MediaRouter: Synchronize route selecting information

If the selected route of an application was a system media route such
as the device speaker, a wired headset, or a bluetooth speaker, and
the selected route is changed by other processes, no callback could
be called in API 24 and before, and once it happens, getSelectedRoute()
could return a wrong value and selectRoute() could be no-op.

This CL ensures that getSelectedRoute() always returns the currently
selected route and selectRoute() works.

Bug: 31921702
Test: Support7Demos on API 24
Change-Id: I0edcbe4d9f2fe42e0fc6ba78802320eaa24fe24d
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
2573ecb4fff9a354dd8fe973bf1c0d5494f83ca3 12-Oct-2016 Sungsoo Lim <sungsoo@google.com> MediaRouter: Add some util methods

MediaRouter.getBluetoothRoute(), RouteInfo.isBluetooth() and
RouteInfo.isDeviceSpeaker() are added.

Bug: 31845348
Test: Support7Demos
Change-Id: I0a4f6d44452456c321b0a31484dd0a23f194b451
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
d38d8790c68d4d82a278d42e7f2a1382d005c637 26-Sep-2016 Sungsoo <sungsoo@google.com> MediaRouter: Make getSelectedRoute return the recent infomation

Bug: 28517884, Bug: 31398128
Test: Checked with Support7Demos app
Change-Id: I4c7667866f13e551913b84809a622e3963ba9b9b
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
c39d9c75590eca86a5e7e32a8824ba04a0d42e9b 25-Aug-2016 Alan Viverette <alanv@google.com> Add @RestrictTo(GROUP_ID) annotations to match @hide docs annotations

Also removes some unnecessary @hide annotations on classes that wouldn't
have shown up in docs anyway due to package/private visibility or NO_DOCS.

Bug: 27937193
Change-Id: Iab127a5a3ce57a2d61965d3cef782621eb3859f5
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
e2c6a94b6e4aab502f9b88dd3ff664bd90b25839 25-Aug-2016 Aurimas Liutikas <aurimas@google.com> Remove all the extra accessor methods added by javac in support-mediarouter.

Change private methods to be package protected to avoid extra methods
that get added to be able to access them from inner classes.

This CL saves 143 methods in our jar.

Bug: 31075707
Change-Id: Iddd66c7f04ae9522792a889a59b3ae7629b2983c
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
dea052cbd7d523a47ce8fff8b4f2fd0c39b132c6 06-Jul-2016 Hyundo Moon <hdmoon@google.com> Replace obtain() methods in MediaSessionCompat

The obtain() methods covert a framework object to a
compat object, but fromXXX() methods do the same thing.
For consistency, this CL replaces the obtain() methods
with the fromMediaSession() / fromQueueItem().

Bug: 29980113
Change-Id: I262a001e546c2c74a127e79da7f104f487c1ab33
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
f29704c9e02cb42d33f8329def3d494b5230a53b 29-Jun-2016 Sungsoo Lim <sungsoo@google.com> MediaRouter: Provide the route group id when update a selected route

Bug: 29194434
Change-Id: I1c6a606f8050a06c0f7f5fa0a2a1dc97b1ba068d
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
2f829125aef3796ca674d0ca5fccf9bd37b8417b 11-Jun-2016 Sungsoo Lim <sungsoo@google.com> MediaRouter: Overload onCreateRouteController for route groups

onCreateRouteController is called when a route is selected. This
CL overloads the method with an additional parameter, routeGroupId.
The overloaded method will be called when the route is selected by
selecting a route group where the route is a member of the route
group.

Bug: 29194434
Change-Id: I6582a7bc6f18119578a60ad67d4be865a965dace
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
b65ed0711d50e0cf71df299e61725dc5699c52a3 10-Jun-2016 Jae Seo <jaeseo@google.com> MediaRouter: Select/unselect route controllers for the updated route group

Needed to support dynamically added/removed media routes.

Bug: 29193043
Change-Id: Ib50e8219ca168d9cb4c3ef31f14472647610f0d1
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
fa19abbe11335366feb6c885f8d75504ab8fe4f9 07-Apr-2016 Insun Kang <insun@google.com> Remove bluetooth route from MediaRouteChooserDialog

Bug: 27229583
Change-Id: If63c9cc0422e10e6719705dd32c70d70d50b0644
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
beaaa68430d0ad0fcf686e5d4694536f61ee79c1 04-Apr-2016 Jae Seo <jaeseo@google.com> Choose a fallback route when the current route is unselected

Bug: 26421039, Bug: 20533472, Bug: 25111343
Change-Id: I0a4190ac68210c61994b141d742c0bd4d48b07c4
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
3cb412fab95f51525d1e777e5ae6d12021bb2c93 28-Jan-2016 Donghyun Cho <donghyun@google.com> MediaRouter: Pass an unselect reason to members of a route group

When route controllers of group member routes exist, they will be called
without any reason. In this case, an unselect reason should also
be passed to route controllers of member routes like other general routes.

Change-Id: Id418f56834bd3571fadec9fd9a0b69347354eb97
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
34f02b24b3bc24d10b509c41ba221cc7a3205d12 25-Jan-2016 Donghyun Cho <donghyun@google.com> MediaRouter: Pass a reason when a route has been unselected

When a route has been unselected, pass an additional parameter to the
onRouteUnselected callback method for explaining why the route has been
unselected.

Bug: 24316015
Change-Id: I5a99487ea6cd89fc85b07107a00c22439b6e671d
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
cc16fc04c849fc0068fb1b033917ebd4d6db31f2 10-Dec-2015 Insun Kang <insun@google.com> MediaRouter: Minor change to keep consistency with framework MR.

It changes the constant value of DEVICE_TYPE_BLUETOOTH to the same value
with framework's MR for consistency.

Change-Id: Ib19bba5258632038c17716066c40a39341d80c15
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
eb51f617d95c9a88a6ba528b1ad756f7bb7e7640 09-Nov-2015 Jae Seo <jaeseo@google.com> MediaRouter: Loosen up the condition to show the play control layout

This partly reverts ag/802026.

Bug: 25595250, Bug: 24888113
Change-Id: I887c96c37c0d0d5e9f18d57cf071323dfc88bf40
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
14a7007aaefb96b3b6fb06171aa10e1200116d6a 11-Oct-2015 Jae Seo <jaeseo@google.com> MediaRouter: Hide the group API per request

Bug: 24831500
Change-Id: I523012153a3bfe2c752f94a73d2425a100335816
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
050b7ec33bd9a2fe493f0b0b85d49ed213046219 16-Sep-2015 Jae Seo <jaeseo@google.com> MediaRouter: Publish new APIs

Bug: 23115937
Change-Id: If9e61710c5cc1d078240f89772e7a40f3c0013cc
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
893feff5ea67f24af45af6dc9d6d09640ea66b86 28-Aug-2015 Jae Seo <jaeseo@google.com> MediaRouter: Add an API to set the receiver device type of the route

Used to determine the default icon of a given route when a custom icon
is not specified.

Bug: 23116379
Change-Id: I1188c10b679e4693ae1aab9ced0f842d4fc80881
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
77367b4a1871417198d0399d9ad074314c758567 02-Sep-2015 Jae Seo <jaeseo@google.com> MediaRouter: Show "Casting screen" if the app is being mirrored

Bug: 23724473
Change-Id: Ia01981aa5b8062c0469d1992fef8468c0783cd3e
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
1bb3dfe1c70801c1981406e93b9ca624a11dcb3b 30-Aug-2015 Jae Seo <jaeseo@google.com> MediaRouter: Rename group API

Use the term "group member" explicitly instead of "child" to denote
group membership

Change-Id: I04c0f09327289c17c23c8ab6bc5d9d16b22bc60e
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
bc171eedb6cbadf07b5a1f173a9e9efbd554e066 28-Aug-2015 Dongwon Kang <dwkang@google.com> MediaRouter: make volume control on child routes work

Bug: 23118003
Change-Id: Ib1ce2fb2b7a5eee5a835b717b0d679837e2dbf88
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
480052774a9fb375d68b7a0373a5bd8d733f8dc0 26-Aug-2015 Jae Seo <jaeseo@google.com> MediaRouter: Disable volume slider for fixed volume devices

Bug: 23117862
Change-Id: I4e18777cb5051391cde005a04030075fbcf7a686
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
6051d8374c90da4826698b66ed7cb13ebc2c65bf 25-Aug-2015 Jae Seo <jaeseo@google.com> MediaRouter: Enable volume group expansion

Bug: 23115937
Change-Id: I97f14d0d74b20723406068caa652d6afe1fcaf74
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
38e4efe885198f63fb26b73d79d4636263ba6a5c 25-Aug-2015 Jae Seo <jaeseo@google.com> MediaRouter: Find group members by unique ID when building group info

Bug: 23117755, Bug: 23118003
Change-Id: I577cccdce5411ed8c917f1c6545d6b0fb21e07a0
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
119de6bb3353341cfd465cea9e545abec3762d20 24-Aug-2015 Jae Seo <jaeseo@google.com> MediaRouter: Enable custom icons for media routes

The route chooser dialog now displays custom icons for media routes if
they are provided. Otherwise, it shows the default icons.

Also added API to allow route providers to set custom icons for their
routes.

Bug: 23116379
Change-Id: Ia785d7cd5cd3bdb472d058e25aba55f4e8f042ab
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
3766e1d92193a98f65a12b18a43bbb3f6508a25f 23-Aug-2015 Jae Seo <jaeseo@google.com> MediaRouter: Add route connection state

Defined the route connection states and added getConnectionState() that
replaces the existing isConnecting(). The route chooser dialog now
displays the descriptions of the routes only when they are connected.

Bug: 23117152
Change-Id: I7acfc9fae995f066c80b7f71ff21f18cc165f465
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
e7a694bf5fc4bf417502509a8604fffc7a41d84c 18-Aug-2015 Jae Seo <jaeseo@google.com> MediaRouter: Add RouteGroup

Bug: 23117755, Bug: 23118003
Change-Id: If2ca6c648fde5cf72271f02ed7a40db8331b9f9a
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
14b631fc79b2fc69f392ab8d2f096b0e86b9bea2 12-Aug-2015 Jae Seo <jaeseo@google.com> Put system live audio only routes at bottom of MediaRouteChooserDialog

We don't yet have a way to tell whether a given media route includes a
bluetooth endpoint. This code change tries to make the best guess based
on the currently available route information only. Future work, possibly
API changes might be required to make route sorting more accurate.

Bug: 23116377
Change-Id: Iad2b3fd8ef7f650b96ca94d6686c7dd0e12ae661
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
f0e4dea75691d2fd1256508136ecce88bef6067b 20-Jul-2015 Ian Lake <ilake@google.com> Annotate Media section of Support Library

Use @IntDef and StringDef Support Annotations where appropriate
to ensure that IDEs can autocomplete to the correct set of constants

BUG: 22588432
Change-Id: I540a19c3df3637ba5c7a0f4ce3b1994d8f00d1d2
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
d81fed9a46023f2ec728a20fd130480bd5c90f73 12-May-2015 Ian Lake <ilake@google.com> Ensure MediaRouter.setMediaSessionCompat(null) does not crash

While MediaRouter.setMediaSession() works with a null MediaSession,
the Compat version failed on all API14+ devices with a
NullPointerException. Ensure that passing in a null
MediaSessionCompat is handled correctly - removing any existing
RemoteControlClient (on API14-20 devices) and passing onto
setMediaSession() on API21+ devices.

BUG: 21035180
Change-Id: Ie5e11ca043fc4b6ce072eede7ba202985e28f0cb
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
f9ea1ad16cec2b123cb01426a9526ebf8a460d1b 15-Jan-2015 RoboErik <epastern@google.com> Clear volume handling when disconnecting from a remote route

This will set the MediaSession's volume handling back to local playback
when disconnecting from a route in MediaRouter.

bug:18806654
Change-Id: I21d0d53e7786034b71bd2ef1718e61acbab181e2
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
e49860b0f76d8336c1d41831ed370b0ff94278ef 04-Dec-2014 RoboErik <epastern@google.com> Make MediaSessionCompat/MediaControllerCompat work pre 21

This adds support for cross-process communication between MediaSessionCompat
and MediaControllerCompat. This is to support apps that split their playback
service and ui into different processes and to work with the MediaRouter
support lib.

bug:18186638
Change-Id: Ib554108fd4db5a9855d482cf3d61ce3d8d9c8850
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
5c9469e010106467791b47b0fa83efda84491a21 25-Nov-2014 RoboErik <epastern@google.com> Add backwards compatibility to MediaSessionCompat

Make MediaSessionCompat backwards compatible using RCC on APIs 14-20
and MediaSession on 21+. Verified on API 16.

bug:18186638
Change-Id: I7cca9d85d4377a69366d69c0fa59b9739cd51233
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
b6362d072f329a3207aa709ac6b79a4aa3c4d522 26-Nov-2014 Ying Wang <wangying@google.com> Fix docs.

Change-Id: Iba38cc5b58c1dcf4cac5a0981f281461e684b881
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
ceb8bf5e5cce7a37736981e626c4be416378767b 21-Nov-2014 RoboErik <epastern@google.com> Finish stubbing out MediaSessionCompat

This adds all the methods in MediaSession to MediaSessionCompat and
the code to pass it through to the framework version when available.

This does not add support for pre-L.

bug:18186638
Change-Id: Icfc80df088db87b6eff629edbc08b4107fbe2821
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
94be6100218126ce6a08bf1f56209578500b361f 28-Oct-2014 RoboErik <epastern@google.com> Update the support lib MediaRouter dialogs

This updates the UI for MediaRouter dialogs to use the new material
designs for MediaRouter. This doesn't update everything and new
icons are still needed.

Change-Id: I87c7c63c10ac60448251a8fc1fc4740a12f1603c
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
a9b9eae2cf9c9ef87c94c6a09a8664d30d60d7e4 28-Oct-2014 RoboErik <epastern@google.com> Post volume updates to the callback thread in MediaRouter

This ensures all volume requests are handled on the callback's
thread (which must be the main thread).

bug:18156755
Change-Id: Icdfa1c43a27fbbc449d4773c9a9803dd47bd0839
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
bbcdf78e350d58ecd6baa75e282d4908d3129fe2 09-Sep-2014 RoboErik <epastern@google.com> Add MediaSession support to MediaRouter support lib

Adds a method for setting a MediaSession on MediaRouter that can be
used for volume controls.

bug:17427963
Change-Id: Idc4856373ab9b44500c6fa223236393d166ecbf0
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
fb81e09002d1d611168b204fc50d259fc15f27b2 06-Aug-2014 Jeff Brown <jeffbrown@google.com> Disable passive discovery on low-RAM devices.

On low-RAM devices, passive discovery has a significant impact on
system performance because it causes many media route provider services
to be started and kept running for as long as the application requests
discovery (usually the whole time it is in the foreground).

To mitigate this issue, the CALLBACK_FLAG_REQUEST_DISCOVERY flag is
now ignored on low-RAM devices. Also, isRouteAvailable may return
true in cases where it is possible for a route to be discovered
even if one hasn't been found yet. These two changes have the effect
of causing the MediaRouteButton to always be shown on low-RAM
devices. When the user clicks on this button, active discovery will be
performed as usual.

Added CALLBACK_FLAG_FORCE_DISCOVERY and AVAILABILITY_FLAG_REQUIRE_MATCH
to allow an application to request the old behavior if necessary.
Also added a bunch of docs to explain why applications really shouldn't
do that.

Bug: 15191337
Change-Id: I4d742ea4569c977eb9b89277c57a72ec3a4fce41
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
429c3b17b88ebd8c4512e9179fd9d48333c0979e 21-Mar-2014 Tor Norbye <tnorbye@google.com> Add tools metadata annotations to the mediarouter library

Change-Id: I69322fb994a840b7142109ca48c29fb51829a2dd
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
adf0f4a217e14894af07dfa9f46cad7d98b8a7f4 07-Nov-2013 Jeff Brown <jeffbrown@google.com> Use the full component name to construct route ids.

Provide better disambiguation when a package contains multiple
route providers by using the full component name in the route id.

Also fix a bug handling package updates.

Bug: 11257292
Change-Id: Ice4fee742d73e2e979f2059b89cc4f4d971e0947
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
3efa63d3b896244713e84acbb5945562dce41d77 05-Nov-2013 Jeff Brown <jeffbrown@google.com> Minor code cleanup to enable reuse of the protocol.

Extract the protocol constants into another class.
Add a callback interface for the watcher.
Minor doc tweaks.

Bug: 11257292
Change-Id: I74b5ecee0d287d6b892ccb56e7777762bbce30de
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
a97f1edf7624785c41ec0bfec6fd12c2388d9234 24-Sep-2013 Jeff Brown <jeffbrown@google.com> Add a helper for managing remote playback.

The RemotePlaybackClient class helps take care of identifying
remote playback capabilities, formatting requests, parsing results,
and managing sessions. The goal is to remove confusion around the
usage of the protocol by providing a more familiar API surface
to work with.

Bug: 10260186
Change-Id: I49a6dcfa30ff8b7a57655a39a43317ebb3add2a0
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
567dbb1c7f8a0cb3c4340ad607b6d833fc1b2270 08-Aug-2013 Jeff Brown <jeffbrown@google.com> Add support for attaching RemoteControlClient to MediaRouter.

This change will enable remote volume control from the lock screen
when the application creates a remote control client and attaches
it to the media router.

Simplified some of the route selection / unselection logic.

Change-Id: Ibb2a81851afd993b7e5e9d6796c740605399ceb7
(cherry picked from commit 63c7f1e85ac4c6c0af616c241aaa98151f1707d7)
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
35af7c925d660508fe0892f38eec99a3845630e4 31-Jul-2013 Chong Zhang <chz@google.com> Support library workaround: switch to bluetooth route if available

Bug: 10003524
Change-Id: I55c2da39ac312265b3a8bcc118d54057d3808f13
(cherry picked from commit 014127a0e1841120ee0968831d40728a80f16b00)
(cherry picked from commit a0db5749e35878f8372929c942d905c464ec1d43)
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
cb63b6ecac9786891514f241dec71695f09d3efb 01-Jun-2013 Jeff Brown <jeffbrown@google.com> Add unique id to routes.

Route unique ids are stable identifiers that applications can use
for various purposes such as remembering route selections or
communicating with services.

Bug: 9210033
Change-Id: I4519f6f639346b8981f02fb870e64becca291b4c
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
d11aa1784335270b8d85e385f2c8be79ee6a586c 31-May-2013 Jeff Brown <jeffbrown@google.com> Remove isActiveScanRequired().

This flag was originally added to support media route providers
that are unable to discover media routes passively. However, this
would be true in practice for most media route providers since
they will usually need to poll the network periodically to find
new routes.

Previously we did not have a good way to tell when discovery was
really needed so we forced these providers to rely on active scans
instead. Unfortunately this meant that the MediaRouterButton needed
to be visible all of the time.

Now that we have CALLBACK_FLAG_REQUEST_DISCOVERY, we can be more
conservative about when discovery occurs. In practice, discovery
will only happen when an application that uses media router is in
the foreground. So it's ok for providers to do some moderate work
during normal discovery and we don't need to force them to rely
exclusively on active scans anymore.

We also remove getDiscoverableControlFilters() since it was only
needed for the case where active scans were required.

Note that we still do perform active scans when the chooser dialog
is open. However, we don't allow providers to require them.
This even works for Wifi Display because the system already knows
which displays have been paired so it doesn't require active scans
to decide whether to advertise those routes (although it does
require active scans to discover whether they are really available).

Bug: 9210033
Change-Id: I69adaf42fb461ee2b564e3605f921d23b6b5c7be
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
f03da4a9e6cc02251c2f804eb6f25da61821d6a7 31-May-2013 Jeff Brown <jeffbrown@google.com> Add CALLBACK_FLAG_REQUEST_DISCOVERY.

This change is designed to reduce the network discovery overhead
and memory footprint of the media router.

Make the media router more conservative about when it binds to
media route providers and performs discovery. It will now
only perform discovery if the application has specified
CALLBACK_FLAG_REQUEST_DISCOVERY or CALLBACK_FLAG_PERFORM_ACTIVE_SCAN.
Furthermore, it will only bind to media route provider services
while discovery is requested or while the app has selected
a route that belongs to the provider. It will automatically
unbind when these conditions no longer hold true to allow the
system to reclaim memory used by the MRP service process.

Added a MediaRouteDiscoveryFragment to make it a bit easier to
manage the lifecycle of media router callbacks.

Bug: 9210033
Change-Id: I9e7399022d51eb6db3ac79f843ccfa5aba3a8762
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
9fcedc160282e6620f409ea46bf6728b35d011dd 30-May-2013 Jeff Brown <jeffbrown@google.com> Fix MediaRouter leaks.

There was a cyclic reference from the value of a WeakHashMap
to its key which resulted in MediaRouter instances and associated
Contexts being leaked. Fixed this by avoiding the cycle but
there is now a little more burden on the application to ensure
that it holds a reference to the MediaRouter instance as long
as it is required.

If we wanted to make the support library MediaRouter behave more
like an object returned by Context.getSystemService() then we
would have to arrange for the Context to hold a strong reference
to the MediaRouter to keep it alive but there isn't any good API
to accomplish this.

Bug: 9189100
Change-Id: I15b214ae9dbad3f08be04ec852b07cc61a00886e
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
9942d40d0d952b03b583fe66f434676793697aa2 24-May-2013 Jeff Brown <jeffbrown@google.com> MediaRouter UI tweaks.

Fix an issue where the MediaRouteButton would cause the currently
selected route to be deselected when switching activities.
The button now no longer has any side-effects.

Added code to handle the case where the dialog may be empty
by showing a progress bar and placeholder text.

Make the route chooser and controller dialogs dark to match
the system volume dialog.

Fixed the dividers in the route controller dialog.

Fixed some incorrect assumptions in the MediaRouteActionProvider
related to whether the MediaRouteButton has been attached to
the window. Sometimes we would fail to add the necessary
route callbacks. This was intended to workaround a framework
limitation but it caused other problems.

Fixed the padding of the media route button.

Cleaned up some documentation.

Bug: 9102538
Change-Id: I226e33c3017e8e4a9d877d023a8f158184861343
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
3d4c9459ed77f732dd3ba602713af6ebf9280c8c 21-May-2013 Jeff Brown <jeffbrown@google.com> Streamline media router API.

Merge progress and status and remove ACTION_GET_PROGRESS.

Add a new MediaItemStatus object to ensure that apps package the
status information correctly into the Bundle and to remove
possible ambiguity about the interpretation of each field.

Add EXTRA_ITEM_STATUS as a standard output result from
most requests include ACTION_PLAY, ACTION_PAUSE, etc.

Add a timestamp to the status object.

Add a mechanism for returning an error string from failed
media control requests.

Add a unique prefix to all mediarouter library resources
to make conflicts with application resources less likely.

Bug: 8175766
Change-Id: Ifca759424125ca62e8a72d35068dd3cc045d21ad
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
2ef36d857302c5cd738c7c8bdec53d31feebebba 16-May-2013 Jeff Brown <jeffbrown@google.com> MediaRouter UI tweaks.

Fix a couple of styling issues.
Fix an NPE when a provider is removed.

Bug: 8175766
Change-Id: I109bc93e94d4a05924ae01189911d2418660d0f3
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
d63957d28aaabcec588b8cde12eac16414783aeb 16-May-2013 Jeff Brown <jeffbrown@google.com> Replace route status with route description.

Bug: 8175766
Change-Id: I694e3d78cd6a80ecb277b5d950b52d9401a8736c
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
55b361aea868e53e848bc45af3a55ae43e7871c3 16-May-2013 Jeff Brown <jeffbrown@google.com> Remove route icons from the API and the UI.

Bug: 8175766
Change-Id: Ic376cb99455fff1e48aa7d3243365aa7cb94659b
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
11417b1cfde8f1749905f2d735623af9214148af 27-Apr-2013 Jeff Brown <jeffbrown@google.com> Add media router picker UI.

Introduced the concept of a MediaRouteSelector which is the means
by which an application states the route capabilities of routes
that it would like to discover.

Added selectors to the addCallback method along with several
other methods to assist with discovery. Callbacks can specify
flags to perform active scans of routes or to disable filtering
of route events.

Added a workaround to scan for wifi displays on JB MR1.

Refactored the route descriptor objects to use the builder pattern
instead of simply documenting that they should be immutable
since several developers have already tripped over this.

The UI is feature complete but not final.

Bug: 8175766
Change-Id: I54ebb7488222746b0c07292e65b9ded1b9d720fa
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
28520a15611522424b52cf88e4a2dbeb1a9be42b 26-Apr-2013 Jeff Brown <jeffbrown@google.com> Add a way for apps to hint at the types of routes they want.

Some route providers may need additional information about the kinds
of routes to be discovered. We define a concept of a Selector
to allow an application to specify these capabilities.
This concept is a bit new and not plumbed all the way through yet.
We will refine it as we build more of the UI bits on top.

Added APIs for starting active route scans.

Bug: 8175766
Change-Id: Ib2d2f7bd6cd0610edc8c1f68d879f386c340f682
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
43f79f79a5117550a7dfedf9c65124afd163ea43 12-Apr-2013 Jeff Brown <jeffbrown@google.com> Update media router API.

Use the nomenclature "media item" rather than "media stream"
to refer to playback requests to avoid confusion.

Add a STOP action.

Document that the status broadcasts should include the item id.

Bug: 8175766
Change-Id: Ideb5c674d48b4a5ba2cb276c19beaafda83900b5
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
129abf73ce9be1bc172b945263c7975ad1a3006f 23-Mar-2013 Jeff Brown <jeffbrown@google.com> Define some new media control intents.

Also rename the methods of RouteController to emphasize the
fact that they are intended to be overridden by the
implementation.

Add a concept of a stream id.

Change-Id: I84c55340914c7245dcf8ab66911adcb725aec10e
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
350ba6e4a1b5ec28721a098e50eaf6a508eb28f0 22-Mar-2013 Jeff Brown <jeffbrown@google.com> Fix a couple of minor bugs.

Handle case where a media provider service publishes a null
descriptor or does not publish one until after registration.

Handle case where a provider service chooses not to create
a provider and returns null from onCreateMediaRouteProvider.

Change-Id: If89a3d553a8fba0dca80c0b7ff93517eb2698d17
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java
b507e525a61ed761eecfc2eaaf19af7e8db5dca5 20-Mar-2013 Jeff Brown <jeffbrown@google.com> Move support library media router to v7 package.

Resolved some TODOs related to missing resources.

Bug: 8175766
Change-Id: I57632d0a961de58a5dd53e889b4fd39832b5fba0
/frameworks/support/v7/mediarouter/src/android/support/v7/media/MediaRouter.java