summaryrefslogtreecommitdiff
path: root/core/java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2019-10-28 16:34:22 -0700
committerDianne Hackborn <hackbod@google.com>2019-11-12 15:55:59 -0800
commita2fe812ea0318f1006c8c776a2eb7eb4da2c37d6 (patch)
treeb9708edbcc753caca1c51b67045dfd0be9d66ca6 /core/java
parentcf6db591024bb2f7c53086d509b07fc1005258e0 (diff)
Rework platform version to hide codenames.
The public platform version no longer can be a codename, it is always the most recently released platform. A new build property and API provides either the offical version or the current codename as appropriate. This will avoid breaking apps that look at the platform version while development is under a codename. Bug: 143175463 Test: manual Change-Id: I72975ec86ac07700dc9052245b54411fa77982b8
Diffstat (limited to 'core/java')
-rwxr-xr-xcore/java/android/os/Build.java7
-rw-r--r--core/java/com/android/internal/os/RuntimeInit.java2
2 files changed, 8 insertions, 1 deletions
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 123ed6f611f5..2b9d9c561370 100755
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -239,6 +239,13 @@ public class Build {
public static final String RELEASE = getString("ro.build.version.release");
/**
+ * The version string we show to the user; may be {@link #RELEASE} or
+ * {@link #CODENAME} if not a final release build.
+ */
+ @NonNull public static final String RELEASE_OR_CODENAME = getString(
+ "ro.build.version.release_or_codename");
+
+ /**
* The base OS build the product is based on.
*/
public static final String BASE_OS = SystemProperties.get("ro.build.version.base_os", "");
diff --git a/core/java/com/android/internal/os/RuntimeInit.java b/core/java/com/android/internal/os/RuntimeInit.java
index fd3cd42b07a1..da43eddeb0bf 100644
--- a/core/java/com/android/internal/os/RuntimeInit.java
+++ b/core/java/com/android/internal/os/RuntimeInit.java
@@ -277,7 +277,7 @@ public class RuntimeInit {
result.append(System.getProperty("java.vm.version")); // such as 1.1.0
result.append(" (Linux; U; Android ");
- String version = Build.VERSION.RELEASE; // "1.0" or "3.4b5"
+ String version = Build.VERSION.RELEASE_OR_CODENAME; // "1.0" or "3.4b5"
result.append(version.length() > 0 ? version : "1.0");
// add the model for the release build