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

Commit 7cb74ed5 authored by emancebo's avatar emancebo
Browse files

telephony: read IMSI from CSIM if available in CDMALTEPhone

mIccRecords is initialized from CSIM in CDMAPhone if available, otherwise
it falls back to USIM.  Read subscriber ID from here so that we prefer
CSIM.

Change-Id: I603518a032883d0541d9dccd81621796ab5892d6
parent c554a89f
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -251,10 +251,20 @@ public class CDMALTEPhone extends CDMAPhone {
        return false;
    }

    // return IMSI from USIM as subscriber ID.
    // return IMSI from CSIM as subscriber ID if available, otherwise reads from USIM
    @Override
    public String getSubscriberId() {
        return (mSimRecords != null) ? mSimRecords.getIMSI() : "";
        IccRecords r = (mIccRecords != null) ? mIccRecords.get() : null;
        if (r != null) {
            String imsi = r.getIMSI();
            if (!TextUtils.isEmpty(imsi)) {
                log("IMSI = " + imsi);
                return imsi;
            }
        }

        log("IMSI undefined");
        return "";
    }

    // return GID1 from USIM