Loading src/com/android/server/telecom/CallAudioRouteStateMachine.java +1 −1 Original line number Diff line number Diff line Loading @@ -918,7 +918,7 @@ public class CallAudioRouteStateMachine extends StateMachine { if (msg.arg1 == NO_FOCUS) { // Only disconnect audio here instead of routing away from BT entirely. mBluetoothRouteManager.disconnectAudio(); reinitialize(); transitionTo(mQuiescentBluetoothRoute); mCallAudioManager.notifyAudioOperationsComplete(); } else if (msg.arg1 == RINGING_FOCUS && !mBluetoothRouteManager.isInbandRingingEnabled()) { Loading tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import java.util.List; import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.eq; Loading Loading @@ -694,6 +695,16 @@ public class CallAudioRouteStateMachineTest extends TelecomTestCase { verify(mockBluetoothRouteManager, atLeastOnce()) .connectBluetoothAudio(eq(bluetoothDevice1.getAddress())); assertTrue(stateMachine.isInActiveState()); // Switch to inactive, pretending that the call disconnected. stateMachine.sendMessageWithSessionInfo(CallAudioRouteStateMachine.SWITCH_FOCUS, CallAudioRouteStateMachine.NO_FOCUS); waitForHandlerAction(stateMachine.getHandler(), TEST_TIMEOUT); // Make sure that we've successfully switched to the quiescent BT route assertEquals(CallAudioState.ROUTE_BLUETOOTH, stateMachine.getCurrentCallAudioState().getRoute()); assertFalse(stateMachine.isInActiveState()); } @SmallTest Loading Loading
src/com/android/server/telecom/CallAudioRouteStateMachine.java +1 −1 Original line number Diff line number Diff line Loading @@ -918,7 +918,7 @@ public class CallAudioRouteStateMachine extends StateMachine { if (msg.arg1 == NO_FOCUS) { // Only disconnect audio here instead of routing away from BT entirely. mBluetoothRouteManager.disconnectAudio(); reinitialize(); transitionTo(mQuiescentBluetoothRoute); mCallAudioManager.notifyAudioOperationsComplete(); } else if (msg.arg1 == RINGING_FOCUS && !mBluetoothRouteManager.isInbandRingingEnabled()) { Loading
tests/src/com/android/server/telecom/tests/CallAudioRouteStateMachineTest.java +11 −0 Original line number Diff line number Diff line Loading @@ -60,6 +60,7 @@ import java.util.List; import java.util.Set; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; import static org.mockito.ArgumentMatchers.eq; Loading Loading @@ -694,6 +695,16 @@ public class CallAudioRouteStateMachineTest extends TelecomTestCase { verify(mockBluetoothRouteManager, atLeastOnce()) .connectBluetoothAudio(eq(bluetoothDevice1.getAddress())); assertTrue(stateMachine.isInActiveState()); // Switch to inactive, pretending that the call disconnected. stateMachine.sendMessageWithSessionInfo(CallAudioRouteStateMachine.SWITCH_FOCUS, CallAudioRouteStateMachine.NO_FOCUS); waitForHandlerAction(stateMachine.getHandler(), TEST_TIMEOUT); // Make sure that we've successfully switched to the quiescent BT route assertEquals(CallAudioState.ROUTE_BLUETOOTH, stateMachine.getCurrentCallAudioState().getRoute()); assertFalse(stateMachine.isInActiveState()); } @SmallTest Loading