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

Commit ef9e6afb authored by Hunsuk Choi's avatar Hunsuk Choi
Browse files

Notifies SRVCC state before closing ImsCall when SRVCC has completed

Bug: 263927721
Test: atest ImsPhoneCallTrackerTest
Change-Id: I566733fe8ca8e18471b9a7ffdf92a9097351b449
parent 9197be2c
Loading
Loading
Loading
Loading
+16 −16
Original line number Diff line number Diff line
@@ -4625,6 +4625,22 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
    public void notifySrvccState(int state) {
        if (DBG) log("notifySrvccState state=" + state);

        if (mImsManager != null) {
            try {
                if (state == TelephonyManager.SRVCC_STATE_HANDOVER_STARTED) {
                    mImsManager.notifySrvccStarted(mSrvccStartedCallback);
                } else if (state == TelephonyManager.SRVCC_STATE_HANDOVER_COMPLETED) {
                    mImsManager.notifySrvccCompleted();
                } else if (state == TelephonyManager.SRVCC_STATE_HANDOVER_FAILED) {
                    mImsManager.notifySrvccFailed();
                } else if (state == TelephonyManager.SRVCC_STATE_HANDOVER_CANCELED) {
                    mImsManager.notifySrvccCanceled();
                }
            } catch (ImsException e) {
                loge("notifySrvccState : exception " + e);
            }
        }

        switch(state) {
            case TelephonyManager.SRVCC_STATE_HANDOVER_STARTED:
                mSrvccState = Call.SrvccState.STARTED;
@@ -4656,22 +4672,6 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                //ignore invalid state
                return;
        }

        if (mImsManager != null) {
            try {
                if (mSrvccState == Call.SrvccState.STARTED) {
                    mImsManager.notifySrvccStarted(mSrvccStartedCallback);
                } else if (mSrvccState == Call.SrvccState.COMPLETED) {
                    mImsManager.notifySrvccCompleted();
                } else if (mSrvccState == Call.SrvccState.FAILED) {
                    mImsManager.notifySrvccFailed();
                } else if (mSrvccState == Call.SrvccState.CANCELED) {
                    mImsManager.notifySrvccCanceled();
                }
            } catch (ImsException e) {
                loge("notifySrvccState : exception " + e);
            }
        }
    }

    private void resetState() {