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

Commit 3beef087 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Add dummy SUB record in CDMA NV mode"

parents 268459c4 557eb082
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -552,4 +552,8 @@ public class PhoneFactory {
        }
        return phoneId;
    }

    public static SubInfoRecordUpdater getSubInfoRecordUpdater() {
        return sSubInfoRecordUpdater;
    }
}
+17 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ public class SubInfoRecordUpdater extends Handler {
    private static final int EVENT_ICC_CHANGED = 2;
    private static final int EVENT_STACK_READY = 3;
    private static final String ICCID_STRING_FOR_NO_SIM = "";
    private static final String ICCID_STRING_FOR_NV = "DUMMY_NV_ID";
    /**
     *  int[] sInsertSimState maintains all slots' SIM inserted status currently,
     *  it may contain 4 kinds of values:
@@ -95,6 +96,7 @@ public class SubInfoRecordUpdater extends Handler {
    private static TelephonyManager sTelephonyMgr = null;
    // To prevent repeatedly update flow every time receiver SIM_STATE_CHANGE
    private static boolean sNeedUpdate = true;
    private boolean isNVSubAvailable = false;

    public SubInfoRecordUpdater(Context context, Phone[] phoneProxy, CommandsInterface[] ci) {
        logd("Constructor invoked");
@@ -295,6 +297,10 @@ public class SubInfoRecordUpdater extends Handler {
        UiccCard newCard = mUiccController.getUiccCard(slotId);
        if (newCard != null) {
            newState = newCard.getCardState();
            if (!newState.isCardPresent() && isNVSubAvailable) {
                Rlog.i(LOG_TAG, "updateIccAvailability: Returning NV mode ");
                return;
            }
        } else {
            // Uicc Card is null return from here, this would be called
            // again after reading the SIM Card status from RIL.
@@ -367,6 +373,17 @@ public class SubInfoRecordUpdater extends Handler {
        }
    }

    public void updateSubIdForNV(int slotId) {
        sIccId[slotId] = ICCID_STRING_FOR_NV;
        sNeedUpdate = true;
        logd("[updateSubIdForNV]+ Start");
        if (isAllIccIdQueryDone()) {
            logd("[updateSubIdForNV]+ updating");
            updateSimInfoByIccId();
            isNVSubAvailable = true;
        }
    }

    synchronized public void updateSimInfoByIccId() {
        logd("[updateSimInfoByIccId]+ Start");
        sNeedUpdate = false;
+6 −0
Original line number Diff line number Diff line
@@ -57,10 +57,12 @@ import com.android.internal.telephony.MmiCode;
import com.android.internal.telephony.OperatorInfo;
import com.android.internal.telephony.PhoneBase;
import com.android.internal.telephony.PhoneConstants;
import com.android.internal.telephony.PhoneFactory;
import com.android.internal.telephony.PhoneNotifier;
import com.android.internal.telephony.PhoneProxy;
import com.android.internal.telephony.PhoneSubInfo;
import com.android.internal.telephony.ServiceStateTracker;
import com.android.internal.telephony.SubInfoRecordUpdater;
import com.android.internal.telephony.SubscriptionController;
import com.android.internal.telephony.TelephonyIntents;
import com.android.internal.telephony.TelephonyProperties;
@@ -1371,6 +1373,10 @@ public class CDMAPhone extends PhoneBase {
                log("notifyMessageWaitingChanged");
                mNotifier.notifyMessageWaitingChanged(this);
                updateVoiceMail();
                SubInfoRecordUpdater subInfoRecordUpdater = PhoneFactory.getSubInfoRecordUpdater();
                if (subInfoRecordUpdater != null) {
                    subInfoRecordUpdater.updateSubIdForNV (mPhoneId);
                }
            }
            break;