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

Commit 115319ff authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Ims: Pack <RetryCallFailreason> and <RetryCallFailNetworkType>"

parents 50f500bd eb82873c
Loading
Loading
Loading
Loading
+19 −1
Original line number Diff line number Diff line
@@ -150,6 +150,8 @@ public class ImsPhone extends ImsPhoneBase {
        public static class Builder extends DialArgs.Builder<ImsDialArgs.Builder> {
            private android.telecom.Connection.RttTextStream mRttTextStream;
            private int mClirMode = CommandsInterface.CLIR_DEFAULT;
            private int mRetryCallFailCause = ImsReasonInfo.CODE_UNSPECIFIED;
            private int mRetryCallFailNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;

            public static ImsDialArgs.Builder from(DialArgs dialArgs) {
                return new ImsDialArgs.Builder()
@@ -164,7 +166,9 @@ public class ImsPhone extends ImsPhoneBase {
                        .setVideoState(dialArgs.videoState)
                        .setIntentExtras(dialArgs.intentExtras)
                        .setRttTextStream(dialArgs.rttTextStream)
                        .setClirMode(dialArgs.clirMode);
                        .setClirMode(dialArgs.clirMode)
                        .setRetryCallFailCause(dialArgs.retryCallFailCause)
                        .setRetryCallFailNetworkType(dialArgs.retryCallFailNetworkType);
            }

            public ImsDialArgs.Builder setRttTextStream(
@@ -178,6 +182,16 @@ public class ImsPhone extends ImsPhoneBase {
                return this;
            }

            public ImsDialArgs.Builder setRetryCallFailCause(int retryCallFailCause) {
                this.mRetryCallFailCause = retryCallFailCause;
                return this;
            }

            public ImsDialArgs.Builder setRetryCallFailNetworkType(int retryCallFailNetworkType) {
                this.mRetryCallFailNetworkType = retryCallFailNetworkType;
                return this;
            }

            public ImsDialArgs build() {
                return new ImsDialArgs(this);
            }
@@ -191,11 +205,15 @@ public class ImsPhone extends ImsPhoneBase {

        /** The CLIR mode to use */
        public final int clirMode;
        public final int retryCallFailCause;
        public final int retryCallFailNetworkType;

        private ImsDialArgs(ImsDialArgs.Builder b) {
            super(b);
            this.rttTextStream = b.mRttTextStream;
            this.clirMode = b.mClirMode;
            this.retryCallFailCause = b.mRetryCallFailCause;
            this.retryCallFailNetworkType = b.mRetryCallFailNetworkType;
        }
    }

+17 −1
Original line number Diff line number Diff line
@@ -1236,7 +1236,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {

        if (!holdBeforeDial) {
            if ((!isPhoneInEcmMode) || (isPhoneInEcmMode && isEmergencyNumber)) {
                dialInternal(mPendingMO, clirMode, videoState, dialArgs.intentExtras);
                dialInternal(mPendingMO, clirMode, videoState, dialArgs.retryCallFailCause,
                        dialArgs.retryCallFailNetworkType, dialArgs.intentExtras);
            } else {
                try {
                    getEcbmInterface().exitEmergencyCallbackMode();
@@ -1422,6 +1423,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {

    private void dialInternal(ImsPhoneConnection conn, int clirMode, int videoState,
            Bundle intentExtras) {
        dialInternal(conn, clirMode, videoState, ImsReasonInfo.CODE_UNSPECIFIED,
                TelephonyManager.NETWORK_TYPE_UNKNOWN, intentExtras);
    }

    private void dialInternal(ImsPhoneConnection conn, int clirMode, int videoState,
            int retryCallFailCause, int retryCallFailNetworkType, Bundle intentExtras) {

        if (conn == null) {
            return;
@@ -1452,6 +1459,10 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                profile.setCallExtraBoolean(ImsCallProfile.EXTRA_CONFERENCE, true);
            }
            profile.setCallExtraInt(ImsCallProfile.EXTRA_OIR, clirMode);
            profile.setCallExtraInt(ImsCallProfile.EXTRA_RETRY_CALL_FAIL_REASON,
                    retryCallFailCause);
            profile.setCallExtraInt(ImsCallProfile.EXTRA_RETRY_CALL_FAIL_NETWORKTYPE,
                    retryCallFailNetworkType);

            if (isEmergencyCall) {
                // Set emergency call information in ImsCallProfile
@@ -3944,7 +3955,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
                    mPendingMO = null;
                    ImsDialArgs newDialArgs = ImsDialArgs.Builder.from(mLastDialArgs)
                            .setRttTextStream(null)
                            .setRetryCallFailCause(ImsReasonInfo.CODE_RETRY_ON_IMS_WITHOUT_RTT)
                            .setRetryCallFailNetworkType(
                                    ServiceState.rilRadioTechnologyToNetworkType(
                                    oldConnection.getCallRadioTech()))
                            .build();

                    Connection newConnection =
                            mPhone.getDefaultPhone().dial(mLastDialString, newDialArgs);
                    oldConnection.onOriginalConnectionReplaced(newConnection);