Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 243c5863 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/34127834'] into 25Q2-release.

Change-Id: Ia93d4e69bf4ba8e8ab0a03a926b5c39b509d9939
parents e3af993a 20d56535
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1151,10 +1151,13 @@ public class CallAudioRouteController implements CallAudioRouteAdapter {
            // Update status bar notification
            mStatusBarNotifier.notifySpeakerphone(false);
        } else if (mCurrentRoute.getType() == AudioRoute.TYPE_SPEAKER) {
            routeTo(mIsActive, getBaseRoute(true, null));
            AudioRoute newRoute = getBaseRoute(true, null);
            routeTo(mIsActive, newRoute);
            // Since the route switching triggered by this message, we need to manually send it
            // again so that we won't stuck in the pending route
            if (mIsActive) {
            // again so that we won't stuck in the pending route. Do not send the additional
            // SPEAKER_OFF msg if we find that audio wasn't routed out of speaker. This would have
            // the potential to cause an infinite loop if routing doesn't change.
            if (mIsActive && newRoute.getType() != TYPE_SPEAKER) {
                sendMessageWithSessionInfo(SPEAKER_OFF);
            }
            onAvailableRoutesChanged();
+1 −0
Original line number Diff line number Diff line
@@ -499,6 +499,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
        assertTrue(mController.isActive());

        mController.sendMessageWithSessionInfo(SWITCH_FOCUS, NO_FOCUS, 0);
        mController.sendMessageWithSessionInfo(BT_AUDIO_DISCONNECTED, 0, BLUETOOTH_DEVICE_1);
        // Ensure we tell the CallAudioManager that audio operations are done so that we can ensure
        // audio focus is relinquished.
        verify(mCallAudioManager, timeout(TEST_TIMEOUT)).notifyAudioOperationsComplete();