From 0b7f5e81ba06f694df8c8cccaea9e009e3200b4c Mon Sep 17 00:00:00 2001 From: Sanket Padawe Date: Wed, 14 Jan 2015 09:49:58 -0800 Subject: Modify getDeviceId() to get device id independent of Subscription. + Add getDeviceId() in ITelephony to find device id independent of subscription. Bug: 18780202 Change-Id: I21cc38418eb7f4f1b300c6372e1dc7548385c112 --- telephony/java/android/telephony/TelephonyManager.java | 6 +++++- telephony/java/com/android/internal/telephony/ITelephony.aidl | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'telephony/java') diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 99d0af1..9df693c 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -620,7 +620,11 @@ public class TelephonyManager { * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} */ public String getDeviceId() { - return getDeviceId(getDefaultSim()); + try { + return getITelephony().getDeviceId(); + } catch (RemoteException ex) { + return null; + } } /** diff --git a/telephony/java/com/android/internal/telephony/ITelephony.aidl b/telephony/java/com/android/internal/telephony/ITelephony.aidl index d6e40ae9..bf3ee09 100644 --- a/telephony/java/com/android/internal/telephony/ITelephony.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephony.aidl @@ -865,8 +865,18 @@ interface ITelephony { * @return {@code True} if the user has enabled video calling, {@code false} otherwise. */ boolean isVideoCallingEnabled(); + /** * Get IMS Registration Status */ boolean isImsRegistered(); + + /** + * 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. + * + *

Requires Permission: + * {@link android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE} + */ + String getDeviceId(); } -- cgit v1.1