Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +6 −0 Original line number Diff line number Diff line Loading @@ -3785,6 +3785,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { private void resetState() { mIsInEmergencyCall = false; mPhone.setEcmCanceledForEmergency(false); mHoldSwitchingState = HoldSwapState.INACTIVE; } @VisibleForTesting public boolean isHoldOrSwapInProgress() { return mHoldSwitchingState != HoldSwapState.INACTIVE; } //****** Overridden from Handler Loading tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +31 −0 Original line number Diff line number Diff line Loading @@ -1125,6 +1125,37 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { assertFalse(mCTUT.mForegroundCall.isRingbackTonePlaying()); } @Test @SmallTest public void testClearHoldSwapStateOnSrvcc() throws Exception { // Answer an incoming call testImsMTCall(); assertTrue(mCTUT.mRingingCall.isRinging()); try { mCTUT.acceptCall(ImsCallProfile.CALL_TYPE_VOICE); verify(mImsCall, times(1)).accept(eq(ImsCallProfile .getCallTypeFromVideoState(ImsCallProfile.CALL_TYPE_VOICE))); } catch (Exception ex) { ex.printStackTrace(); Assert.fail("set active, unexpected exception thrown" + ex.getMessage()); } assertEquals(Call.State.ACTIVE, mCTUT.mForegroundCall.getState()); // Hold the call doNothing().when(mImsCall).hold(); try { mCTUT.holdActiveCall(); assertTrue(mCTUT.isHoldOrSwapInProgress()); } catch (Exception ex) { ex.printStackTrace(); Assert.fail("hold, unexpected exception thrown" + ex.getMessage()); } // Move the connection to the handover state. mCTUT.notifySrvccState(Call.SrvccState.COMPLETED); // Ensure we are no longer tracking hold. assertFalse(mCTUT.isHoldOrSwapInProgress()); } @Test @SmallTest public void testHangupHandoverCall() throws RemoteException { Loading Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +6 −0 Original line number Diff line number Diff line Loading @@ -3785,6 +3785,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { private void resetState() { mIsInEmergencyCall = false; mPhone.setEcmCanceledForEmergency(false); mHoldSwitchingState = HoldSwapState.INACTIVE; } @VisibleForTesting public boolean isHoldOrSwapInProgress() { return mHoldSwitchingState != HoldSwapState.INACTIVE; } //****** Overridden from Handler Loading
tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +31 −0 Original line number Diff line number Diff line Loading @@ -1125,6 +1125,37 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { assertFalse(mCTUT.mForegroundCall.isRingbackTonePlaying()); } @Test @SmallTest public void testClearHoldSwapStateOnSrvcc() throws Exception { // Answer an incoming call testImsMTCall(); assertTrue(mCTUT.mRingingCall.isRinging()); try { mCTUT.acceptCall(ImsCallProfile.CALL_TYPE_VOICE); verify(mImsCall, times(1)).accept(eq(ImsCallProfile .getCallTypeFromVideoState(ImsCallProfile.CALL_TYPE_VOICE))); } catch (Exception ex) { ex.printStackTrace(); Assert.fail("set active, unexpected exception thrown" + ex.getMessage()); } assertEquals(Call.State.ACTIVE, mCTUT.mForegroundCall.getState()); // Hold the call doNothing().when(mImsCall).hold(); try { mCTUT.holdActiveCall(); assertTrue(mCTUT.isHoldOrSwapInProgress()); } catch (Exception ex) { ex.printStackTrace(); Assert.fail("hold, unexpected exception thrown" + ex.getMessage()); } // Move the connection to the handover state. mCTUT.notifySrvccState(Call.SrvccState.COMPLETED); // Ensure we are no longer tracking hold. assertFalse(mCTUT.isHoldOrSwapInProgress()); } @Test @SmallTest public void testHangupHandoverCall() throws RemoteException { Loading