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

Commit a195de98 authored by Jordan Liu's avatar Jordan Liu Committed by android-build-merger
Browse files

Merge "Merge isInEcm for GsmCdmaPhone and ImsPhone" am: 73e1b75d am: 502e8795

am: 9e3f4128

Change-Id: I5331ca34c343bafaac6f7d2a75006c340bbe6a20
parents 49e2bbc3 9e3f4128
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -124,9 +124,6 @@ public class GsmCdmaPhone extends Phone {
    // mEriFileLoadedRegistrants are informed after the ERI text has been loaded
    private final RegistrantList mEriFileLoadedRegistrants = new RegistrantList();
    // mEcmExitRespRegistrant is informed after the phone has been exited
    //the emergency callback mode
    //keep track of if phone is in emergency callback mode
    private boolean mIsPhoneInEcmState;
    private Registrant mEcmExitRespRegistrant;
    private String mEsn;
    private String mMeid;
@@ -279,8 +276,7 @@ public class GsmCdmaPhone extends Phone {
        } else {
            mCdmaSubscriptionSource = CdmaSubscriptionSourceManager.SUBSCRIPTION_SOURCE_UNKNOWN;
            // This is needed to handle phone process crashes
            String inEcm = SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
            mIsPhoneInEcmState = inEcm.equals("true");
            mIsPhoneInEcmState = getInEcmMode();
            if (mIsPhoneInEcmState) {
                // Send a message which will invoke handleExitEmergencyCallbackMode
                mCi.exitEmergencyCallbackMode(
+13 −1
Original line number Diff line number Diff line
@@ -235,6 +235,10 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    /* Used for communicate between configured CarrierSignalling receivers */
    private CarrierSignalAgent mCarrierSignalAgent;

    // Keep track of whether or not the phone is in Emergency Callback Mode for Phone and
    // subclasses
    protected boolean mIsPhoneInEcmState = false;

    // Variable to cache the video capability. When RAT changes, we lose this info and are unable
    // to recover from the state. We cache it and notify listeners when they register.
    protected boolean mIsVideoCapable = false;
@@ -2054,13 +2058,21 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        return false;
    }

    // This property is used to handle phone process crashes, and is the same for CDMA and IMS
    // phones
    protected static boolean getInEcmMode() {
        return SystemProperties.getBoolean(TelephonyProperties.PROPERTY_INECM_MODE, false);
    }

    /**
     * @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 false;
        return mIsPhoneInEcmState;
    }

    private static int getVideoState(Call call) {
+1 −8
Original line number Diff line number Diff line
@@ -139,7 +139,6 @@ public class ImsPhone extends ImsPhoneBase {
    private String mLastDialString;

    private WakeLock mWakeLock;
    private boolean mIsPhoneInEcmState;

    // mEcmExitRespRegistrant is informed after the phone has been exited the emergency
    // callback mode keep track of if phone is in emergency callback mode
@@ -216,8 +215,7 @@ public class ImsPhone extends ImsPhoneBase {

        // This is needed to handle phone process crashes
        // Same property is used for both CDMA & IMS phone.
        mIsPhoneInEcmState = SystemProperties.getBoolean(
                TelephonyProperties.PROPERTY_INECM_MODE, false);
        mIsPhoneInEcmState = getInEcmMode();

        PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG);
@@ -1298,11 +1296,6 @@ public class ImsPhone extends ImsPhoneBase {
        return mCT.isInEmergencyCall();
    }

    @Override
    public boolean isInEcm() {
        return mIsPhoneInEcmState;
    }

    private void sendEmergencyCallbackModeChange() {
        // Send an Intent
        Intent intent = new Intent(TelephonyIntents.ACTION_EMERGENCY_CALLBACK_MODE_CHANGED);