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

Commit 00129834 authored by emancebo's avatar emancebo Committed by Howard Harte
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.

JIRA: RENDANG-295

Change-Id: I603518a032883d0541d9dccd81621796ab5892d6
(cherry picked from commit 7cb74ed5)
(cherry picked from commit e2572955)
parent fddb1d91
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -233,10 +233,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 "";
    }