Loading flags/telecom_callaudioroutestatemachine_flags.aconfig +0 −11 Original line number Diff line number Diff line Loading @@ -89,14 +89,3 @@ flag { purpose: PURPOSE_BUGFIX } } # OWNER=pmadapurmath TARGET=25Q3 flag { name: "maybe_default_speaker_after_unhold" namespace: "telecom" description: "If the call audio route was on speaker and the call is held/unheld, ensure that we route back to speaker." bug: "406898224" metadata { purpose: PURPOSE_BUGFIX } } src/com/android/server/telecom/CallAudioRouteController.java +3 −3 Original line number Diff line number Diff line Loading @@ -1460,9 +1460,9 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { // Ensure that we default to speaker route if we're in a video call, but disregard it if // a wired headset is plugged in. Also consider the case when we're holding/unholding a // call. If the route was on speaker mode, ensure that we preserve the route selection. boolean shouldDefaultSpeaker = mFeatureFlags.maybeDefaultSpeakerAfterUnhold() && mWasOnSpeaker; if ((skipEarpiece || shouldDefaultSpeaker) && defaultRoute != null // Todo: Clean this up once logic to maintain current audio routing during // active/ringing focus switch is addressed. if ((skipEarpiece || mWasOnSpeaker) && defaultRoute != null && defaultRoute.getType() == AudioRoute.TYPE_EARPIECE) { Log.i(this, "getPreferredAudioRouteFromDefault: Audio routing defaulting to " + "speaker route for (video) call."); Loading tests/src/com/android/server/telecom/tests/CallAudioRouteControllerTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -328,9 +328,10 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { verify(mCallsManager, timeout(TEST_TIMEOUT).atLeastOnce()).onCallAudioStateChanged( any(CallAudioState.class), eq(expectedState)); // For sanity, verify that routing falls back on earpiece if focus is switched to active // again (we don't try to use the preferred device strategy). mController.sendMessageWithSessionInfo(SWITCH_FOCUS, ACTIVE_FOCUS, 0); // For sanity, verify that routing falls back on earpiece if we attempt to recalculate // audio routing. mController.sendMessageWithSessionInfo(USER_SWITCH_BASELINE_ROUTE, CallAudioRouteController.INCLUDE_BLUETOOTH_IN_BASELINE); mController.sendMessageWithSessionInfo(SPEAKER_OFF); expectedState = new CallAudioState(false, CallAudioState.ROUTE_EARPIECE, CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER, null, Loading Loading @@ -589,6 +590,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged( any(CallAudioState.class), eq(expectedState)); mController.sendMessageWithSessionInfo(USER_SWITCH_EARPIECE); mController.sendMessageWithSessionInfo(SPEAKER_OFF); expectedState = new CallAudioState(false, CallAudioState.ROUTE_EARPIECE, CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER, null, Loading Loading
flags/telecom_callaudioroutestatemachine_flags.aconfig +0 −11 Original line number Diff line number Diff line Loading @@ -89,14 +89,3 @@ flag { purpose: PURPOSE_BUGFIX } } # OWNER=pmadapurmath TARGET=25Q3 flag { name: "maybe_default_speaker_after_unhold" namespace: "telecom" description: "If the call audio route was on speaker and the call is held/unheld, ensure that we route back to speaker." bug: "406898224" metadata { purpose: PURPOSE_BUGFIX } }
src/com/android/server/telecom/CallAudioRouteController.java +3 −3 Original line number Diff line number Diff line Loading @@ -1460,9 +1460,9 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { // Ensure that we default to speaker route if we're in a video call, but disregard it if // a wired headset is plugged in. Also consider the case when we're holding/unholding a // call. If the route was on speaker mode, ensure that we preserve the route selection. boolean shouldDefaultSpeaker = mFeatureFlags.maybeDefaultSpeakerAfterUnhold() && mWasOnSpeaker; if ((skipEarpiece || shouldDefaultSpeaker) && defaultRoute != null // Todo: Clean this up once logic to maintain current audio routing during // active/ringing focus switch is addressed. if ((skipEarpiece || mWasOnSpeaker) && defaultRoute != null && defaultRoute.getType() == AudioRoute.TYPE_EARPIECE) { Log.i(this, "getPreferredAudioRouteFromDefault: Audio routing defaulting to " + "speaker route for (video) call."); Loading
tests/src/com/android/server/telecom/tests/CallAudioRouteControllerTest.java +5 −3 Original line number Diff line number Diff line Loading @@ -328,9 +328,10 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { verify(mCallsManager, timeout(TEST_TIMEOUT).atLeastOnce()).onCallAudioStateChanged( any(CallAudioState.class), eq(expectedState)); // For sanity, verify that routing falls back on earpiece if focus is switched to active // again (we don't try to use the preferred device strategy). mController.sendMessageWithSessionInfo(SWITCH_FOCUS, ACTIVE_FOCUS, 0); // For sanity, verify that routing falls back on earpiece if we attempt to recalculate // audio routing. mController.sendMessageWithSessionInfo(USER_SWITCH_BASELINE_ROUTE, CallAudioRouteController.INCLUDE_BLUETOOTH_IN_BASELINE); mController.sendMessageWithSessionInfo(SPEAKER_OFF); expectedState = new CallAudioState(false, CallAudioState.ROUTE_EARPIECE, CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER, null, Loading Loading @@ -589,6 +590,7 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged( any(CallAudioState.class), eq(expectedState)); mController.sendMessageWithSessionInfo(USER_SWITCH_EARPIECE); mController.sendMessageWithSessionInfo(SPEAKER_OFF); expectedState = new CallAudioState(false, CallAudioState.ROUTE_EARPIECE, CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER, null, Loading