From d6ebb55c62f56d71ed389fdc1dda1ef53e256347 Mon Sep 17 00:00:00 2001 From: Kevin Hufnagle Date: Tue, 16 May 2017 16:48:10 -0700 Subject: [PATCH] cherry-pick from oc-dev: docs: Note regarding device IDs, Build.java Added note within getSerial() in android.os.Build class. Device identifiers, such as hardware serial numbers, can be modified if a device is rooted. Others can use key attestation to discover these changes. Added a note to this effect within this method. Test: make ds-docs -j8 Bug: 38312326 Change-Id: I76e3f6a15b9a8673ca3304218653e8cd26da38d7 Original-Change-Id: Ibd2dab621c14683e12a213957b567ee49b8d00fd --- core/java/android/os/Build.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index ac8c955d2c93..3c1cdc9d6da9 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -117,8 +117,14 @@ public class Build { public static final String SERIAL = getString("no.such.thing"); /** - * Gets the hardware serial, if available. - * @return The serial if specified. + * Gets the hardware serial number, if available. + * + *

Note: Root access may allow you to modify device identifiers, such as + * the hardware serial number. If you change these identifiers, you can use + * key attestation to obtain + * proof of the device's original identifiers. + * + * @return The serial number if specified. */ @RequiresPermission(Manifest.permission.READ_PHONE_STATE) public static String getSerial() { -- 2.11.0