diff options
author | satayev <satayev@google.com> | 2022-01-31 20:30:12 +0000 |
---|---|---|
committer | Artur Satayev <satayev@google.com> | 2022-02-02 18:23:14 +0000 |
commit | 57007c76018b49799fa86cc64ae4faffdb500b91 (patch) | |
tree | f9eb8339304039e1337b1bb9d5f38c9b07e66354 | |
parent | 751321014202c68045935e81e594441d53dc3e6c (diff) | |
download | base-57007c76018b49799fa86cc64ae4faffdb500b91.tar.gz |
Introduce Build.VERSION.KNOWN_CODENAMES.
See go/mainline-sdk-codenames-issue.
Known values are to be used to distinguish multiple pre-release
codenames, and to allow in development artifacts to be installable
on released versions of the platform for testing going forward.
This does not change pre-T behaviour at large however.
Cherry-pick aosp change into sc-mainline-prod to allow utility code
to compile. Given that all modules compile from source this should be
safe short-term, before we switch away from sc-mainline-prod.
Bug: 211747008
Test: presubmit
Change-Id: I0c8df8e767ea61b27bb53da53fb6c9b2c842dbbc
Merged-In: I0c8df8e767ea61b27bb53da53fb6c9b2c842dbbc
-rw-r--r-- | core/api/system-current.txt | 1 | ||||
-rwxr-xr-x | core/java/android/os/Build.java | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt index 2d73aa67ed1a..c148836fd6e1 100644 --- a/core/api/system-current.txt +++ b/core/api/system-current.txt @@ -8126,6 +8126,7 @@ package android.os { } public static class Build.VERSION { + field @NonNull public static final java.util.Set<java.lang.String> KNOWN_CODENAMES; field @NonNull public static final String PREVIEW_SDK_FINGERPRINT; } diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index 6bf394dc347b..77e7df240b76 100755 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -31,6 +31,7 @@ import android.sysprop.DeviceProperties; import android.sysprop.SocProperties; import android.sysprop.TelephonyProperties; import android.text.TextUtils; +import android.util.ArraySet; import android.util.Slog; import android.view.View; @@ -39,6 +40,7 @@ import dalvik.system.VMRuntime; import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.Set; import java.util.stream.Collectors; /** @@ -396,6 +398,17 @@ public class Build { */ public static final String CODENAME = getString("ro.build.version.codename"); + /** + * All known codenames starting from {@link VERSION_CODES.Q}. + * + * <p>This includes in development codenames as well. + * + * @hide + */ + @SystemApi + @NonNull public static final Set<String> KNOWN_CODENAMES = + new ArraySet<>(new String[]{"Q", "R", "S", "Sv2", "Tiramisu"}); + private static final String[] ALL_CODENAMES = getStringList("ro.build.version.all_codenames", ","); |