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

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

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

Change-Id: I1283009f21e9fa132f776f10b2f55c4978916d8a
parents 7a62eeb6 75ecaf4f
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1215,10 +1215,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
@@ -497,6 +497,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();