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

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/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
This commit is contained in:
Kuba Holuj
2022-02-10 05:31:30 -08:00
committed by Facebook GitHub Bot
parent b467094f18
commit 9ed2df628d
@@ -190,7 +190,7 @@ public class StatusBarModule extends NativeStatusBarManagerAndroidSpec {
@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