Loading flags/telecom_callaudioroutestatemachine_flags.aconfig +0 −11 Original line number Diff line number Diff line Loading @@ -79,17 +79,6 @@ flag { } } # OWNER=pmadapurmath TARGET=25Q3 flag { name: "update_preferred_audio_device_logic" namespace: "telecom" description: "Change the use of preferred device for strategy to only use it at the start of the call and include relevant syncing with AudioManager#getCommunicationDevice" bug: "377345692" metadata { purpose: PURPOSE_BUGFIX } } # OWNER=pmadapurmath TARGET=25Q3 flag { name: "call_audio_routing_performance_improvemenent" Loading src/com/android/server/telecom/CallAudioRouteController.java +3 −8 Original line number Diff line number Diff line Loading @@ -133,9 +133,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { try { if (AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED.equals(intent.getAction())) { if (mAudioManager != null) { AudioDeviceInfo info = mFeatureFlags.updatePreferredAudioDeviceLogic() ? getCurrentCommunicationDevice() : mAudioManager.getCommunicationDevice(); AudioDeviceInfo info = getCurrentCommunicationDevice(); if ((info != null) && (info.getType() == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)) { if (mCurrentRoute.getType() != AudioRoute.TYPE_SPEAKER) { Loading Loading @@ -1330,10 +1328,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { // Get corresponding audio route @AudioRoute.AudioRouteType int type = DEVICE_INFO_TYPE_TO_AUDIO_ROUTE_TYPE.get( deviceAttr.getType()); AudioDeviceInfo currentCommunicationDevice = null; if (mFeatureFlags.updatePreferredAudioDeviceLogic()) { currentCommunicationDevice = getCurrentCommunicationDevice(); } AudioDeviceInfo currentCommunicationDevice = getCurrentCommunicationDevice(); // We will default to TYPE_INVALID if the currentCommunicationDevice is null or the type // cannot be resolved from the given audio device info. int communicationDeviceAudioType = getAudioType(currentCommunicationDevice); Loading Loading @@ -1480,7 +1475,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { public AudioRoute getBaseRoute(boolean includeBluetooth, String btAddressToExclude) { // Catch-all case for all invocations to this method where we shouldn't be using // getPreferredAudioRouteFromStrategy if (mFeatureFlags.updatePreferredAudioDeviceLogic() && !mUsePreferredDeviceStrategy) { if (!mUsePreferredDeviceStrategy) { return calculateBaselineRoute(false, includeBluetooth, btAddressToExclude); } AudioRoute destRoute = getPreferredAudioRouteFromStrategy(); Loading tests/src/com/android/server/telecom/tests/CallAudioRouteControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -283,7 +283,6 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { @SmallTest @Test public void testAudioRouteForPreferredDeviceStrategy() { when(mFeatureFlags.updatePreferredAudioDeviceLogic()).thenReturn(true); mController.initialize(); mController.sendMessageWithSessionInfo(SWITCH_FOCUS, RINGING_FOCUS, 0); waitForRouteActiveStateAndVerify(true); Loading @@ -302,7 +301,6 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { @SmallTest @Test public void testAudioRouteCommunicationDeviceSyncWithPreferredDeviceStrategy() { when(mFeatureFlags.updatePreferredAudioDeviceLogic()).thenReturn(true); mController.initialize(); // Set up tests so that the current communication device is different from the preferred // device for strategy. Loading Loading
flags/telecom_callaudioroutestatemachine_flags.aconfig +0 −11 Original line number Diff line number Diff line Loading @@ -79,17 +79,6 @@ flag { } } # OWNER=pmadapurmath TARGET=25Q3 flag { name: "update_preferred_audio_device_logic" namespace: "telecom" description: "Change the use of preferred device for strategy to only use it at the start of the call and include relevant syncing with AudioManager#getCommunicationDevice" bug: "377345692" metadata { purpose: PURPOSE_BUGFIX } } # OWNER=pmadapurmath TARGET=25Q3 flag { name: "call_audio_routing_performance_improvemenent" Loading
src/com/android/server/telecom/CallAudioRouteController.java +3 −8 Original line number Diff line number Diff line Loading @@ -133,9 +133,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { try { if (AudioManager.ACTION_SPEAKERPHONE_STATE_CHANGED.equals(intent.getAction())) { if (mAudioManager != null) { AudioDeviceInfo info = mFeatureFlags.updatePreferredAudioDeviceLogic() ? getCurrentCommunicationDevice() : mAudioManager.getCommunicationDevice(); AudioDeviceInfo info = getCurrentCommunicationDevice(); if ((info != null) && (info.getType() == AudioDeviceInfo.TYPE_BUILTIN_SPEAKER)) { if (mCurrentRoute.getType() != AudioRoute.TYPE_SPEAKER) { Loading Loading @@ -1330,10 +1328,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { // Get corresponding audio route @AudioRoute.AudioRouteType int type = DEVICE_INFO_TYPE_TO_AUDIO_ROUTE_TYPE.get( deviceAttr.getType()); AudioDeviceInfo currentCommunicationDevice = null; if (mFeatureFlags.updatePreferredAudioDeviceLogic()) { currentCommunicationDevice = getCurrentCommunicationDevice(); } AudioDeviceInfo currentCommunicationDevice = getCurrentCommunicationDevice(); // We will default to TYPE_INVALID if the currentCommunicationDevice is null or the type // cannot be resolved from the given audio device info. int communicationDeviceAudioType = getAudioType(currentCommunicationDevice); Loading Loading @@ -1480,7 +1475,7 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { public AudioRoute getBaseRoute(boolean includeBluetooth, String btAddressToExclude) { // Catch-all case for all invocations to this method where we shouldn't be using // getPreferredAudioRouteFromStrategy if (mFeatureFlags.updatePreferredAudioDeviceLogic() && !mUsePreferredDeviceStrategy) { if (!mUsePreferredDeviceStrategy) { return calculateBaselineRoute(false, includeBluetooth, btAddressToExclude); } AudioRoute destRoute = getPreferredAudioRouteFromStrategy(); Loading
tests/src/com/android/server/telecom/tests/CallAudioRouteControllerTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -283,7 +283,6 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { @SmallTest @Test public void testAudioRouteForPreferredDeviceStrategy() { when(mFeatureFlags.updatePreferredAudioDeviceLogic()).thenReturn(true); mController.initialize(); mController.sendMessageWithSessionInfo(SWITCH_FOCUS, RINGING_FOCUS, 0); waitForRouteActiveStateAndVerify(true); Loading @@ -302,7 +301,6 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { @SmallTest @Test public void testAudioRouteCommunicationDeviceSyncWithPreferredDeviceStrategy() { when(mFeatureFlags.updatePreferredAudioDeviceLogic()).thenReturn(true); mController.initialize(); // Set up tests so that the current communication device is different from the preferred // device for strategy. Loading