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

Commit e9070e6d authored by Wink Saville's avatar Wink Saville
Browse files

Don't set gsm.sim.operator.numeric to null

Bug: 9628781
Change-Id: I80c00584535a327f9e93c8bd0980178781cae6ff
parent 4a65a2c9
Loading
Loading
Loading
Loading
+12 −4
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.os.AsyncResult;
import android.os.Message;
import android.os.SystemProperties;
import android.telephony.Rlog;
import android.text.TextUtils;

import com.android.internal.telephony.CommandsInterface;
import com.android.internal.telephony.GsmAlphabet;
@@ -630,13 +631,20 @@ public final class RuimRecords extends IccRecords {
        // Further records that can be inserted are Operator/OEM dependent

        String operator = getRUIMOperatorNumeric();
        log("RuimRecords: onAllRecordsLoaded set 'gsm.sim.operator.numeric' to operator='" +
        if (!TextUtils.isEmpty(operator)) {
            log("onAllRecordsLoaded set 'gsm.sim.operator.numeric' to operator='" +
                    operator + "'");
            SystemProperties.set(PROPERTY_ICC_OPERATOR_NUMERIC, operator);
        } else {
            log("onAllRecordsLoaded empty 'gsm.sim.operator.numeric' skipping");
        }

        if (mImsi != null) {
        if (!TextUtils.isEmpty(mImsi)) {
            log("onAllRecordsLoaded set mcc imsi=" + mImsi);
            SystemProperties.set(PROPERTY_ICC_OPERATOR_ISO_COUNTRY,
                    MccTable.countryCodeForMcc(Integer.parseInt(mImsi.substring(0,3))));
        } else {
            log("onAllRecordsLoaded empty imsi skipping setting mcc");
        }

        setLocaleFromCsim();
+13 −8
Original line number Diff line number Diff line
@@ -1306,20 +1306,25 @@ public class SIMRecords extends IccRecords {

    @Override
    protected void onAllRecordsLoaded() {
        String operator = getOperatorNumeric();
        if (DBG) log("record load complete");

        // Some fields require more than one SIM record to set

        log("SIMRecords: onAllRecordsLoaded set 'gsm.sim.operator.numeric' to operator='" +
        String operator = getOperatorNumeric();
        if (!TextUtils.isEmpty(operator)) {
            log("onAllRecordsLoaded set 'gsm.sim.operator.numeric' to operator='" +
                    operator + "'");
            SystemProperties.set(PROPERTY_ICC_OPERATOR_NUMERIC, operator);
        } else {
            log("onAllRecordsLoaded empty 'gsm.sim.operator.numeric' skipping");
        }

        if (mImsi != null) {
        if (!TextUtils.isEmpty(mImsi)) {
            log("onAllRecordsLoaded set mcc imsi=" + mImsi);
            SystemProperties.set(PROPERTY_ICC_OPERATOR_ISO_COUNTRY,
                    MccTable.countryCodeForMcc(Integer.parseInt(mImsi.substring(0,3))));
        }
        else {
            loge("onAllRecordsLoaded: imsi is NULL!");
        } else {
            log("onAllRecordsLoaded empty imsi skipping setting mcc");
        }

        setVoiceMailByCountry(operator);