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

Commit 36c8c93d authored by Shuo Qian's avatar Shuo Qian Committed by Gerrit Code Review
Browse files

Merge "ECBM SystemProperty cleanup"

parents c1b980a1 77d3034a
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -398,8 +398,7 @@ public class GsmCdmaCallTracker extends CallTracker {
            dialString = convertNumberIfNecessary(mPhone, dialString);
        }

        String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
        boolean isPhoneInEcmMode = inEcm.equals("true");
        boolean isPhoneInEcmMode = mPhone.isInEcm();
        boolean isEmergencyCall =
                PhoneNumberUtils.isLocalEmergencyNumber(mPhone.getContext(), dialString);

@@ -1550,11 +1549,11 @@ public class GsmCdmaCallTracker extends CallTracker {
    private void checkAndEnableDataCallAfterEmergencyCallDropped() {
        if (mIsInEmergencyCall) {
            mIsInEmergencyCall = false;
            String inEcm=SystemProperties.get(TelephonyProperties.PROPERTY_INECM_MODE, "false");
            boolean inEcm = mPhone.isInEcm();
            if (Phone.DEBUG_PHONE) {
                log("checkAndEnableDataCallAfterEmergencyCallDropped,inEcm=" + inEcm);
            }
            if (inEcm.compareTo("false") == 0) {
            if (!inEcm) {
                // Re-initiate data connection
                mPhone.mDcTracker.setInternalDataEnabled(true);
                mPhone.notifyEmergencyCallRegistrants(false);
+4 −5
Original line number Diff line number Diff line
@@ -2717,9 +2717,9 @@ public class GsmCdmaPhone extends Phone {
                    + mIsPhoneInEcmState);
        }
        // if phone is not in Ecm mode, and it's changed to Ecm mode
        if (mIsPhoneInEcmState == false) {
            setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "true");
            mIsPhoneInEcmState = true;
        if (!mIsPhoneInEcmState) {
            setIsInEcm(true);

            // notify change
            sendEmergencyCallbackModeChange();

@@ -2749,8 +2749,7 @@ public class GsmCdmaPhone extends Phone {
        // if exiting ecm success
        if (ar.exception == null) {
            if (mIsPhoneInEcmState) {
                setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "false");
                mIsPhoneInEcmState = false;
                setIsInEcm(false);
            }

            // release wakeLock
+5 −0
Original line number Diff line number Diff line
@@ -2143,6 +2143,11 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
        return mIsPhoneInEcmState;
    }

    public void setIsInEcm(boolean isInEcm) {
        setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, String.valueOf(isInEcm));
        mIsPhoneInEcmState = isInEcm;
    }

    private static int getVideoState(Call call) {
        int videoState = VideoProfile.STATE_AUDIO_ONLY;
        Connection conn = call.getEarliestConnection();
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ public class CdmaSMSDispatcher extends SMSDispatcher {

    @Override
    protected void sendSubmitPdu(SmsTracker tracker) {
        if (SystemProperties.getBoolean(TelephonyProperties.PROPERTY_INECM_MODE, false)) {
        if (mPhone.isInEcm()) {
            if (VDBG) {
                Rlog.d(TAG, "Block SMS in Emergency Callback mode");
            }
+18 −14
Original line number Diff line number Diff line
@@ -213,10 +213,6 @@ public class ImsPhone extends ImsPhoneBase {

        mPhoneId = mDefaultPhone.getPhoneId();

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

        PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG);
        mWakeLock.setReferenceCounted(false);
@@ -521,6 +517,16 @@ public class ImsPhone extends ImsPhoneBase {
               ringingCallState.isAlive());
    }

    @Override
    public boolean isInEcm() {
        return mDefaultPhone.isInEcm();
    }

    @Override
    public void setIsInEcm(boolean isInEcm){
        mDefaultPhone.setIsInEcm(isInEcm);
    }

    public void notifyNewRingingConnection(Connection c) {
        mDefaultPhone.notifyNewRingingConnectionP(c);
    }
@@ -1299,7 +1305,7 @@ public class ImsPhone extends ImsPhoneBase {
    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) Rlog.d(LOG_TAG, "sendEmergencyCallbackModeChange");
@@ -1325,12 +1331,11 @@ public class ImsPhone extends ImsPhoneBase {
    private void handleEnterEmergencyCallbackMode() {
        if (DBG) {
            Rlog.d(LOG_TAG, "handleEnterEmergencyCallbackMode,mIsPhoneInEcmState= "
                    + mIsPhoneInEcmState);
                    + isInEcm());
        }
        // if phone is not in Ecm mode, and it's changed to Ecm mode
        if (mIsPhoneInEcmState == false) {
            setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "true");
            mIsPhoneInEcmState = true;
        if (!isInEcm()) {
            setIsInEcm(true);
            // notify change
            sendEmergencyCallbackModeChange();

@@ -1347,12 +1352,11 @@ public class ImsPhone extends ImsPhoneBase {
    private void handleExitEmergencyCallbackMode() {
        if (DBG) {
            Rlog.d(LOG_TAG, "handleExitEmergencyCallbackMode: mIsPhoneInEcmState = "
                    + mIsPhoneInEcmState);
                    + isInEcm());
        }

        if (mIsPhoneInEcmState) {
            setSystemProperty(TelephonyProperties.PROPERTY_INECM_MODE, "false");
            mIsPhoneInEcmState = false;
        if (isInEcm()) {
            setIsInEcm(false);
        }

        // Remove pending exit Ecm runnable, if any
@@ -1642,7 +1646,7 @@ public class ImsPhone extends ImsPhoneBase {
        pw.println("  mPostDialHandler = " + mPostDialHandler);
        pw.println("  mSS = " + mSS);
        pw.println("  mWakeLock = " + mWakeLock);
        pw.println("  mIsPhoneInEcmState = " + mIsPhoneInEcmState);
        pw.println("  mIsPhoneInEcmState = " + isInEcm());
        pw.println("  mEcmExitRespRegistrant = " + mEcmExitRespRegistrant);
        pw.println("  mSilentRedialRegistrants = " + mSilentRedialRegistrants);
        pw.println("  mImsRegistered = " + mImsRegistered);
Loading