Loading src/com/android/server/telecom/CallsManager.java +9 −1 Original line number Diff line number Diff line Loading @@ -4299,7 +4299,8 @@ public class CallsManager extends Call.ListenerBase return false; } private boolean makeRoomForOutgoingCall(Call call) { @VisibleForTesting public boolean makeRoomForOutgoingCall(Call call) { // Already room! if (!hasMaximumLiveCalls(call)) return true; Loading @@ -4316,6 +4317,13 @@ public class CallsManager extends Call.ListenerBase return true; } // If the live call is stuck in a connecting state, then we should disconnect it in favor // of the new outgoing call. if (liveCall.getState() == CallState.CONNECTING) { liveCall.disconnect("Force disconnect CONNECTING call."); return true; } if (hasMaximumOutgoingCalls(call)) { Call outgoingCall = getFirstCallWithState(OUTGOING_CALL_STATES); if (outgoingCall.getState() == CallState.SELECT_PHONE_ACCOUNT) { Loading tests/src/com/android/server/telecom/tests/CallsManagerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -1253,6 +1253,21 @@ public class CallsManagerTest extends TelecomTestCase { verify(ringingCall).reject(anyBoolean(), any(), any()); } @SmallTest @Test public void testMakeRoomForOutgoingCallConnecting() { Call ongoingCall = addSpyCall(SIM_2_HANDLE, CallState.CONNECTING); Call newCall = createCall(SIM_1_HANDLE, CallState.NEW); when(mComponentContextFixture.getTelephonyManager().isEmergencyNumber(any())) .thenReturn(false); newCall.setHandle(Uri.fromParts("tel", "5551213", null), TelecomManager.PRESENTATION_ALLOWED); assertTrue(mCallsManager.makeRoomForOutgoingCall(newCall)); verify(ongoingCall).disconnect(anyLong(), anyString()); } /** * Verifies that changes to a {@link PhoneAccount}'s * {@link PhoneAccount#CAPABILITY_VIDEO_CALLING} capability will be reflected on a call. Loading Loading
src/com/android/server/telecom/CallsManager.java +9 −1 Original line number Diff line number Diff line Loading @@ -4299,7 +4299,8 @@ public class CallsManager extends Call.ListenerBase return false; } private boolean makeRoomForOutgoingCall(Call call) { @VisibleForTesting public boolean makeRoomForOutgoingCall(Call call) { // Already room! if (!hasMaximumLiveCalls(call)) return true; Loading @@ -4316,6 +4317,13 @@ public class CallsManager extends Call.ListenerBase return true; } // If the live call is stuck in a connecting state, then we should disconnect it in favor // of the new outgoing call. if (liveCall.getState() == CallState.CONNECTING) { liveCall.disconnect("Force disconnect CONNECTING call."); return true; } if (hasMaximumOutgoingCalls(call)) { Call outgoingCall = getFirstCallWithState(OUTGOING_CALL_STATES); if (outgoingCall.getState() == CallState.SELECT_PHONE_ACCOUNT) { Loading
tests/src/com/android/server/telecom/tests/CallsManagerTest.java +15 −0 Original line number Diff line number Diff line Loading @@ -1253,6 +1253,21 @@ public class CallsManagerTest extends TelecomTestCase { verify(ringingCall).reject(anyBoolean(), any(), any()); } @SmallTest @Test public void testMakeRoomForOutgoingCallConnecting() { Call ongoingCall = addSpyCall(SIM_2_HANDLE, CallState.CONNECTING); Call newCall = createCall(SIM_1_HANDLE, CallState.NEW); when(mComponentContextFixture.getTelephonyManager().isEmergencyNumber(any())) .thenReturn(false); newCall.setHandle(Uri.fromParts("tel", "5551213", null), TelecomManager.PRESENTATION_ALLOWED); assertTrue(mCallsManager.makeRoomForOutgoingCall(newCall)); verify(ongoingCall).disconnect(anyLong(), anyString()); } /** * Verifies that changes to a {@link PhoneAccount}'s * {@link PhoneAccount#CAPABILITY_VIDEO_CALLING} capability will be reflected on a call. Loading