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

Commit 3ede2787 authored by Shuo Qian's avatar Shuo Qian Committed by android-build-merger
Browse files

Merge "ECBM SystemProperty cleanup" am: 36c8c93d

am: fc753c99

Change-Id: I7728a487f6e533cb2fea3daf74695a6c0629866d
parents d2575e75 fc753c99
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -398,8 +398,7 @@ public class GsmCdmaCallTracker extends CallTracker {
            dialString = convertNumberIfNecessary(mPhone, dialString);
            dialString = convertNumberIfNecessary(mPhone, dialString);
        }
        }


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


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

            // notify change
            // notify change
            sendEmergencyCallbackModeChange();
            sendEmergencyCallbackModeChange();


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


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


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

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


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


        mPhoneId = mDefaultPhone.getPhoneId();
        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);
        PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG);
        mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, LOG_TAG);
        mWakeLock.setReferenceCounted(false);
        mWakeLock.setReferenceCounted(false);
@@ -521,6 +517,16 @@ public class ImsPhone extends ImsPhoneBase {
               ringingCallState.isAlive());
               ringingCallState.isAlive());
    }
    }


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

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

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


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


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


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