New API to specify an accessbility service wants to force ducking
in its focus request, regardless of the framework's evaluation
of whether or not it should duck the other players.
Use of this API is restricted to requests coming from services
bound to the A11y service, or root
Bug: 62194333
Test: play a podcast in GPM and "adb shell claf --gain 3 --usage 11 --forceDuck"
Change-Id: I85f26afa14fe233a3b870f86c9084613203494b8
Add the name of the AudioManager class for the REQUEST constants.
Test: build framework
Bug: 63907030
Change-Id: Id79223a5376d4c75cc74fb471d35672b452d9fc9
When translating a focus request from the N- API to AudioFocusRequest,
do not do null checks for listener or handler, those are only
for the AudioFocusRequest.Builder.
Test: use app built for N- and request focus, no crash
Bug 37855238
Change-Id: I675b3144e913ab674fe27f9f65ee7a7bea24a72c
Focus listener: follow platform pattern for setter of listener
and handler (set(listener) and set(listener, handler) methods).
More docs.
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioFocusTest
Bug: 30258418
Change-Id: Ib5d1fbc3cf92821b63ffc1b4ad4cf4384bb6ff54
Addressed API council notes: document some missing default values
of AudioFocusRequest builder, remove getters on lister and
handler.
Fix missing support of custom Handler for focus listener.
Integrate focus lock feature from AudioManager SystemAPI into
new AudioFocusRequest class and builder. Deprecate system
methods for focus requests that don't use AudioFocusRequest
Switch to a ConcurrentHashMap in AudioManager instead of a
lock and HashMap to maintain the list of focus listeners
for each AudioManager instance.
Clean up: all local IAudioService references can be made final.
Add missing @Override for the Stub implementations.
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioFocusTest
Bug: 30258418
Change-Id: I9e903379a607c723a2620821200547de679231d1
Wrap all options of an audio focus request into a new
class, AudioFocus request, and the corresponding
methods in AudioManager to request and abandon focus
with an AudioFocusRequest instance.
New options include handler for focus change listener,
delayed focus, and option for specifying pause behavior
on duckable transient loss of focus.
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioFocusTest
Bug: 30258418
Change-Id: I99151270d0d9c59595db3f5c91480c7af2d1fd71