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

Commit 94ae0fe7 authored by Gabriele M's avatar Gabriele M
Browse files

GsmCdmaPhone: Return dummy ICCID serial for NV sub

In case of NV sub there's no ICC, so both getIccSerialNumber()
and getFullIccSerialNumber() return null.

Since getFullIccSerialNumber() is used to set/get the ID of
each PhoneAccountHandle, devices with NV subs can't register
proper phone accounts other than the emergency one.

getIccSerialNumber() is instead used by CarrierConfigLoader
to store and load configs.

Fix both the problems forcing dummy serials for NV subscriptions.

Change-Id: I610115e9d9f5b3b86b36fddcf13dbed6387e377c
parent c5c2808b
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -142,6 +142,7 @@ public class GsmCdmaPhone extends Phone {
    };
    };
    public static final String PROPERTY_CDMA_HOME_OPERATOR_NUMERIC =
    public static final String PROPERTY_CDMA_HOME_OPERATOR_NUMERIC =
            "ro.cdma.home.operator.numeric";
            "ro.cdma.home.operator.numeric";
    private static final String DUMMY_NV_ICC_SERIAL = "DUMMY_NV_ICC_SERIAL";


    //CDMALTE
    //CDMALTE
    /** PHONE_TYPE_CDMA_LTE in addition to RuimRecords needs access to SIMRecords and
    /** PHONE_TYPE_CDMA_LTE in addition to RuimRecords needs access to SIMRecords and
@@ -744,6 +745,9 @@ public class GsmCdmaPhone extends Phone {


    @Override
    @Override
    public String getIccSerialNumber() {
    public String getIccSerialNumber() {
        if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_NV) {
            return DUMMY_NV_ICC_SERIAL;
        }
        IccRecords r = mIccRecords.get();
        IccRecords r = mIccRecords.get();
        if (!isPhoneTypeGsm() && r == null) {
        if (!isPhoneTypeGsm() && r == null) {
            // to get ICCID form SIMRecords because it is on MF.
            // to get ICCID form SIMRecords because it is on MF.
@@ -754,6 +758,9 @@ public class GsmCdmaPhone extends Phone {


    @Override
    @Override
    public String getFullIccSerialNumber() {
    public String getFullIccSerialNumber() {
        if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_NV) {
            return DUMMY_NV_ICC_SERIAL;
        }
        IccRecords r = mIccRecords.get();
        IccRecords r = mIccRecords.get();
        if (!isPhoneTypeGsm() && r == null) {
        if (!isPhoneTypeGsm() && r == null) {
            // to get ICCID form SIMRecords because it is on MF.
            // to get ICCID form SIMRecords because it is on MF.