summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/api/current.txt1
-rw-r--r--core/java/android/os/Build.java25
2 files changed, 26 insertions, 0 deletions
diff --git a/core/api/current.txt b/core/api/current.txt
index 5e8febebee0e..9875c0276bf0 100644
--- a/core/api/current.txt
+++ b/core/api/current.txt
@@ -32771,6 +32771,7 @@ package android.os {
field @NonNull public static final String RELEASE_OR_PREVIEW_DISPLAY;
field @Deprecated public static final String SDK;
field public static final int SDK_INT;
+ field @FlaggedApi("android.sdk.major_minor_versioning_scheme") public static final int SDK_MINOR_INT;
field public static final String SECURITY_PATCH;
}
diff --git a/core/java/android/os/Build.java b/core/java/android/os/Build.java
index 30d2dec8b4c4..a8267d1c9d8c 100644
--- a/core/java/android/os/Build.java
+++ b/core/java/android/os/Build.java
@@ -17,6 +17,7 @@
package android.os;
import android.Manifest;
+import android.annotation.FlaggedApi;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresPermission;
@@ -28,6 +29,7 @@ import android.app.Application;
import android.compat.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.ravenwood.annotation.RavenwoodKeepWholeClass;
+import android.sdk.Flags;
import android.sysprop.DeviceProperties;
import android.sysprop.SocProperties;
import android.sysprop.TelephonyProperties;
@@ -399,12 +401,35 @@ public class Build {
* device. This value never changes while a device is booted, but it may
* increase when the hardware manufacturer provides an OTA update.
* <p>
+ * Together with {@link SDK_MINOR_INT}, this constant defines the
+ * <pre>major.minor</pre> version of Android. <pre>SDK_INT</pre> is
+ * increased and <pre>SDK_MINOR_INT</pre> is set to 0 on new Android
+ * dessert releases. Between these, Android may also release so called
+ * minor releases where <pre>SDK_INT</pre> remains unchanged and
+ * <pre>SDK_MINOR_INT</pre> is increased. Minor releases can add new
+ * APIs, and have stricter guarantees around backwards compatibility
+ * (e.g. no changes gated by <pre>targetSdkVersion</pre>) compared to
+ * major releases.
+ * <p>
* Possible values are defined in {@link Build.VERSION_CODES}.
*/
public static final int SDK_INT = SystemProperties.getInt(
"ro.build.version.sdk", 0);
/**
+ * The minor SDK version of the software currently running on this hardware
+ * device. This value never changes while a device is booted, but it may
+ * increase when the hardware manufacturer provides an OTA update.
+ * <p>
+ * Together with {@link SDK_INT}, this constant defines the
+ * <pre>major.minor</pre> version of Android. See {@link SDK_INT} for
+ * more information.
+ */
+ @FlaggedApi(Flags.FLAG_MAJOR_MINOR_VERSIONING_SCHEME)
+ public static final int SDK_MINOR_INT = SystemProperties.getInt(
+ "ro.build.version.sdk_minor", 0);
+
+ /**
* The SDK version of the software that <em>initially</em> shipped on
* this hardware device. It <em>never</em> changes during the lifetime
* of the device, even when {@link #SDK_INT} increases due to an OTA