Loading src/com/android/server/telecom/CallAudioRouteController.java +3 −0 Original line number Diff line number Diff line Loading @@ -343,6 +343,9 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { case MUTE_EXTERNALLY_CHANGED: handleMuteChanged(mAudioManager.isMicrophoneMute()); break; case TOGGLE_MUTE: handleMuteChanged(!mIsMute); break; case SWITCH_FOCUS: focus = msg.arg1; handleEndTone = (int) ((SomeArgs) msg.obj).arg2; Loading tests/src/com/android/server/telecom/tests/CallAudioRouteControllerTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import static com.android.server.telecom.CallAudioRouteAdapter.STREAMING_FORCE_D import static com.android.server.telecom.CallAudioRouteAdapter.STREAMING_FORCE_ENABLED; import static com.android.server.telecom.CallAudioRouteAdapter.SWITCH_BASELINE_ROUTE; import static com.android.server.telecom.CallAudioRouteAdapter.SWITCH_FOCUS; import static com.android.server.telecom.CallAudioRouteAdapter.TOGGLE_MUTE; import static com.android.server.telecom.CallAudioRouteAdapter.USER_SWITCH_BASELINE_ROUTE; import static com.android.server.telecom.CallAudioRouteAdapter.USER_SWITCH_BLUETOOTH; import static com.android.server.telecom.CallAudioRouteAdapter.USER_SWITCH_EARPIECE; Loading Loading @@ -646,6 +647,17 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { anyInt(), anyString()); verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged( any(CallAudioState.class), eq(expectedState)); // Send TOGGLE_MUTE when(mAudioManager.isMicrophoneMute()).thenReturn(false); mController.sendMessageWithSessionInfo(TOGGLE_MUTE); expectedState = new CallAudioState(true, CallAudioState.ROUTE_EARPIECE, CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER, null, new HashSet<>()); verify(mAudioService, timeout(TEST_TIMEOUT)).setMicrophoneMute(eq(true), anyString(), anyInt(), anyString()); verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged( any(CallAudioState.class), eq(expectedState)); } @SmallTest Loading Loading
src/com/android/server/telecom/CallAudioRouteController.java +3 −0 Original line number Diff line number Diff line Loading @@ -343,6 +343,9 @@ public class CallAudioRouteController implements CallAudioRouteAdapter { case MUTE_EXTERNALLY_CHANGED: handleMuteChanged(mAudioManager.isMicrophoneMute()); break; case TOGGLE_MUTE: handleMuteChanged(!mIsMute); break; case SWITCH_FOCUS: focus = msg.arg1; handleEndTone = (int) ((SomeArgs) msg.obj).arg2; Loading
tests/src/com/android/server/telecom/tests/CallAudioRouteControllerTest.java +12 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import static com.android.server.telecom.CallAudioRouteAdapter.STREAMING_FORCE_D import static com.android.server.telecom.CallAudioRouteAdapter.STREAMING_FORCE_ENABLED; import static com.android.server.telecom.CallAudioRouteAdapter.SWITCH_BASELINE_ROUTE; import static com.android.server.telecom.CallAudioRouteAdapter.SWITCH_FOCUS; import static com.android.server.telecom.CallAudioRouteAdapter.TOGGLE_MUTE; import static com.android.server.telecom.CallAudioRouteAdapter.USER_SWITCH_BASELINE_ROUTE; import static com.android.server.telecom.CallAudioRouteAdapter.USER_SWITCH_BLUETOOTH; import static com.android.server.telecom.CallAudioRouteAdapter.USER_SWITCH_EARPIECE; Loading Loading @@ -646,6 +647,17 @@ public class CallAudioRouteControllerTest extends TelecomTestCase { anyInt(), anyString()); verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged( any(CallAudioState.class), eq(expectedState)); // Send TOGGLE_MUTE when(mAudioManager.isMicrophoneMute()).thenReturn(false); mController.sendMessageWithSessionInfo(TOGGLE_MUTE); expectedState = new CallAudioState(true, CallAudioState.ROUTE_EARPIECE, CallAudioState.ROUTE_EARPIECE | CallAudioState.ROUTE_SPEAKER, null, new HashSet<>()); verify(mAudioService, timeout(TEST_TIMEOUT)).setMicrophoneMute(eq(true), anyString(), anyInt(), anyString()); verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged( any(CallAudioState.class), eq(expectedState)); } @SmallTest Loading