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
Come back to old versions of setBluetoothA2dpOn() and isBluetoothA2dpOn().
MediaRouter will call methods on IAudioService directly.
Change-Id: I18f0a3106bad78715ed11a6b7b4ec1d656cdae41
* Accept a Context when fetching the names of routes and
categories. This lets string resources resolve at time of access
with the correct configuration. The older versions remain available
that will use the static resources from the application. (There are
enough cases where applications will populate this from external
data that requiring it each time even when it was not initialized
from a resource doesn't seem reasonable.)
* Remove the ability for apps to programmatically select non-user
routes.
* Make MediaRouter.Callback an abstract class instead of an interface.
This will make further extensions easier to keep compatible in the
future.
Change-Id: If981c511dfbdfaf41ef0d1cfe4a377fc14bb5600
Add the dialog behavior for MediaRouteActionProvider/MediaRouteButton.
Still TODO:
* Switch audio icon based on source; speaker/bt/user
* Rig up volume slider
* Rig up item icons
* Rig up group button for groupable categories
* Make grouping work
Change-Id: I3f992516b184d5ae940ddb7bbb7f94ff58914589
Fix a bug where MediaRouter would crash on creation
Add click listener for app-supplied extended settings on the route
selection dialog.
Change-Id: I2991db1720b5c574148e250526984592f4dc3c44
Add RemoteControlClient to user routes. This will allow the UI layered
on top to access info about the remote volume channel associated with
a user route.
Add icons for user routes and route groups.
Change-Id: I438aa60fc8c93f878ec7638897225738155f0746
IAudioService.setBluetoothA2dpOn() should not be one way as
IAudioService.isBluetoothA2dpOn() will return inconsistent results
if called just after.
Bug 6572651.
Change-Id: Ib03ae49e6c0041b1b37dcac9e198cd93a4794030
Remove volume control and tracking. This will be handled by extensions
to existing audio and media APIs for now.
Tweak/refine other aspects of the API. Pass the router to callbacks for
easier future-proofing. Add group/ungroup callback methods.
Change-Id: Ib69e76e5f46280a9002b545bcf4cbc7b839844ee
Since the media scanner no longer uses an in memory cache, it always
found an entry for files inserted via MTP, which made it follow a
different code path than before, which in turn made the media
provider skip computing the display name column.
By clearing the row id in the media scanner when handling an mtp
request, we steer it back to the correct code path.
b/6297105
b/6525450
Change-Id: I624522b176a0057d246ce3040598af255b00a141
Messages for changes to A2DP connection state are intended to be
queued in AudioService after acquiring a wake lock, which is
released after the message has been handled.
This was correctly done for connection messages when the system
is up and running, but wasn't when the BluetoothProfile service
listener gets an onServiceConnected() event, which is the case
the the device boots.
This change correctly uses the queueMsgUnderWakeLock() method
whenever a MSG_SET_A2DP_CONNECTION_STATE is to be sent.
Bug 6616292
Change-Id: Ie337a4641a89c522e2d233bccaac4e08ce324117
Add action provider, button, and styles. Extend ActionProvider to
allow for getting references to MenuItem instances.
Implement toggle mode for the MediaRouteButton/ActionProvider. Dialog
selection yet to come.
Change-Id: Ibe3188570f503bbf8dd00cf154663435656a7171
Define two integers in the platform configuration to
define the sound level for lock/unlock sounds, and
UI sound effects.
Use the corresponding value in KeyguardViewMediator for the lock sounds.
Use the corresponding value in AudioService when playing sound effects.
Bug 6448481
Change-Id: Ie238f5eb1645e395412864d93447ac4049f7e54b
This is just the initial state tracking. Still to go is
actually triggering Bluetooth A2DP correctly and tracking
process state in the system server.
Change-Id: I33031d52799d6e2d7208910da833831085cc3677
Now that AudioService handles the device connection intents itself,
those need to be sent under wakelock.
The wake lock is acquired when AudioService is notified of the
device connection, and released when the corresponding message
has been handled.
This change only covers the device connection messages, and doesn't
affect the handling of the other AudioService messages.
Bug 6485897
Change-Id: I2d35f5404f097b5adde8af21fd81347bdd5576a6
AudioService is currently notified of wired headset and A2DP
sink connection states via broadcast intents from WiredAccessoryObserver
and BluetoothA2dpService. This is a problem as there is no guaranty that
AudioService can take actions upon the change before other apps are notified.
For instance, the Play On feature requires the UI to be refreshed when a device
is inserted/removed and we must guaranty that the UI component can read
new A2DP enable state from AudioManager after it receives a device connection state
change intent.
- Added hidden methods to AudioManager so that WiredAccessoryObserver
and BluetoothA2dpService can notify AudioService of device connection directly.
- The wired accessories connection intents are now sent by AudioService.
- The A2DP state change intent is delayed by BluetoothA2DPService when
ACTION_AUDIO_BECOMING_NOISY is sent by AudioService
- ACTION_AUDIO_BECOMING_NOISY intent is not sent when disconnecting A2DP
while a wired headset is present and vice versa.
Bug 6485897.
Change-Id: Ie160b3ee5f451132065530772b868593c90afd94
The allocated array has one byte less than the required length. Allocating the size one byte larger fixes the issue.
contribution was originally from teng.hong@nxp.com
Change-Id: I3aa2e6b995fd18e30649a34f201646082aab44ee
related-to-bug: 6347465
1. In shade code of Vignette and Fisheye, change from
pixel coordinates to texture coordinates to avoid overflow.
2. Fix bug in ColorTemperature shader code
3. Revise shader code pseudo random number generator (used by
BlackWhite, Grain, Lomo, Documentary filters) to ensure
it produces no artifacts among devices with different precisions.
Change-Id: Ifb67f12f114bc9cd7fbfa74f7782f130c5244e5d