Commit 5d91cd00 authored by Chris Kuiper's avatar Chris Kuiper Committed by Commit Bot

Make sure we are unducked after requesting a new audio focus

Bug: internal b/74159854
Test: Ran on Android Things speaker, verified bug is fixed.
Change-Id: I14b4f82c175f771cf7387d1bf6b2655221397edc
Reviewed-on: https://chromium-review.googlesource.com/1011297Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Commit-Queue: Chris Kuiper <ckuiper@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551506}
parent 4467e580
...@@ -579,6 +579,10 @@ bool MediaSessionImpl::RequestSystemAudioFocus( ...@@ -579,6 +579,10 @@ bool MediaSessionImpl::RequestSystemAudioFocus(
bool result = delegate_->RequestAudioFocus(audio_focus_type); bool result = delegate_->RequestAudioFocus(audio_focus_type);
uma_helper_.RecordRequestAudioFocusResult(result); uma_helper_.RecordRequestAudioFocusResult(result);
// Make sure we are unducked.
if (result)
StopDucking();
// MediaSessionImpl must change its state & audio focus type AFTER requesting // MediaSessionImpl must change its state & audio focus type AFTER requesting
// audio focus. // audio focus.
SetAudioFocusState(result ? State::ACTIVE : State::INACTIVE); SetAudioFocusState(result ? State::ACTIVE : State::INACTIVE);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment