From 190076ba1845c7ec48240f1ec0281c0f999a1414 Mon Sep 17 00:00:00 2001 From: seamlink-aalves <49952868+seamlink-aalves@users.noreply.github.com> Date: Mon, 20 Apr 2026 17:00:47 +0100 Subject: [PATCH] chore: simplify edge-to-edge preference logic in CordovaActivity and SystemBarPlugin (#1902) - Remove the limitation for Android version <15 when preference AndroidEdgeToEdge is true. - The motivation and context was described here: apache/cordova-discuss#114 - When having cordova android in Edge To Edge the app does not extend to the full height of the device in version bellow Android 15. This change allows the app to behave the same way it was possible to do with the statusbar plugin preference StatusBarOverlaysWebView given that this stopped having any effect in cordova-android 15. --- framework/src/org/apache/cordova/CordovaActivity.java | 3 +-- framework/src/org/apache/cordova/SystemBarPlugin.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/framework/src/org/apache/cordova/CordovaActivity.java b/framework/src/org/apache/cordova/CordovaActivity.java index 114727d4..3a046981 100755 --- a/framework/src/org/apache/cordova/CordovaActivity.java +++ b/framework/src/org/apache/cordova/CordovaActivity.java @@ -121,8 +121,7 @@ public class CordovaActivity extends AppCompatActivity { // need to activate preferences before super.onCreate to avoid "requestFeature() must be called before adding content" exception loadConfig(); - canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false) - && Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM; + canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false); String logLevel = preferences.getString("loglevel", "ERROR"); LOG.setLogLevel(logLevel); diff --git a/framework/src/org/apache/cordova/SystemBarPlugin.java b/framework/src/org/apache/cordova/SystemBarPlugin.java index 0df7a589..097fcbbc 100644 --- a/framework/src/org/apache/cordova/SystemBarPlugin.java +++ b/framework/src/org/apache/cordova/SystemBarPlugin.java @@ -55,8 +55,7 @@ public class SystemBarPlugin extends CordovaPlugin { protected void pluginInitialize() { context = cordova.getContext(); resources = context.getResources(); - canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false) - && Build.VERSION.SDK_INT >= Build.VERSION_CODES.VANILLA_ICE_CREAM; + canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false); } @Override