This is an automated email from the ASF dual-hosted git repository.

GitToTheHub pushed a commit to branch 
pr-revert-pr-1902-simplify-edge-to-edge-preference-logic
in repository https://gitbox.apache.org/repos/asf/cordova-android.git

commit 736498490974fa27106a34e7e689a81f8d81cb19
Author: Manuel Beck <[email protected]>
AuthorDate: Tue Jun 23 23:02:52 2026 +0200

    revert PR #1902 simplify edge-to-edge preference logic in CordovaActivity 
and SystemBarPlugin
    
    - Android EdgeToEdge was introduced in Android 15 and should only be used 
from there on
    - Add small comment to the condition
---
 framework/src/org/apache/cordova/CordovaActivity.java | 4 +++-
 framework/src/org/apache/cordova/SystemBarPlugin.java | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/framework/src/org/apache/cordova/CordovaActivity.java 
b/framework/src/org/apache/cordova/CordovaActivity.java
index a8d4379e..fec0c556 100755
--- a/framework/src/org/apache/cordova/CordovaActivity.java
+++ b/framework/src/org/apache/cordova/CordovaActivity.java
@@ -121,7 +121,9 @@ 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);
+        // Android Edge to Edge was introduced in Android 15 and can only be 
used from there on
+        canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false)
+                && Build.VERSION.SDK_INT >= 
Build.VERSION_CODES.VANILLA_ICE_CREAM;
 
         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 c03721f0..c0d45afe 100644
--- a/framework/src/org/apache/cordova/SystemBarPlugin.java
+++ b/framework/src/org/apache/cordova/SystemBarPlugin.java
@@ -55,7 +55,9 @@ public class SystemBarPlugin extends CordovaPlugin {
     protected void pluginInitialize() {
         context = cordova.getContext();
         resources = context.getResources();
-        canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false);
+        // Android Edge to Edge was introduced in Android 15 and can only be 
used from there on
+        canEdgeToEdge = preferences.getBoolean("AndroidEdgeToEdge", false)
+                && Build.VERSION.SDK_INT >= 
Build.VERSION_CODES.VANILLA_ICE_CREAM;
     }
 
     @Override


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to