diff options
author | Wink Saville <wink@google.com> | 2010-08-20 16:34:16 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-08-20 16:34:16 -0700 |
commit | b2cc86da29452769ff6210f1dfef4b51aac1d75e (patch) | |
tree | 63f5223297a6d583d788d29e41a64c5497d9dee8 /telephony | |
parent | d6f7f225689ecd33dc54699acc01cfafc781c20d (diff) | |
parent | 3158cf689f4994ec53c3b727f9b6ad7751a5551b (diff) | |
download | frameworks_base-b2cc86da29452769ff6210f1dfef4b51aac1d75e.zip frameworks_base-b2cc86da29452769ff6210f1dfef4b51aac1d75e.tar.gz frameworks_base-b2cc86da29452769ff6210f1dfef4b51aac1d75e.tar.bz2 |
am 3158cf68: Change CDMAPhone.getDeviceId to return MEID or ESN.
Merge commit '3158cf689f4994ec53c3b727f9b6ad7751a5551b' into gingerbread
* commit '3158cf689f4994ec53c3b727f9b6ad7751a5551b':
Change CDMAPhone.getDeviceId to return MEID or ESN.
Diffstat (limited to 'telephony')
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 2 | ||||
-rwxr-xr-x | telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index aa916e0..27e08d4 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -177,7 +177,7 @@ public class TelephonyManager { /** * Returns the unique device ID, for example, the IMEI for GSM and the MEID - * for CDMA phones. Return null if device ID is not available. + * or ESN for CDMA phones. Return null if device ID is not available. * * <p>Requires Permission: * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} diff --git a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java index 0c591e4..c21b6d9 100755 --- a/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java +++ b/telephony/java/com/android/internal/telephony/cdma/CDMAPhone.java @@ -447,9 +447,14 @@ public class CDMAPhone extends PhoneBase { return mMeid; } - //returns MEID in CDMA + //returns MEID or ESN in CDMA public String getDeviceId() { - return getMeid(); + String id = getMeid(); + if ((id == null) || id.matches("^0*$")) { + Log.d(LOG_TAG, "getDeviceId(): MEID is not initialized use ESN"); + id = getEsn(); + } + return id; } public String getDeviceSvn() { |