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

Commit 2ea7e443 authored by John Wang's avatar John Wang
Browse files

Add getImei() to Phone interface.

Need IMEI to be displayed in LTE Settings. Since getDeviceId() returns MEID for LTE device,
getImei() is added to return IMEI for all devices. getImei returns null if not set (as SipPhone).

bug:4983512
Change-Id: Idfe2ec8de514f330248db7a9de7e241f9a38cb96
parent 4821d3bd
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1429,6 +1429,11 @@ public interface Phone {
     */
    String getMeid();

    /**
     * Retrieves IMEI for phones. Returns null if IMEI is not set.
     */
    String getImei();

    /**
     * Retrieves the PhoneSubInfo of the Phone
     */
+4 −0
Original line number Diff line number Diff line
@@ -685,6 +685,10 @@ public class PhoneProxy extends Handler implements Phone {
        return mActivePhone.getMeid();
    }

    public String getImei() {
        return mActivePhone.getImei();
    }

    public PhoneSubInfo getPhoneSubInfo(){
        return mActivePhone.getPhoneSubInfo();
    }
+5 −0
Original line number Diff line number Diff line
@@ -135,6 +135,11 @@ public class CDMALTEPhone extends CDMAPhone {
        return mIccRecords.getIMSI();
    }

    @Override
    public String getImei() {
        return mImei;
    }

    @Override
    protected void log(String s) {
        if (DBG)
+9 −0
Original line number Diff line number Diff line
@@ -122,6 +122,8 @@ public class CDMAPhone extends PhoneBase {
    //keep track of if phone is in emergency callback mode
    private boolean mIsPhoneInEcmState;
    private Registrant mEcmExitRespRegistrant;
    protected String mImei;
    protected String mImeiSv;
    private String mEsn;
    private String mMeid;
    // string to define how the carrier specifies its own ota sp number
@@ -489,6 +491,11 @@ public class CDMAPhone extends PhoneBase {
        return mSST.getImsi();
    }

    public String getImei() {
        Log.e(LOG_TAG, "IMEI is not available in CDMA");
        return null;
    }

    public boolean canConference() {
        Log.e(LOG_TAG, "canConference: not possible in CDMA");
        return false;
@@ -987,6 +994,8 @@ public class CDMAPhone extends PhoneBase {
                    break;
                }
                String[] respId = (String[])ar.result;
                mImei = respId[0];
                mImeiSv = respId[1];
                mEsn  =  respId[2];
                mMeid =  respId[3];
            }
+4 −0
Original line number Diff line number Diff line
@@ -855,6 +855,10 @@ public class GSMPhone extends PhoneBase {
        return mImeiSv;
    }

    public String getImei() {
        return mImei;
    }

    public String getEsn() {
        Log.e(LOG_TAG, "[GSMPhone] getEsn() is a CDMA method");
        return "0";
Loading