Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +3 −0 Original line number Diff line number Diff line Loading @@ -1123,6 +1123,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { connection.getCall().detach(connection); } mConnections.clear(); // Pending MO was added to mConnections previously, so it has already been disconnected // above. Remove all references to it. mPendingMO = null; updatePhoneState(); } Loading tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +25 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.any; Loading Loading @@ -569,6 +570,12 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { // Now fake the ImsService crashing mCTUT.hangupAllOrphanedConnections(DisconnectCause.LOST_SIGNAL); assertEquals(PhoneConstants.State.IDLE, mCTUT.getState()); try { // ensure new calls are not blocked by any lingering state after crash. mCTUT.checkForDialIssues(); } catch (CallStateException e) { fail("checkForDialIssues should not generate a CallStateException: " + e.getMessage()); } } /** Loading Loading @@ -635,17 +642,32 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { } } @FlakyTest @Ignore @Test @SmallTest public void testImsMOCallDial() { startOutgoingCall(); //call established mImsCallListener.onCallProgressing(mSecondImsCall); processAllMessages(); assertEquals(Call.State.ALERTING, mCTUT.mForegroundCall.getState()); } @Test @SmallTest public void testImsMoCallCrash() { startOutgoingCall(); // Now fake the ImsService crashing mCTUT.hangupAllOrphanedConnections(DisconnectCause.LOST_SIGNAL); processAllMessages(); assertEquals(PhoneConstants.State.IDLE, mCTUT.getState()); try { // ensure new calls are not blocked by any lingering state after crash. mCTUT.checkForDialIssues(); } catch (CallStateException e) { fail("checkForDialIssues should not generate a CallStateException: " + e.getMessage()); } } private void startOutgoingCall() { assertEquals(Call.State.IDLE, mCTUT.mForegroundCall.getState()); assertEquals(PhoneConstants.State.IDLE, mCTUT.getState()); Loading @@ -658,6 +680,7 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { ex.printStackTrace(); Assert.fail("unexpected exception thrown" + ex.getMessage()); } processAllMessages(); assertEquals(PhoneConstants.State.OFFHOOK, mCTUT.getState()); assertEquals(Call.State.DIALING, mCTUT.mForegroundCall.getState()); } Loading Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +3 −0 Original line number Diff line number Diff line Loading @@ -1123,6 +1123,9 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { connection.getCall().detach(connection); } mConnections.clear(); // Pending MO was added to mConnections previously, so it has already been disconnected // above. Remove all references to it. mPendingMO = null; updatePhoneState(); } Loading
tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +25 −2 Original line number Diff line number Diff line Loading @@ -29,6 +29,7 @@ import static junit.framework.Assert.assertNotNull; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static org.junit.Assert.fail; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.any; Loading Loading @@ -569,6 +570,12 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { // Now fake the ImsService crashing mCTUT.hangupAllOrphanedConnections(DisconnectCause.LOST_SIGNAL); assertEquals(PhoneConstants.State.IDLE, mCTUT.getState()); try { // ensure new calls are not blocked by any lingering state after crash. mCTUT.checkForDialIssues(); } catch (CallStateException e) { fail("checkForDialIssues should not generate a CallStateException: " + e.getMessage()); } } /** Loading Loading @@ -635,17 +642,32 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { } } @FlakyTest @Ignore @Test @SmallTest public void testImsMOCallDial() { startOutgoingCall(); //call established mImsCallListener.onCallProgressing(mSecondImsCall); processAllMessages(); assertEquals(Call.State.ALERTING, mCTUT.mForegroundCall.getState()); } @Test @SmallTest public void testImsMoCallCrash() { startOutgoingCall(); // Now fake the ImsService crashing mCTUT.hangupAllOrphanedConnections(DisconnectCause.LOST_SIGNAL); processAllMessages(); assertEquals(PhoneConstants.State.IDLE, mCTUT.getState()); try { // ensure new calls are not blocked by any lingering state after crash. mCTUT.checkForDialIssues(); } catch (CallStateException e) { fail("checkForDialIssues should not generate a CallStateException: " + e.getMessage()); } } private void startOutgoingCall() { assertEquals(Call.State.IDLE, mCTUT.mForegroundCall.getState()); assertEquals(PhoneConstants.State.IDLE, mCTUT.getState()); Loading @@ -658,6 +680,7 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { ex.printStackTrace(); Assert.fail("unexpected exception thrown" + ex.getMessage()); } processAllMessages(); assertEquals(PhoneConstants.State.OFFHOOK, mCTUT.getState()); assertEquals(Call.State.DIALING, mCTUT.mForegroundCall.getState()); } Loading