Merge "Add getDeviceId to PhoneInterfaceManager to give id independent of SubInfo." into lmp-mr1-dev
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 268cf25..9eb0b0b 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -2234,6 +2234,24 @@
&& mTelephonySharedPreferences.getBoolean(PREF_ENABLE_VIDEO_CALLING, true);
}
+ /**
+ * Returns the unique device ID of phone, for example, the IMEI for
+ * GSM and the MEID for CDMA phones. Return null if device ID is not available.
+ *
+ * <p>Requires Permission:
+ * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE}
+ */
+ @Override
+ public String getDeviceId() {
+ enforceReadPermission();
+ final Phone phone = PhoneFactory.getPhone(0);
+ if (phone != null) {
+ return phone.getDeviceId();
+ } else {
+ return null;
+ }
+ }
+
/*
* {@hide}
* Returns the IMS Registration Status