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

Commit 9641dae3 authored by emancebo's avatar emancebo Committed by Ed Mancebo
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
(cherry picked from commit 7cb74ed5)
parent 806eff3f
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -226,10 +226,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