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

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

Merge "Refactor IMSI and SubscriberId handling for CDMAPhone/CDMALTEPhone"

parents aec27a62 a854e15b
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -237,11 +237,14 @@ public class CDMALTEPhone extends CDMAPhone {
        return false;
    }

    // return IMSI from USIM as subscriber ID.
   @Override
   public String getSubscriberId() {
       if ((super.getSubscriberId()) != null) {
           return super.getSubscriberId();
       } else {
           return (mSimRecords != null) ? mSimRecords.getIMSI() : "";
       }
   }

    // return GID1 from USIM
    @Override
+9 −1
Original line number Diff line number Diff line
@@ -532,7 +532,15 @@ public class CDMAPhone extends PhoneBase {

    @Override
    public String getSubscriberId() {
        return mSST.getImsi();
        if (mCdmaSubscriptionSource == CDMA_SUBSCRIPTION_NV) {
            return mSST.getNvImsi();
        } else {
            IccRecords r = mIccRecords.get();
            if (r != null) {
                return r.getIMSI();
            }
        }
        return null;
    }

    @Override
+3 −15
Original line number Diff line number Diff line
@@ -414,17 +414,6 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
                    mIsMinInfoReady = true;

                    updateOtaspState();
                    if (!mIsSubscriptionFromRuim && mIccRecords != null) {
                        if (DBG) {
                            log("GET_CDMA_SUBSCRIPTION set imsi in mIccRecords");
                        }
                        mIccRecords.setImsi(getImsi());
                    } else {
                        if (DBG) {
                            log("GET_CDMA_SUBSCRIPTION either mIccRecords is null  or NV type device" +
                                    " - not setting Imsi in mIccRecords");
                        }
                    }
                } else {
                    if (DBG) {
                        log("GET_CDMA_SUBSCRIPTION: error parsing cdmaSubscription params num="
@@ -1642,12 +1631,11 @@ public class CdmaServiceStateTracker extends ServiceStateTracker {
    }

    /**
     * Returns IMSI as MCC + MNC + MIN
     * Returns IMSI from NV in the format MCC + MNC + MIN
     */
    public String getImsi() {
        // TODO: When RUIM is enabled, IMSI will come from RUIM not build-time props.
    public String getNvImsi() {
        String operatorNumeric = getSystemProperty(
                TelephonyProperties.PROPERTY_ICC_OPERATOR_NUMERIC, "");
                CDMAPhone.PROPERTY_CDMA_HOME_OPERATOR_NUMERIC, "");

        if (!TextUtils.isEmpty(operatorNumeric) && getCdmaMin() != null) {
            return (operatorNumeric + getCdmaMin());
+1 −10
Original line number Diff line number Diff line
@@ -256,16 +256,7 @@ public abstract class IccRecords extends Handler implements IccConstants {
     * @return null if SIM is not yet ready or unavailable
     */
    public String getIMSI() {
        return null;
    }

    /**
     * Imsi could be set by ServiceStateTrackers in case of cdma
     * @param imsi
     */
    public void setImsi(String imsi) {
        mImsi = imsi;
        mImsiReadyRegistrants.notifyRegistrants();
        return mImsi;
    }

    public String getMsisdnNumber() {
+0 −5
Original line number Diff line number Diff line
@@ -149,11 +149,6 @@ public final class RuimRecords extends IccRecords {
        mRecordsRequested = false;
    }

    @Override
    public String getIMSI() {
        return mImsi;
    }

    public String getMdnNumber() {
        return mMyMobileNumber;
    }