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
This commit is contained in:
John Wang
2011-07-11 16:50:10 -07:00
parent 4821d3bdf8
commit 2ea7e443b2
6 changed files with 31 additions and 0 deletions

View File

@@ -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
*/

View File

@@ -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();
}

View File

@@ -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)

View File

@@ -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];
}

View File

@@ -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";

View File

@@ -264,6 +264,10 @@ abstract class SipPhoneBase extends PhoneBase {
return null;
}
public String getImei() {
return null;
}
public String getEsn() {
Log.e(LOG_TAG, "[SipPhone] getEsn() is a CDMA method");
return "0";