Skip to content
Commit b50f70c8 authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

Audio focus: fade out active playbacks on FOCUS_LOSS

When an application loses audio focus with AUDIOFOCUS_LOSS and its
active players (on usage GAME or MEDIA, but not SPEECH) qualify to
be faded out with a VolumeShaper:
 - apply the fade on the active players
 - remove the focus loser from the stack
 - delay the dispatch of focus loss by the duration of the fade
Management of who is being faded out is in the FadingManager class.
When an app requests audio focus and the request is granted, undo
  the fade.
When a player from an app being faded out starts, apply the fade
  but skip the volume ramp (essentially muting the player).

Bug: 181910599
Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioFocusTest

Change-Id: I5f7b466d30057ce03466ac2edc950a02aca767d6
parent f98091f2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment