Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7440bf6b authored by Tyler Gunn's avatar Tyler Gunn Committed by Automerger Merge Worker
Browse files

Merge "Fix termination of local ringback on SRVCC." am: 50ddc3c2

Original change: https://android-review.googlesource.com/c/platform/frameworks/opt/telephony/+/1314510

Change-Id: I47dcffa26161eef3a2dca96c1157797f38ff7d52
parents ebd65659 50ddc3c2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -397,6 +397,10 @@ public class ImsPhoneCall extends Call {
        }
    }

    public boolean isRingbackTonePlaying() {
        return mIsRingbackTonePlaying;
    }

    private void takeOver(ImsPhoneCall that) {
        copyConnectionFrom(that);
        mState = that.mState;
+4 −6
Original line number Diff line number Diff line
@@ -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);
@@ -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);
+18 −0
Original line number Diff line number Diff line
@@ -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 {