Add getDeviceId to PhoneInterfaceManager to give id independent of SubInfo.
Bug: 18780202
Change-Id: I35a2a9e15ec90cac879320c0c1005f065f1b4f0d
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 24abf23..5e1ad89 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -2229,6 +2229,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