From ebbbc517a8473bf0cdda0d666f0eee1f705d512c Mon Sep 17 00:00:00 2001 From: Mis012 Date: Wed, 26 Mar 2025 20:22:12 +0100 Subject: [PATCH] android/os/Build: allow overriding SDK_INT --- src/api-impl/android/os/Build.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/api-impl/android/os/Build.java b/src/api-impl/android/os/Build.java index 84ce9ab9..eb3cb6d3 100644 --- a/src/api-impl/android/os/Build.java +++ b/src/api-impl/android/os/Build.java @@ -107,6 +107,11 @@ public class Build { * Various version strings. */ public static class VERSION { + static { + String SDK_INT_str = System.getProperty("Build.VERSION.SDK_INT"); + SDK_INT = (SDK_INT_str != null) ? Integer.parseInt(SDK_INT_str) : Build.VERSION_CODES.GINGERBREAD; + } + /** * The internal value used by the underlying source control to * represent this build. E.g., a perforce changelist number @@ -123,7 +128,7 @@ public class Build { * The user-visible SDK version of the framework; its possible * values are defined in {@link Build.VERSION_CODES}. */ - public static final int SDK_INT = Build.VERSION_CODES.GINGERBREAD; + public static final int SDK_INT; /** * The user-visible SDK version of the framework in its raw String