RouteGroups always report back the loudest volume of their component
routes. Maintain this through volume update requests (such as those
reported by volume hard keys) such that each route updates
individually, but the group slider always indicates the loudest value.
Change-Id: I5de4b9048bf55682b6271e9485fe50496a1c97c2
Allow applications to set a requested volume level on RouteInfo
objects. If requested for a user route, the app-supplied callback will
be invoked to perform actual volume adjustment.
Change-Id: I856990a0da7292492aa15e6562dbc3d055b848a0
If the filter graph in an app closes out, the SurfaceTextureTarget
filter was losing the reference to the original surfacetexture, and the
app would re-start the graph without setting the surfacetexture again,
thus leading to a crash in registering a surface from surfacetexture.
Typical scenarios is start/stop immediately in camera effects recording.
Fix part of b/6651352
Fix part of b/6655597
Change-Id: Ib2bae7e886784e91b3a886f7ccd439ff190feb22
Remote playback information updates will be posted from the
application thread, and sent to AudioService. Because they
require locking the stack containing the remote playback
information, the update should happen on AudioService's handler
thread to avoid lock contention.
Change-Id: Ie04898295e08c16dd8ab5985fd825301e9cf1981
Extend MediaRouter.UserRouteInfo to enable setting playback
information, which includes volume. When the user route instance
has a RemoteControlClient, forward any playback information to it.
Enable specifying a callback to be notified of volume events
on the route.
Extend MediaRouter.RouteInfo to enable retrieving playback
information.
Update RemoteControlClient javadoc to reflect which parts of the
API are not intended to be made public.
Change-Id: I59d728eb61747af6c8c89d53f0faeb07940594c3
Remove bluetooth permission check from internal AudioService method
setBluetoothA2dpOn
Manage BT A2DP state in MediaRouter. A2DP is only enabled or disabled
when either the system built-in audio route or the A2DP audio route is
selected; when selecting any other route the current state is left
alone.
Change-Id: Ib14274e206e79bd8762edca1205ecfa87b7a94cf
Extend RemoteControlClient class to enable an applicaton to
specify more information about how it's playing media, now covering
usecases where media playback happens "remotely". This playback
information can be used to set the volume and maximum volume
used remotely.
Declare a new intent and associated extras in Intent,
ACTION_VOLUME_UPDATE, so an application can be notified that
the volume it handles should be updated. It can then use
the new RemoteControlClient.setPlaybackInformation() method
to notify AudioService what the volume is.
Extend AudioService to maintain playback information associated
with the RemoteControlClient information in the stack of
media button event receivers (mRCStack). The information
about the active remote is cached so the stack doesn't have
to be iterated over in order to retrieve remote playback info.
Events to "adjust" the remote volume based on hardware key
presses cause the client application to be notified of
volume updates, and the volume panel to display the volume
set by the app.
Revise which stream type is controlled when none is specified
according to latest guidelines for remote playback.
Update VolumePanel class to support a new pseudo stream type,
AudioService.STREAM_REMOTE_MUSIC, that corresponds to the
remote playback volume, and uses the new "media route" icon.
Enable it to receive asynchronously new volume values for
the remote that will be displayed if the UI is still up,
and ignored otherwise.
Now supports hiding/showing sliders dynamically so remote
volume only appears when AudioService has a remote control
client handling remote volume.
Define new java symbols for the two media route icons.
Modify lockscreen behavior: don't automatically control music
volume when music is active, consider also remote playback.
Still to do:
- playback information set by RemoteControlClient should post
a message for AudioService to update playback information
instead of updating it synchronously
Change-Id: I557aa687239f9acfe33a609f05876c67fa7eb967
MediaRouter dialogs now intercept the volume keys for altering the
current volume. The status icon indicates if the slider/buttons are
currently controlling the local device volume or a remote device's
volume.
Group volume for user routes is handled by using the
RemoteControlClient supplied by the first route in the group.
Change-Id: I40a0d054847ed5acce7a4c3b669487841b4dca15
Improve the API around ActionProvider visibility overriding. Allow the
application to notify whatever is hosting the ActionProvider that
visibility has changed in a way that is friendly to alternate support
library-style reimplementations of MenuItem.
Allow MediaRouter.Callback implementations to add or remove themselves
or other Callbacks during dispatch of callback events.
Make MediaRouteActionProvider track the visibility of corresponding
menu items more accurately.
Change-Id: Ic7ddb6a87c3637904750d2661e4a9fa323b09ea0
* Add ActionProvider#overridesItemVisibility and isVisible.
These methods allow an ActionProvider to override the
visibility of a MenuItem that it is bound to. If a MenuItem
has been explicitly hidden by the application, it will not
be visible.
* Change MediaRouteActionProvider to not require a MediaRouter
callback, to avoid extra lifecycle management headaches.
Change-Id: I606fa98b3a6a3e60a953dd024274f9bf9c67acdd
The AudioService now has an API to call to get the currently
connected devices, and later reports of changes in connection
state. The information includes the name of the bluetooth
device if one is connected for display to the user, and states
for all of the pluggable devices. No longer requires a Bluetooth
permission to keep the routes updated.
Change-Id: I81ca421c60592fbc1592477d59bf1c9d1b64954a