Loading src/com/android/server/telecom/CallsManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -3929,7 +3929,9 @@ public class CallsManager extends Call.ListenerBase // We do not update the UI until we get confirmation of the answer() through // {@link #markCallAsActive}. mCall.answer(mVideoState); if (mCall.getState() == CallState.RINGING) { setCallState(mCall, CallState.ANSWERED, "answered"); } if (isSpeakerphoneAutoEnabledForVideoCalls(mVideoState)) { mCall.setStartWithSpeakerphoneOn(true); } Loading tests/src/com/android/server/telecom/tests/CallsManagerTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -624,6 +624,25 @@ public class CallsManagerTest extends TelecomTestCase { verify(incomingCall).answer(VideoProfile.STATE_AUDIO_ONLY); } @SmallTest @Test public void testAnswerAlreadyActiveCall() { // GIVEN a CallsManager with no ongoing call. // WHEN answer an already active call Call incomingCall = addSpyCall(); mCallsManager.answerCall(incomingCall, VideoProfile.STATE_AUDIO_ONLY); // THEN the focus request for incoming call is sent verifyFocusRequestAndExecuteCallback(incomingCall); // and the incoming call is answered. verify(incomingCall).answer(VideoProfile.STATE_AUDIO_ONLY); // and the incoming call's state is still ACTIVE assertEquals(CallState.ACTIVE, incomingCall.getState()); } @SmallTest @Test public void testSetActiveCallWhenOngoingCallCanNotBeHeldAndFromDifferentConnectionService() { Loading Loading
src/com/android/server/telecom/CallsManager.java +3 −1 Original line number Diff line number Diff line Loading @@ -3929,7 +3929,9 @@ public class CallsManager extends Call.ListenerBase // We do not update the UI until we get confirmation of the answer() through // {@link #markCallAsActive}. mCall.answer(mVideoState); if (mCall.getState() == CallState.RINGING) { setCallState(mCall, CallState.ANSWERED, "answered"); } if (isSpeakerphoneAutoEnabledForVideoCalls(mVideoState)) { mCall.setStartWithSpeakerphoneOn(true); } Loading
tests/src/com/android/server/telecom/tests/CallsManagerTest.java +19 −0 Original line number Diff line number Diff line Loading @@ -624,6 +624,25 @@ public class CallsManagerTest extends TelecomTestCase { verify(incomingCall).answer(VideoProfile.STATE_AUDIO_ONLY); } @SmallTest @Test public void testAnswerAlreadyActiveCall() { // GIVEN a CallsManager with no ongoing call. // WHEN answer an already active call Call incomingCall = addSpyCall(); mCallsManager.answerCall(incomingCall, VideoProfile.STATE_AUDIO_ONLY); // THEN the focus request for incoming call is sent verifyFocusRequestAndExecuteCallback(incomingCall); // and the incoming call is answered. verify(incomingCall).answer(VideoProfile.STATE_AUDIO_ONLY); // and the incoming call's state is still ACTIVE assertEquals(CallState.ACTIVE, incomingCall.getState()); } @SmallTest @Test public void testSetActiveCallWhenOngoingCallCanNotBeHeldAndFromDifferentConnectionService() { Loading