From 9ed2df628ddd410cc3383e68b0386471432445c0 Mon Sep 17 00:00:00 2001 From: Kuba Holuj Date: Thu, 10 Feb 2022 05:26:41 -0800 Subject: [PATCH] Fix StatusBar on Android API 30 (#33058) Summary: In https://github.com/facebook/react-native/issues/32975 I implemented the new `insetsController#setSystemBarsAppearance` interface, but I found that on Android 11 (API 30) it doesn't appear to work which I missed in earlier testing. It works correctly on Android 12 and the deprecated `systemUiVisibility` interface still works fine on Android 11, so I'm having Android 11 use the deprecated mechanism. ## Changelog [Android] [Fixed] - Fix StatusBar on Android API 30 Pull Request resolved: https://github.com/facebook/react-native/pull/33058 Test Plan: Tested in `rn-tester` on simulators using Android 9, 10, 11, 12, and on an Android 9 device. Reviewed By: lunaleaps Differential Revision: D34050025 Pulled By: ShikaSD fbshipit-source-id: ad80fae1446aca368b09df810785a1cc38383450 --- .../com/facebook/react/modules/statusbar/StatusBarModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java index a3beef47e719a3..8765a23ca4c114 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/statusbar/StatusBarModule.java @@ -190,7 +190,7 @@ public void setStyle(@Nullable final String style) { @TargetApi(Build.VERSION_CODES.R) @Override public void run() { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) { WindowInsetsController insetsController = activity.getWindow().getInsetsController(); if ("dark-content".equals(style)) { // dark-content means dark icons on a light status bar