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

Commit 1b0477da authored by Wink Saville's avatar Wink Saville Committed by Android (Google) Code Review
Browse files

Merge "More cleanup prior to unhiding" into lmp-dev

parents dcef1a4b ba2ee896
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -127,7 +127,7 @@ public class IccProvider extends ContentProvider {
            long subId;

            for (int i = 0; i < subIdCount; i++) {
                subId = subInfoList.get(i).mSubId;
                subId = subInfoList.get(i).subId;
                result[i] = loadFromEf(efType, subId);
                Rlog.i(TAG,"ADN Records loaded for Subscription ::" + subId);
            }
+10 −10
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ public class SubInfoRecordUpdater extends Handler {
                                SubscriptionManager.getSubInfoUsingSubId(subId);

                        if (subInfo != null
                                && subInfo.mNameSource != SubscriptionManager.NAME_SOURCE_USER_INPUT) {
                                && subInfo.nameSource != SubscriptionManager.NAME_SOURCE_USER_INPUT) {
                            SpnOverride mSpnOverride = new SpnOverride();
                            String nameToSet;
                            String CarrierName =
@@ -202,9 +202,9 @@ public class SubInfoRecordUpdater extends Handler {
        SubInfoRecord subInfo = SubscriptionManager.getSubInfoUsingSubId(subId);
        if (subInfo != null) {
            // overwrite SIM display name if it is not assigned by user
            int oldNameSource = subInfo.mNameSource;
            String oldSubName = subInfo.mDisplayName;
            logd("[setDisplayNameForNewSub] mSubInfoIdx = " + subInfo.mSubId + ", oldSimName = "
            int oldNameSource = subInfo.nameSource;
            String oldSubName = subInfo.displayName;
            logd("[setDisplayNameForNewSub] mSubInfoIdx = " + subInfo.subId + ", oldSimName = "
                    + oldSubName + ", oldNameSource = " + oldNameSource + ", newSubName = "
                    + newSubName + ", newNameSource = " + newNameSource);
            if (oldSubName == null ||
@@ -212,7 +212,7 @@ public class SubInfoRecordUpdater extends Handler {
                (oldNameSource == SubscriptionManager.NAME_SOURCE_SIM_SOURCE && newSubName != null
                        && !newSubName.equals(oldSubName))) {
                SubscriptionManager.setDisplayName(newSubName,
                        subInfo.mSubId, newNameSource);
                        subInfo.subId, newNameSource);
            }
        } else {
            logd("SUB" + (subId + 1) + " SubInfo not created yet");
@@ -319,8 +319,8 @@ public class SubInfoRecordUpdater extends Handler {
            List<SubInfoRecord> oldSubInfo =
                    SubscriptionController.getInstance().getSubInfoUsingSlotIdWithCheck(i, false);
            if (oldSubInfo != null) {
                oldIccId[i] = oldSubInfo.get(0).mIccId;
                logd("oldSubId = " + oldSubInfo.get(0).mSubId);
                oldIccId[i] = oldSubInfo.get(0).iccId;
                logd("oldSubId = " + oldSubInfo.get(0).subId);
                if (sInsertSimState[i] == SIM_NOT_CHANGE && !sIccId[i].equals(oldIccId[i])) {
                    sInsertSimState[i] = SIM_CHANGED;
                }
@@ -329,7 +329,7 @@ public class SubInfoRecordUpdater extends Handler {
                    value.put(SubscriptionManager.SIM_ID, SubscriptionManager.INVALID_SLOT_ID);
                    contentResolver.update(SubscriptionManager.CONTENT_URI, value,
                            SubscriptionManager._ID + "="
                            + Long.toString(oldSubInfo.get(0).mSubId), null);
                            + Long.toString(oldSubInfo.get(0).subId), null);
                }
            } else {
                if (sInsertSimState[i] == SIM_NOT_CHANGE) {
@@ -396,13 +396,13 @@ public class SubInfoRecordUpdater extends Handler {
        for (int i=0; i<nSubCount; i++) {
            SubInfoRecord temp = subInfos.get(i);

            String msisdn = TelephonyManager.getDefault().getLine1Number(temp.mSubId);
            String msisdn = TelephonyManager.getDefault().getLine1Number(temp.subId);

            if (msisdn != null) {
                ContentValues value = new ContentValues(1);
                value.put(SubscriptionManager.NUMBER, msisdn);
                contentResolver.update(SubscriptionManager.CONTENT_URI, value,
                        SubscriptionManager._ID + "=" + Long.toString(temp.mSubId), null);
                        SubscriptionManager._ID + "=" + Long.toString(temp.subId), null);
            }
        }

+19 −19
Original line number Diff line number Diff line
@@ -204,37 +204,37 @@ public class SubscriptionController extends ISub.Stub {
     */
    private SubInfoRecord getSubInfoRecord(Cursor cursor) {
            SubInfoRecord info = new SubInfoRecord();
            info.mSubId = cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
            info.mIccId = cursor.getString(cursor.getColumnIndexOrThrow(
            info.subId = cursor.getLong(cursor.getColumnIndexOrThrow(BaseColumns._ID));
            info.iccId = cursor.getString(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.ICC_ID));
            info.mSlotId = cursor.getInt(cursor.getColumnIndexOrThrow(
            info.slotId = cursor.getInt(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.SIM_ID));
            info.mDisplayName = cursor.getString(cursor.getColumnIndexOrThrow(
            info.displayName = cursor.getString(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.DISPLAY_NAME));
            info.mNameSource = cursor.getInt(cursor.getColumnIndexOrThrow(
            info.nameSource = cursor.getInt(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.NAME_SOURCE));
            info.mColor = cursor.getInt(cursor.getColumnIndexOrThrow(
            info.color = cursor.getInt(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.COLOR));
            info.mNumber = cursor.getString(cursor.getColumnIndexOrThrow(
            info.number = cursor.getString(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.NUMBER));
            info.mDisplayNumberFormat = cursor.getInt(cursor.getColumnIndexOrThrow(
            info.displayNumberFormat = cursor.getInt(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.DISPLAY_NUMBER_FORMAT));
            info.mDataRoaming = cursor.getInt(cursor.getColumnIndexOrThrow(
            info.dataRoaming = cursor.getInt(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.DATA_ROAMING));

            int size = sSimBackgroundDarkRes.length;
            if (info.mColor >= 0 && info.mColor < size) {
                info.mSimIconRes[RES_TYPE_BACKGROUND_DARK] = sSimBackgroundDarkRes[info.mColor];
                info.mSimIconRes[RES_TYPE_BACKGROUND_LIGHT] = sSimBackgroundLightRes[info.mColor];
            if (info.color >= 0 && info.color < size) {
                info.simIconRes[RES_TYPE_BACKGROUND_DARK] = sSimBackgroundDarkRes[info.color];
                info.simIconRes[RES_TYPE_BACKGROUND_LIGHT] = sSimBackgroundLightRes[info.color];
            }
            info.mMcc = cursor.getInt(cursor.getColumnIndexOrThrow(
            info.mcc = cursor.getInt(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.MCC));
            info.mMnc = cursor.getInt(cursor.getColumnIndexOrThrow(
            info.mnc = cursor.getInt(cursor.getColumnIndexOrThrow(
                    SubscriptionManager.MNC));

            logd("[getSubInfoRecord] SubId:" + info.mSubId + " iccid:" + info.mIccId + " slotId:" +
                    info.mSlotId + " displayName:" + info.mDisplayName + " color:" + info.mColor +
                    " mcc/mnc:" + info.mMcc + "/" + info.mMnc);
            logd("[getSubInfoRecord] SubId:" + info.subId + " iccid:" + info.iccId + " slotId:" +
                    info.slotId + " displayName:" + info.displayName + " color:" + info.color +
                    " mcc/mnc:" + info.mcc + "/" + info.mnc);

            return info;
    }
@@ -1157,8 +1157,8 @@ public class SubscriptionController extends ISub.Stub {
            return false;
        }
        for (SubInfoRecord record : records) {
            logd("[shouldDefaultBeCleared] Record.mSubId: " + record.mSubId);
            if (record.mSubId == subId) {
            logd("[shouldDefaultBeCleared] Record.subId: " + record.subId);
            if (record.subId == subId) {
                return false;
            }
        }