summaryrefslogtreecommitdiff
path: root/core/java/android/os/Build.java
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2020-06-24 17:01:22 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-06-24 17:01:22 +0000
commitcedb11cc8487e37fac98d2c8a7bacd2e39c2d12e (patch)
tree9bf212b2315b5dc0cd2f28e902727ef9eccac412 /core/java/android/os/Build.java
parente72b7264d734e37de70a5d87c10e0330c8bdd40d (diff)
parent5a0c835564d6b11abfa5c559c5273a4fc96b84bc (diff)
Merge "Add additional info to device ID docs in TelephonyManager and Build" into rvc-dev am: 3fa2d86fd0 am: e71ed27853 am: 4cad6acf29 am: 5a0c835564
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11980365 Change-Id: I7a2952c907c8ac8081413b7eeafcd6d466597897
Diffstat (limited to 'core/java/android/os/Build.java')
-rwxr-xr-xcore/java/android/os/Build.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 9a28bc920049..1050c7f8b4f4 100755
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -139,12 +139,23 @@ public class Build {
* <a href="/training/articles/security-key-attestation.html">key attestation</a> to obtain
* proof of the device's original identifiers.
*
- * <p>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 android.telephony.TelephonyManager#hasCarrierPrivileges}). The profile
- * owner is an app that owns a managed profile on the device; for more details see <a
- * href="https://developer.android.com/work/managed-profiles">Work profiles</a>. Profile owner
- * access is deprecated and will be removed in a future release.
+ * <p>Starting with API level 29, persistent device identifiers are guarded behind additional
+ * restrictions, and apps are recommended to use resettable identifiers (see <a
+ * href="c"> Best practices for unique identifiers</a>). This method can be invoked if one of
+ * the following requirements is met:
+ * <ul>
+ * <li>If the calling app has been granted the READ_PRIVILEGED_PHONE_STATE permission; this
+ * is a privileged permission that can only be granted to apps preloaded on the device.
+ * <li>If the calling app is the device or profile owner and has been granted the
+ * {@link Manifest.permission#READ_PHONE_STATE} permission. The profile owner is an app that
+ * owns a managed profile on the device; for more details see <a
+ * href="https://developer.android.com/work/managed-profiles">Work profiles</a>.
+ * Profile owner access is deprecated and will be removed in a future release.
+ * <li>If the calling app has carrier privileges (see {@link
+ * android.telephony.TelephonyManager#hasCarrierPrivileges}) on any active subscription.
+ * <li>If the calling app is the default SMS role holder (see {@link
+ * android.app.role.RoleManager#isRoleHeld(String)}).
+ * </ul>
*
* <p>If the calling app does not meet one of these requirements then this method will behave
* as follows:
@@ -156,7 +167,7 @@ public class Build {
* the READ_PHONE_STATE permission, or if the calling app is targeting API level 29 or
* higher, then a SecurityException is thrown.</li>
* </ul>
- * *
+ *
* @return The serial number if specified.
*/
@SuppressAutoDoc // No support for device / profile owner.