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

Commit 59cef118 authored by Jordan Liu's avatar Jordan Liu
Browse files

Do not set "gsm.operator.idpstring" per phoneId

Do not set "gsm.operator.idpstring" per phoneId, otherwise
PhoneNumberUtils does not get the right value.

Test: ServiceStateTrackerTest.java and some manual tests
Fixes: 62048110
Change-Id: I540846d9208f84ff48b6830d45c66abfb16a8a54
parent 0693a340
Loading
Loading
Loading
Loading
+0 −12
Original line number Diff line number Diff line
@@ -671,18 +671,6 @@ public class GsmCdmaPhone extends Phone {
        mNotifier.notifyCallForwardingChanged(this);
    }

    // override for allowing access from other classes of this package
    /**
     * {@inheritDoc}
     */
    @Override
    public void setSystemProperty(String property, String value) {
        if (getUnitTestMode()) {
            return;
        }
        TelephonyManager.setTelephonyProperty(mPhoneId, property, value);
    }

    @Override
    public void registerForSuppServiceNotification(
            Handler h, int what, Object obj) {
+14 −4
Original line number Diff line number Diff line
@@ -408,14 +408,24 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    }

    /**
     * Set a system property, unless we're in unit test mode
     * Set a system property for the current phone, unless we're in unit test mode
     */
    // CAF_MSIM TODO this need to be replated with TelephonyManager API ?
    public void setSystemProperty(String property, String value) {
        if (getUnitTestMode()) {
            return;
        }
        SystemProperties.set(property, value);
        TelephonyManager.setTelephonyProperty(mPhoneId, property, value);
    }

    /**
     * Set a system property for all phones, unless we're in unit test mode
     */
    public void setGlobalSystemProperty(String property, String value) {
        if (getUnitTestMode()) {
            return;
        }
        TelephonyManager.setTelephonyProperty(property, value);
    }

    /**
@@ -2159,7 +2169,7 @@ public abstract class Phone extends Handler implements PhoneInternalInterface {
    }

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

+2 −2
Original line number Diff line number Diff line
@@ -3050,11 +3050,11 @@ public class ServiceStateTracker extends Handler {
        String idd = mHbpcdUtils.getIddByMcc(
                Integer.parseInt(operatorNumeric.substring(0,3)));
        if (idd != null && !idd.isEmpty()) {
            mPhone.setSystemProperty(TelephonyProperties.PROPERTY_OPERATOR_IDP_STRING,
            mPhone.setGlobalSystemProperty(TelephonyProperties.PROPERTY_OPERATOR_IDP_STRING,
                    idd);
        } else {
            // use default "+", since we don't know the current IDP
            mPhone.setSystemProperty(TelephonyProperties.PROPERTY_OPERATOR_IDP_STRING, "+");
            mPhone.setGlobalSystemProperty(TelephonyProperties.PROPERTY_OPERATOR_IDP_STRING, "+");
        }
    }