Restore audio focus correctly after transient sounds
When multi-audio focus is enabled, media sound that is ducked by a transient notification sound is not restored after the notification ends. The original logic in `notifyTopOfAudioFocusStack` only restored focus to "locked" focus owners, not regular media players that experienced a transient focus loss. This change updates the logic to iterate through the multi-focus list and restore focus to any requester that has experienced a transient loss (`...CAN_DUCK` or `...TRANSIENT`). A helper method `isLossReceivedTransient()` is added to `AudioFocusInfo`. The change also preserves the original failsafe check for locked focus owners. Bug: 441513449 Test: Manually verified with logs that ducked media players are restored successfully https://paste.googleplex.com/5371234006859776 Flag: android.media.audio.audio_focus_desktop Change-Id: If3cf75fa980ac7d6791e919b50defa6997282c2d
Loading
Please register or sign in to comment