Make AudioPortEventHandler and audio port and patch caches
static members of AudioManager. There is only one callback
per process in AudioSystem for audio port updates
and having those non static would not work when more than
one AudioManager instance exists in one app.
Bug: 18727023.
Change-Id: I4c1041dc6441d168be4efa066e14289cc5f41872
Handle stream mute/unmute requests at the stream
alias level (like is done volume changes) to be consistent.
E.g a request to mute/unmute a stream will affect all streams
sharing the same alias for volume management.
Bug: 18844550.
Change-Id: Ie2e463c58df0371589150f0ebb9b36c38b14e1be
Dead lock sequence:
1. called onSetA2dpConnectionState()
1-1. synchronized(mConnectedDevices)
2. called onServiceDisconnected()
2-1. synchronized(mA2DPAvrcpLock)
3. waiting to lock(mConnectedDevices) in onServiceDisconnected()
4. waiting to lock(mA2DPAvrcpLock) in onSetA2dpConnectionState()
========================================================================================
- watchdog issue
----- pid 3306 at 2014-10-14 16:15:12 -----
Cmd line: system_server
"main" prio=5 tid=1 MONITOR
- waiting to lock <0x4343e9b0> (a java.util.HashMap) held by tid=46 (AudioService)
at android.bluetooth.BluetoothA2dp$2.onServiceDisconnected(BluetoothA2dp.java:529)
"AudioService" prio=5 tid=46 MONITOR
- waiting to lock <0x42ab7a58> (a java.lang.Object) held by tid=1 (main)
========================================================================================
Signed-off-by: Seunghwan Hong <seunghwan.hong@lge.com>
Change-Id: I99e061c07be01aabcd26786ef2ebb71f46717b93
When creating an AudioRecord instance, filter the tags in the
AudioAttributes to remove tags that are handled at the Java
layer.
Bug: 18733215
Bug: 18736417
Change-Id: I16a3497742086deced4e8677bd6231290396c5f6
MediaSessionLegacyHelper used a Context passed by an application
which can cause a leak of Activity instances. Use the global
Application context instead.
Also prevent crash if a null Context is supplied (method not
documented as requesting a non-null Context).
Bug 18767503
Change-Id: I8281047d0af233a323f3fc11ababedff848829ec
This makes sure that accessing the HdmiControlService via audio service
should be possible without the system permission.
Bug: 18730526
Change-Id: I05b364d8e38218eb75f3c08972a06bb2d71a982b
This is caught by Ringtone, and we then fall back to built-in
ringtone, which matches the expected CTS behavior.
Bug: 18610451
Change-Id: I234d17f7cf623b9b0af434e5d367aed28f203b14
Add new flag for an app to define it doesn't duck, but rather
pauses when losing focus with AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK.
This flag is to be used when requesting focus.
Add support for AudioPolicy to specify whether it will implement
ducking itself, rather than it being handled by an app.
When ducking is handled by a policy, do not notify focus owners
when they lose audio focus with LOSS_TRANSIENT_CAN_DUCK, unless
they would have paused, as expressed with the
AUDIOFOCUS_FLAG_PAUSES_ON_DUCKABLE_LOSS flag.
Add a focus listener for a policy to be notified of focus changes
so it can properly implement its own ducking.
Bug 16010554
Change-Id: I11d7cdb85c52fd086128a44f4d938aaa44db5c25
This sends mute keys to the MediaSessionService and handles them
by toggling the appropriate stream. Muting remote playback is still
not supported.
bug:17501993
Change-Id: I18c5b037cde2175acbb64b118dd708514acfd8c9
- allow Media.Image.setCropRect(null) to unset cropRect
- use full image if cropRect is null in MediaCodec$Image
Bug: 18124320
Change-Id: I7abb6175402a1fe913e16c0a682fabee79c55741
The MusicDemo was depending on the fact that setting the session token
is done synchronously and that getSessionToken can be called immediately
after. This makes setting the token synchronous again but leaves the
post to update any MediaBrowsers that are waiting on a connection.
This does introduce a small race condition if an app tries to set it
twice from different threads, but this is a very unlikely situation
and MediaBrowserService is not guaranteed to be thread safe.
bug:18603085
Change-Id: Id934c9f3b6520225cd92d1d8a6e2b3d606b8c6c8