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

Commit ebb95bbe authored by Brad Ebinger's avatar Brad Ebinger Committed by Gerrit Code Review
Browse files

Merge "Fix emergency call failure over IMS after boot"

parents 4e135379 a2e398fd
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -1067,7 +1067,7 @@ public class GsmCdmaPhone extends Phone {
                && isEmergency
                && alwaysTryImsForEmergencyCarrierConfig
                && ImsManager.isNonTtyOrTtyOnVolteEnabled(mContext)
                && (imsPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF);
                && imsPhone.isImsAvailable();

        String dialPart = PhoneNumberUtils.extractNetworkPortionAlt(PhoneNumberUtils.
                stripSeparators(dialString));
@@ -1101,7 +1101,12 @@ public class GsmCdmaPhone extends Phone {
            } catch (CallStateException e) {
                if (DBG) logd("IMS PS call exception " + e +
                        "imsUseEnabled =" + imsUseEnabled + ", imsPhone =" + imsPhone);
                if (!Phone.CS_FALLBACK.equals(e.getMessage())) {
                // Do not throw a CallStateException and instead fall back to Circuit switch
                // for emergency calls and MMI codes.
                if (Phone.CS_FALLBACK.equals(e.getMessage()) || isEmergency) {
                    logi("IMS call failed with Exception: " + e.getMessage() + ". Falling back "
                            + "to CS.");
                } else {
                    CallStateException ce = new CallStateException(e.getMessage());
                    ce.setStackTrace(e.getStackTrace());
                    throw ce;
@@ -3395,6 +3400,10 @@ public class GsmCdmaPhone extends Phone {
        Rlog.d(LOG_TAG, "[GsmCdmaPhone] " + s);
    }

    private void logi(String s) {
        Rlog.i(LOG_TAG, "[GsmCdmaPhone] " + s);
    }

    private void loge(String s) {
        Rlog.e(LOG_TAG, "[GsmCdmaPhone] " + s);
    }
+12 −0
Original line number Diff line number Diff line
@@ -3300,6 +3300,18 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        return imsUseEnabled;
    }

    /**
     * Determines if the connection to IMS services are available yet.
     * @return {@code true} if the connection to IMS services are available.
     */
    public boolean isImsAvailable() {
        if (mImsPhone == null) {
            return false;
        }

        return mImsPhone.isImsAvailable();
    }

    /**
     * Determines if video calling is enabled for the phone.
     *
+5 −0
Original line number Diff line number Diff line
@@ -340,6 +340,11 @@ public class ImsPhone extends ImsPhoneBase {
        return mCT.mRingingCall;
    }

    @Override
    public boolean isImsAvailable() {
        return mCT.isImsServiceReady();
    }

    private boolean handleCallDeflectionIncallSupplementaryService(
            String dialString) {
        if (dialString.length() > 1) {
+8 −0
Original line number Diff line number Diff line
@@ -897,6 +897,14 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        return mPendingMO;
    }

    boolean isImsServiceReady() {
        if (mImsManager == null) {
            return false;
        }

        return mImsManager.isServiceAvailable();
    }

    /**
     * Caches frequently used carrier configuration items locally.
     *