Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCall.java +4 −0 Original line number Diff line number Diff line Loading @@ -397,6 +397,10 @@ public class ImsPhoneCall extends Call { } } public boolean isRingbackTonePlaying() { return mIsRingbackTonePlaying; } private void takeOver(ImsPhoneCall that) { copyConnectionFrom(that); mState = that.mState; Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +4 −6 Original line number Diff line number Diff line Loading @@ -3357,12 +3357,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { ImsPhoneConnection conn = findConnection(imsCall); if (conn != null) { ImsPhoneCall imsPhoneCall = conn.getCall(); if (imsPhoneCall != null) { // We might be playing ringback on the handover connection; we should stop // playing it at this point (otherwise it could play indefinitely). imsPhoneCall.maybeStopRingback(); } if (conn.getDisconnectCause() == DisconnectCause.NOT_DISCONNECTED) { if (isHandoverToWifi) { removeMessages(EVENT_CHECK_FOR_WIFI_HANDOVER); Loading Loading @@ -3769,6 +3763,10 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { mSrvccState = state; if (mSrvccState == Call.SrvccState.COMPLETED) { // If the dialing call had ringback, ensure it stops now, otherwise it'll keep playing // afer the SRVCC completes. mForegroundCall.maybeStopRingback(); resetState(); transferHandoverConnections(mForegroundCall); transferHandoverConnections(mBackgroundCall); Loading tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +18 −0 Original line number Diff line number Diff line Loading @@ -1107,6 +1107,24 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { assertVtDataUsageUpdated(13, 19, 19); } @Test @SmallTest public void testEndRingbackOnSrvcc() throws RemoteException { mSecondImsCall.getCallProfile().mMediaProfile = new ImsStreamMediaProfile(); mSecondImsCall.getCallProfile().mMediaProfile.mAudioDirection = ImsStreamMediaProfile.DIRECTION_INACTIVE; startOutgoingCall(); mImsCallListener.onCallProgressing(mSecondImsCall); assertTrue(mCTUT.mForegroundCall.isRingbackTonePlaying()); // Move the connection to the handover state. mCTUT.notifySrvccState(Call.SrvccState.COMPLETED); assertFalse(mCTUT.mForegroundCall.isRingbackTonePlaying()); } @Test @SmallTest public void testHangupHandoverCall() throws RemoteException { Loading Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCall.java +4 −0 Original line number Diff line number Diff line Loading @@ -397,6 +397,10 @@ public class ImsPhoneCall extends Call { } } public boolean isRingbackTonePlaying() { return mIsRingbackTonePlaying; } private void takeOver(ImsPhoneCall that) { copyConnectionFrom(that); mState = that.mState; Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +4 −6 Original line number Diff line number Diff line Loading @@ -3357,12 +3357,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { ImsPhoneConnection conn = findConnection(imsCall); if (conn != null) { ImsPhoneCall imsPhoneCall = conn.getCall(); if (imsPhoneCall != null) { // We might be playing ringback on the handover connection; we should stop // playing it at this point (otherwise it could play indefinitely). imsPhoneCall.maybeStopRingback(); } if (conn.getDisconnectCause() == DisconnectCause.NOT_DISCONNECTED) { if (isHandoverToWifi) { removeMessages(EVENT_CHECK_FOR_WIFI_HANDOVER); Loading Loading @@ -3769,6 +3763,10 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { mSrvccState = state; if (mSrvccState == Call.SrvccState.COMPLETED) { // If the dialing call had ringback, ensure it stops now, otherwise it'll keep playing // afer the SRVCC completes. mForegroundCall.maybeStopRingback(); resetState(); transferHandoverConnections(mForegroundCall); transferHandoverConnections(mBackgroundCall); Loading
tests/telephonytests/src/com/android/internal/telephony/imsphone/ImsPhoneCallTrackerTest.java +18 −0 Original line number Diff line number Diff line Loading @@ -1107,6 +1107,24 @@ public class ImsPhoneCallTrackerTest extends TelephonyTest { assertVtDataUsageUpdated(13, 19, 19); } @Test @SmallTest public void testEndRingbackOnSrvcc() throws RemoteException { mSecondImsCall.getCallProfile().mMediaProfile = new ImsStreamMediaProfile(); mSecondImsCall.getCallProfile().mMediaProfile.mAudioDirection = ImsStreamMediaProfile.DIRECTION_INACTIVE; startOutgoingCall(); mImsCallListener.onCallProgressing(mSecondImsCall); assertTrue(mCTUT.mForegroundCall.isRingbackTonePlaying()); // Move the connection to the handover state. mCTUT.notifySrvccState(Call.SrvccState.COMPLETED); assertFalse(mCTUT.mForegroundCall.isRingbackTonePlaying()); } @Test @SmallTest public void testHangupHandoverCall() throws RemoteException { Loading