Loading flags/telecom_callaudioroutestatemachine_flags.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -195,3 +195,14 @@ flag { purpose: PURPOSE_BUGFIX } } # OWNER=pmadapurmath TARGET=25Q3 flag { name: "call_audio_routing_performance_improvemenent" namespace: "telecom" description: "Change the handler to use the main looper to improve performance with processing messages from the message queue" bug: "383466267" metadata { purpose: PURPOSE_BUGFIX } } src/com/android/server/telecom/CallAudioRouteController.java +8 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.media.IAudioService; import android.media.audiopolicy.AudioProductStrategy; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.telecom.CallAudioState; Loading Loading @@ -213,7 +214,9 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { mTelecomLock = callsManager.getLock(); HandlerThread handlerThread = new HandlerThread(this.getClass().getSimpleName()); if (!mFeatureFlags.callAudioRoutingPerformanceImprovemenent()) { handlerThread.start(); } // Register broadcast receivers if (!mFeatureFlags.newAudioPathSpeakerBroadcastAndUnfocusedRouting()) { Loading Loading @@ -253,8 +256,11 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { } }; Looper looper = mFeatureFlags.callAudioRoutingPerformanceImprovemenent() ? Looper.getMainLooper() : handlerThread.getLooper(); // Create handler mHandler = new Handler(handlerThread.getLooper()) { mHandler = new Handler(looper) { @Override public void handleMessage(@NonNull Message msg) { synchronized (this) { Loading tests/src/com/android/server/telecom/tests/CallAudioRouteControllerTest.java +7 −2 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import android.media.AudioDeviceInfo; import android.media.AudioManager; import android.media.IAudioService; import android.media.audiopolicy.AudioProductStrategy; import android.os.Looper; import android.os.UserHandle; import android.telecom.CallAudioState; import android.telecom.VideoProfile; Loading Loading @@ -216,13 +217,17 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { when(mFeatureFlags.resolveActiveBtRoutingAndBtTimingIssue()).thenReturn(false); when(mFeatureFlags.newAudioPathSpeakerBroadcastAndUnfocusedRouting()).thenReturn(false); when(mFeatureFlags.fixUserRequestBaselineRouteVideoCall()).thenReturn(false); when(mFeatureFlags.callAudioRoutingPerformanceImprovemenent()).thenReturn(true); BLUETOOTH_DEVICES.add(BLUETOOTH_DEVICE_1); } @After public void tearDown() throws Exception { Looper looper = mController.getAdapterHandler().getLooper(); if (looper != Looper.getMainLooper()) { mController.getAdapterHandler().getLooper().quit(); mController.getAdapterHandler().getLooper().getThread().join(); } BLUETOOTH_DEVICES.clear(); super.tearDown(); } Loading Loading
flags/telecom_callaudioroutestatemachine_flags.aconfig +11 −0 Original line number Diff line number Diff line Loading @@ -195,3 +195,14 @@ flag { purpose: PURPOSE_BUGFIX } } # OWNER=pmadapurmath TARGET=25Q3 flag { name: "call_audio_routing_performance_improvemenent" namespace: "telecom" description: "Change the handler to use the main looper to improve performance with processing messages from the message queue" bug: "383466267" metadata { purpose: PURPOSE_BUGFIX } }
src/com/android/server/telecom/CallAudioRouteController.java +8 −2 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.media.IAudioService; import android.media.audiopolicy.AudioProductStrategy; import android.os.Handler; import android.os.HandlerThread; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.telecom.CallAudioState; Loading Loading @@ -213,7 +214,9 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { mTelecomLock = callsManager.getLock(); HandlerThread handlerThread = new HandlerThread(this.getClass().getSimpleName()); if (!mFeatureFlags.callAudioRoutingPerformanceImprovemenent()) { handlerThread.start(); } // Register broadcast receivers if (!mFeatureFlags.newAudioPathSpeakerBroadcastAndUnfocusedRouting()) { Loading Loading @@ -253,8 +256,11 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { } }; Looper looper = mFeatureFlags.callAudioRoutingPerformanceImprovemenent() ? Looper.getMainLooper() : handlerThread.getLooper(); // Create handler mHandler = new Handler(handlerThread.getLooper()) { mHandler = new Handler(looper) { @Override public void handleMessage(@NonNull Message msg) { synchronized (this) { Loading
tests/src/com/android/server/telecom/tests/CallAudioRouteControllerTest.java +7 −2 Original line number Diff line number Diff line Loading @@ -74,6 +74,7 @@ import android.media.AudioDeviceInfo; import android.media.AudioManager; import android.media.IAudioService; import android.media.audiopolicy.AudioProductStrategy; import android.os.Looper; import android.os.UserHandle; import android.telecom.CallAudioState; import android.telecom.VideoProfile; Loading Loading @@ -216,13 +217,17 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { when(mFeatureFlags.resolveActiveBtRoutingAndBtTimingIssue()).thenReturn(false); when(mFeatureFlags.newAudioPathSpeakerBroadcastAndUnfocusedRouting()).thenReturn(false); when(mFeatureFlags.fixUserRequestBaselineRouteVideoCall()).thenReturn(false); when(mFeatureFlags.callAudioRoutingPerformanceImprovemenent()).thenReturn(true); BLUETOOTH_DEVICES.add(BLUETOOTH_DEVICE_1); } @After public void tearDown() throws Exception { Looper looper = mController.getAdapterHandler().getLooper(); if (looper != Looper.getMainLooper()) { mController.getAdapterHandler().getLooper().quit(); mController.getAdapterHandler().getLooper().getThread().join(); } BLUETOOTH_DEVICES.clear(); super.tearDown(); } Loading