From 8dcb6ee91fc6bc4d2914046ce45b3bfa4ee364f4 Mon Sep 17 00:00:00 2001 From: Elisa Lou Date: Tue, 1 Oct 2019 13:31:30 -0700 Subject: [PATCH] android: update dark mode minimum (#26623) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/26623 I noticed the min version was 10. It is actually 9 if we consider users with developer option turned on. Changelog: [Android][Fixed] - Updated Appearance module to allow Android 9/P devices. Differential Revision: D17632656 fbshipit-source-id: 893699ae37ab1cef64fe2547e0f2d6858bf3c48c --- .../facebook/react/modules/appearance/AppearanceModule.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java index 4de3edd7644..52bb1b8fe84 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/appearance/AppearanceModule.java @@ -23,7 +23,6 @@ public class AppearanceModule extends ReactContextBaseJavaModule { public static final String NAME = "Appearance"; private static final String APPEARANCE_CHANGED_EVENT_NAME = "appearanceChanged"; - private static final int ANDROID_TEN = 29; private String mColorScheme = "light"; @@ -34,8 +33,8 @@ public class AppearanceModule extends ReactContextBaseJavaModule { } private static String colorSchemeForCurrentConfiguration(Context context) { - // TODO: (hramos) T52929922: Switch to Build.VERSION_CODES.ANDROID_TEN or equivalent - if (Build.VERSION.SDK_INT >= ANDROID_TEN) { + // Night Mode is only available in Android P and up. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { int currentNightMode = context.getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK; switch (currentNightMode) {