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

Commit afe1d9ac authored by Etan Cohen's avatar Etan Cohen Committed by Android (Google) Code Review
Browse files

Merge "Allow normal voice calls on CS phone only when in service." into mnc-dev

parents 5126dae3 9ff6605e
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -427,6 +427,7 @@ public class CDMAPhone extends PhoneBase {
            throw new CallStateException("Sending UUS information NOT supported in CDMA!");
            throw new CallStateException("Sending UUS information NOT supported in CDMA!");
        }
        }


        boolean isEmergency = PhoneNumberUtils.isEmergencyNumber(dialString);
        ImsPhone imsPhone = mImsPhone;
        ImsPhone imsPhone = mImsPhone;


        boolean imsUseEnabled = isImsUseEnabled()
        boolean imsUseEnabled = isImsUseEnabled()
@@ -435,7 +436,7 @@ public class CDMAPhone extends PhoneBase {
                 && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE);
                 && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE);


        boolean useImsForEmergency = imsPhone != null
        boolean useImsForEmergency = imsPhone != null
                && PhoneNumberUtils.isEmergencyNumber(dialString)
                && isEmergency
                &&  mContext.getResources().getBoolean(
                &&  mContext.getResources().getBoolean(
                        com.android.internal.R.bool.useImsAlwaysForEmergencyCall)
                        com.android.internal.R.bool.useImsAlwaysForEmergencyCall)
                && ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext)
                && ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext)
@@ -470,6 +471,10 @@ public class CDMAPhone extends PhoneBase {
            }
            }
        }
        }


        if ((mSST != null) && (mSST.mSS.getState() == ServiceState.STATE_OUT_OF_SERVICE)
                && !isEmergency) {
            throw new CallStateException("cannot dial in current state");
        }
        if (DBG) Rlog.d(LOG_TAG, "Trying (non-IMS) CS call");
        if (DBG) Rlog.d(LOG_TAG, "Trying (non-IMS) CS call");
        return dialInternal(dialString, null, videoState, intentExtras);
        return dialInternal(dialString, null, videoState, intentExtras);
    }
    }
+6 −1
Original line number Original line Diff line number Diff line
@@ -802,6 +802,7 @@ public class GSMPhone extends PhoneBase {
    public Connection
    public Connection
    dial (String dialString, UUSInfo uusInfo, int videoState, Bundle intentExtras)
    dial (String dialString, UUSInfo uusInfo, int videoState, Bundle intentExtras)
            throws CallStateException {
            throws CallStateException {
        boolean isEmergency = PhoneNumberUtils.isEmergencyNumber(dialString);
        ImsPhone imsPhone = mImsPhone;
        ImsPhone imsPhone = mImsPhone;


        boolean imsUseEnabled = isImsUseEnabled()
        boolean imsUseEnabled = isImsUseEnabled()
@@ -810,7 +811,7 @@ public class GSMPhone extends PhoneBase {
                 && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE);
                 && (imsPhone.getServiceState().getState() == ServiceState.STATE_IN_SERVICE);


        boolean useImsForEmergency = imsPhone != null
        boolean useImsForEmergency = imsPhone != null
                && PhoneNumberUtils.isEmergencyNumber(dialString)
                && isEmergency
                &&  mContext.getResources().getBoolean(
                &&  mContext.getResources().getBoolean(
                        com.android.internal.R.bool.useImsAlwaysForEmergencyCall)
                        com.android.internal.R.bool.useImsAlwaysForEmergencyCall)
                && ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext)
                && ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext)
@@ -845,6 +846,10 @@ public class GSMPhone extends PhoneBase {
            }
            }
        }
        }


        if ((mSST != null) && (mSST.mSS.getState() == ServiceState.STATE_OUT_OF_SERVICE)
                && !isEmergency) {
            throw new CallStateException("cannot dial in current state");
        }
        if (LOCAL_DEBUG) Rlog.d(LOG_TAG, "Trying (non-IMS) CS call");
        if (LOCAL_DEBUG) Rlog.d(LOG_TAG, "Trying (non-IMS) CS call");
        return dialInternal(dialString, null, VideoProfile.STATE_AUDIO_ONLY, intentExtras);
        return dialInternal(dialString, null, VideoProfile.STATE_AUDIO_ONLY, intentExtras);
    }
    }