From 6ee5ddcfbd1cb6777cee92e72534dc5d542fe2a6 Mon Sep 17 00:00:00 2001 From: Hall Liu Date: Wed, 19 Jun 2019 13:58:01 -0700 Subject: [PATCH] Update documentation for TelephonyManager#getImei Update the documentation for getImei to reflect that default SMS apps are allowed to call this API. Fixes: 135627578 Test: compiles Change-Id: Ifef46c9cdb16e8485f3b5bf6d582aca320052b5c --- .../android/telephony/TelephonyManager.java | 40 +++++++------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index b7b511e5eb4bb..39ad0d0b85f41 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -1605,7 +1605,7 @@ public class TelephonyManager { * higher, then a SecurityException is thrown. * * - * @deprecated Use (@link getImei} which returns IMEI for GSM or (@link getMeid} which returns + * @deprecated Use {@link #getImei} which returns IMEI for GSM or {@link #getMeid} which returns * MEID for CDMA. */ @Deprecated @@ -1648,7 +1648,7 @@ public class TelephonyManager { * * @param slotIndex of which deviceID is returned * - * @deprecated Use (@link getImei} which returns IMEI for GSM or (@link getMeid} which returns + * @deprecated Use {@link #getImei} which returns IMEI for GSM or {@link #getMeid} which returns * MEID for CDMA. */ @Deprecated @@ -1672,23 +1672,8 @@ public class TelephonyManager { * Returns the IMEI (International Mobile Equipment Identity). Return null if IMEI is not * available. * - *

Requires Permission: READ_PRIVILEGED_PHONE_STATE, for the calling app to be the device or - * profile owner and have the READ_PHONE_STATE permission, or that the calling app has carrier - * privileges (see {@link #hasCarrierPrivileges}). The profile owner is an app that owns a - * managed profile on the device; for more details see Work profiles. Profile owner - * access is deprecated and will be removed in a future release. - * - *

If the calling app does not meet one of these requirements then this method will behave - * as follows: - * - *

+ * See {@link #getImei(int)} for details on the required permissions and behavior + * when the caller does not hold sufficient permissions. */ @SuppressAutoDoc // No support for device / profile owner or carrier privileges (b/72967236). @RequiresPermission(android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE) @@ -1700,12 +1685,17 @@ public class TelephonyManager { * Returns the IMEI (International Mobile Equipment Identity). Return null if IMEI is not * available. * - *

Requires Permission: READ_PRIVILEGED_PHONE_STATE, for the calling app to be the device or - * profile owner and have the READ_PHONE_STATE permission, or that the calling app has carrier - * privileges (see {@link #hasCarrierPrivileges}). The profile owner is an app that owns a - * managed profile on the device; for more details see Work profiles. Profile owner - * access is deprecated and will be removed in a future release. + *

This API requires one of the following: + *

+ *

The profile owner is an app that owns a managed profile on the device; for more details + * see Work profiles. + * Access by profile owners is deprecated and will be removed in a future release. * *

If the calling app does not meet one of these requirements then this method will behave * as follows: