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

Commit 1592d204 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Don't return false if the Phone is GSM for ECBM

ECBM can still be triggered on CDMA+LTE voice
RATs when there is no SIM and the phone camps
on a CDMA+LTE network. We should still be able
to get into ECBM in these cases.

This change removes the GSM only check for
isInEcm().

Bug: 62042256
Test: Build and run
Merged-In: I4f023339968631d2a34146f9ff1f5b4a58e1e656
Change-Id: I4f023339968631d2a34146f9ff1f5b4a58e1e656
parent ea130bb3
Loading
Loading
Loading
Loading
+12 −17
Original line number Diff line number Diff line
@@ -616,20 +616,11 @@ public class GsmCdmaPhone extends Phone {
        }
    }

    @Override
    public boolean isInEcm() {
        if (isPhoneTypeGsm()) {
            return false;
        } else {
            return mIsPhoneInEcmState;
        }
    }

    //CDMA
    private void sendEmergencyCallbackModeChange(){
        //Send an Intent
        Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);
        intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, mIsPhoneInEcmState);
        intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, isInEcm());
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
        ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL);
        if (DBG) logd("sendEmergencyCallbackModeChange");
@@ -2763,6 +2754,10 @@ public class GsmCdmaPhone extends Phone {

    @Override
    public void exitEmergencyCallbackMode() {
        if (DBG) {
            Rlog.d(LOG_TAG, "exitEmergencyCallbackMode: mImsPhone=" + mImsPhone
                    + " isPhoneTypeGsm=" + isPhoneTypeGsm());
        }
        if (isPhoneTypeGsm()) {
            if (mImsPhone != null) {
                mImsPhone.exitEmergencyCallbackMode();
@@ -2779,11 +2774,11 @@ public class GsmCdmaPhone extends Phone {
    //CDMA
    private void handleEnterEmergencyCallbackMode(Message msg) {
        if (DBG) {
            Rlog.d(LOG_TAG, "handleEnterEmergencyCallbackMode,mIsPhoneInEcmState= "
                    + mIsPhoneInEcmState);
            Rlog.d(LOG_TAG, "handleEnterEmergencyCallbackMode, isInEcm()="
                    + isInEcm());
        }
        // if phone is not in Ecm mode, and it's changed to Ecm mode
        if (!mIsPhoneInEcmState) {
        if (!isInEcm()) {
            setIsInEcm(true);

            // notify change
@@ -2803,8 +2798,8 @@ public class GsmCdmaPhone extends Phone {
    private void handleExitEmergencyCallbackMode(Message msg) {
        AsyncResult ar = (AsyncResult)msg.obj;
        if (DBG) {
            Rlog.d(LOG_TAG, "handleExitEmergencyCallbackMode,ar.exception , mIsPhoneInEcmState "
                    + ar.exception + mIsPhoneInEcmState);
            Rlog.d(LOG_TAG, "handleExitEmergencyCallbackMode,ar.exception , isInEcm="
                    + ar.exception + isInEcm());
        }
        // Remove pending exit Ecm runnable, if any
        removeCallbacks(mExitEcmRunnable);
@@ -2814,7 +2809,7 @@ public class GsmCdmaPhone extends Phone {
        }
        // if exiting ecm success
        if (ar.exception == null) {
            if (mIsPhoneInEcmState) {
            if (isInEcm()) {
                setIsInEcm(false);
            }

@@ -3249,7 +3244,7 @@ public class GsmCdmaPhone extends Phone {
        pw.println(" mCdmaSubscriptionSource=" + mCdmaSubscriptionSource);
        pw.println(" mEriManager=" + mEriManager);
        pw.println(" mWakeLock=" + mWakeLock);
        pw.println(" mIsPhoneInEcmState=" + mIsPhoneInEcmState);
        pw.println(" isInEcm()=" + isInEcm());
        if (VDBG) pw.println(" mEsn=" + mEsn);
        if (VDBG) pw.println(" mMeid=" + mMeid);
        pw.println(" mCarrierOtaSpNumSchema=" + mCarrierOtaSpNumSchema);
+0 −2
Original line number Diff line number Diff line
@@ -2153,8 +2153,6 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
     * @return {@code true} if we are in emergency call back mode. This is a period where the phone
     * should be using as little power as possible and be ready to receive an incoming call from the
     * emergency operator.
     *
     * This method is overridden for GSM phones to return false always
     */
    public boolean isInEcm() {
        return mIsPhoneInEcmState;
+1 −1
Original line number Diff line number Diff line
@@ -1335,7 +1335,7 @@ public class ImsPhone extends ImsPhoneBase {
        intent.putExtra(PhoneConstants.PHONE_IN_ECM_STATE, isInEcm());
        SubscriptionManager.putPhoneIdAndSubIdExtra(intent, getPhoneId());
        ActivityManagerNative.broadcastStickyIntent(intent, null, UserHandle.USER_ALL);
        if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallbackModeChange");
        if (DBG) Rlog.d(LOG_TAG, "sendEmergencyCallbackModeChange: isInEcm=" + isInEcm());
    }

    @Override