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

Commit d9952fcd authored by Brad Ebinger's avatar Brad Ebinger Committed by android-build-merger
Browse files

Merge "Fix emergency call failure over IMS after boot" am: ebb95bbe

am: 75417bac

Change-Id: I9d00b313a1af95a7106726ca1bda3f375020b42e
parents 995d4301 75417bac
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -1070,7 +1070,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));
@@ -1104,7 +1104,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;
@@ -3428,6 +3433,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
@@ -3325,6 +3325,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
@@ -342,6 +342,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
@@ -902,6 +902,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.
     *