This fixes a case where the RCD would display transport control
for a RemoteControlClient that didn't have audio focus.
This was happening because registering an RCD was directly calling
the updateRemoteControlDisplay method, without first calling
the checkUpdateRemoteControlDisplay method which verifies the
conditions before updating the display. One of those conditions
is that the audio focus stack shouldn't be empty.
To verify this fix, several functions were also rename to clearly
indicate the lock order and verify we properly synchronize on
the right objects. In doing so, a missing synchronization on
audio focus was found.
Change-Id: If1baaac224ea676aeb83ac0aefcc53f87461c32e
A precondition for updateRemoteControlDisplay_syncRcs() is that
mRCStack is not null. This condition was not verified when
registering a RemoteControlDisplay.
Change-Id: I0b152410e57c590114b387e9ab83f0c4d15d060d
Previously, silent mode was entered if volume was already at 0 and
volume down key was pressed once.
The new volume management policy specifies that silent mode is entered when
volume is at last audible step and volume down key is pressed once.
Change-Id: Id3e75a99c522d8afe276868010b6e73495d23fde
Update to the RemoteControlClient.Editor API:
- new method for setting metadata of type long
- methods for setting metadata throw an exception if using
the wrong key with the wrong method.
Note that this change will cause the Music2 application to
throw an exception when it tries to set the duration as a string.
Change-Id: I17cff86467851a0aff313c07653e752ae6b6180f
When an IRemoteControlDisplay registers, cause the
RemoteControlClient to send all its information to the newly
registered display.
The previous code was only sending a request for update: this
request didn't here cause the client to send the data because
a new client generation had not been synchronized among clients
and displays.
This CL uses the same code path to force an update as when audio
focus changes, or a new client registers, by calling the same
method that is called in those cases,
updateRemoteControlDisplay_syncRcs(flags).
Also in this CL: more method renames to indicate methods that
are called synchronized on mRCStack.
Change-Id: I54102f45ba1cd4812d958ecd883bec7bc45ae88f
* changes:
MediaDump: use the MediaPlayer#setSurface method
HTML5VideoView: switch to MediaPlayer#setSurface
MediaPlayer: unhide the setSurface method
Surface: unhide the SurfaceTexture ctor
Video Editor engine wrongly set the profile in place of level.
So level was always 1 (default value for Profile)
Change-Id: I202f866d32e81869d9692174d59d9d777a772282
Cannot trust references to IRemoteControlDisplay to remain the
same when removing a RemoteControlDisplay, compare the
result of .asBinder() instead.
Change-Id: Ib2e82aa24bd4b12804bccff94a6a0090ff83bea8
The RemoteControlClient / Display feature only supports one
display. If multiple displays are registered, this CL implements
the following policy:
- cannot unregister a display that is not the current one,
- registering a display when another is already registered
causes the old one to be unregistered.
This fixes a death handler leak where the previous display was
simply overwritten, without unlinking to its death.
Change-Id: I63f8a38093796e0960761936d7fc58d47b7589b3
If a RemoteControlClient has a null artwork, do no attempt to
rescale the bitmap, it's ok to send a null bitmap to the
IRemoteControlDisplay.
Change-Id: I8332ccfcf18107ea0b41d4e7fa232d7f68798efc
Locks related to audio focus and remote control should always be
taken in the following order:
1/ audio focus lock
2/ remote control stack
3/ current remote control client generation
Change-Id: If8be11bfef92849957e692b2bd52adbd67a2ef0b
When the client gets cleared, let the display know the new
client generation ID is for a clear.
When a new client becomes current, let the display know
what the associated media button event receiver is.
Change-Id: I18e37a309b5b30ed361a68918379b60418409f1e
When metadata gets applied, optimize the artwork and metadata
update by doing it in a single call.
Add missing RemoteControlDisplay-related methods in AudioManager.
Change-Id: I97aa802cc480327bee5592ea8dfdbd414c0f037a
A MetadataEditor contains all the metadata and artwork to be applied
to a RemoteControlClient.
A MetadataEditor can only be applied once.
Change-Id: I3ce9d97f520cd9ab009fb1a92a2b399717511bd8
Remote control displays expose an IRemoteControlDisplay interface
which they register through AudioManager.
Remote control clients create a RemoteControlClient object, which
implicitely exposes an IRemoteControlClient interface registered
in AudioService through AudioManager.
AudioService tells all clients and displays when a new client
is the one that should be displayed.
A client's data gets sent to the display when it is valid, or
it sets new data (while being valid).
The implementation for setting metadata and album art is temporary,
and will migrate to the MetadataEditor API in future CLs.
Change-Id: Ibab6ea1d94c68f32482c760c6ae269541f885548
Define a RemoteControlClient interface that applications must
implement and register to be displayed on the lockscreen.
Change-Id: I67276ae653f203e76727432231f1d76535c31942
Previously, silent mode was entered if volume was already at 0 and
volume down key was pressed once.
The new volume management policy specifies that silent mode is entered when
volume is at last audible step and volume down key is pressed once.
Pressing volume down key continuously will decrease volume until
last audible step is reached, not 0.
Change-Id: Ib7b530668473d6a5af1e748f445d6185afed2158
Clear AudioManager.FLAG_PLAY_SOUND in AudioService adjustSuggestedStreamVolume()
if keyguard is locked.
Change-Id: I2effb9cab8d946845e948b28899b17d7f24c1282
When notifying the remote controls of an update, also pass the
associated media button event receiver.
Change-Id: I9125378653ce21e3bd672b936df638c0c6154edb
The possibility for applications to apply insert audio effects
(Equalizer, BassBoost, Virtualizer) on global output mix has brought up
a number of issue.
This change updates the java doc for audio effects indicating that
application should not apply insert effects globaly anymore as this behavior
will soon be deprecated.
The audio framework will still allow global insert effects during an interim
period but will give the priority to effects inserted on particular player by
disabling global effects when both are present.
============
Change-Id: If87f1944a0409d45d8d2eee66ff331f95965ca89
When requesting audio focus and linkToDeath() threw a
RemoteException, AudioService was only logging a warning, and
was still changing the focus, with a non-null death handler.
The change first check that linkToDeath() didn't fail, and only
then proceeds to change the focus (dispatch focus change
notification, updates the focus stack, and updates the remote
controls).
Change-Id: I0b96dd3c6e924d93f419880349d49f8b360b110b
Need to call unlinkToDeath() for the object to be garbage collected.
Save the object in the FocusStackEntry, unlink to death when we remove it from the stack.
See http://b/issue?id=5048400
Change-Id: I84c5ba46017d0a8744b5e7509a7c7a5c8dd918fb
author: olivier@google.com
AudioManager.isWiredHeadsetOn() should not require permission MODIFY_AUDIO_SETTINGS.
Remove permission checks on all getters in audio policy manager as permission enforcement
is really usefull for setters.
Also deprecate AudioManager.isWiredHeadsetOn() which name and implementation are deceptive.
Change-Id: I38f8df7c26c0d417bf0e2b74e4c11c2d143f2ecd