diff options
author | Adam Powell <adamp@google.com> | 2015-05-08 17:59:29 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-05-08 17:59:31 +0000 |
commit | 5b56159b8e2e1c494b4d8fb9d2b0aeef59aaddd4 (patch) | |
tree | 91d6a14749f95c32b61c2b5893fec360036d4908 /core | |
parent | e1a1d2e85a3f0626ae13322998fd45a1eb4a49d7 (diff) | |
parent | e960030f75d2b510706c4623d94ad71aba427fb8 (diff) | |
download | frameworks_base-5b56159b8e2e1c494b4d8fb9d2b0aeef59aaddd4.zip frameworks_base-5b56159b8e2e1c494b4d8fb9d2b0aeef59aaddd4.tar.gz frameworks_base-5b56159b8e2e1c494b4d8fb9d2b0aeef59aaddd4.tar.bz2 |
Merge "Add Build.VERSION.PREVIEW_SDK_INT" into mnc-dev
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/os/Build.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java index 36fc4f9..50eed3e 100644 --- a/core/java/android/os/Build.java +++ b/core/java/android/os/Build.java @@ -173,6 +173,27 @@ public class Build { "ro.build.version.sdk", 0); /** + * The developer preview revision of a prerelease SDK. This value will always + * be <code>0</code> on production platform builds/devices. + * + * <p>When this value is nonzero, any new API added since the last + * officially published {@link #SDK_INT API level} is only guaranteed to be present + * on that specific preview revision. For example, an API <code>Activity.fooBar()</code> + * might be present in preview revision 1 but renamed or removed entirely in + * preview revision 2, which may cause an app attempting to call it to crash + * at runtime.</p> + * + * <p>Experimental apps targeting preview APIs should check this value for + * equality (<code>==</code>) with the preview SDK revision they were built for + * before using any prerelease platform APIs. Apps that detect a preview SDK revision + * other than the specific one they expect should fall back to using APIs from + * the previously published API level only to avoid unwanted runtime exceptions. + * </p> + */ + public static final int PREVIEW_SDK_INT = SystemProperties.getInt( + "ro.build.version.preview_sdk", 0); + + /** * The current development codename, or the string "REL" if this is * a release build. */ |