From 77c256ca9115b8fd23a0e3fa43e12033cac3d634 Mon Sep 17 00:00:00 2001 From: Nick Gerleman Date: Mon, 8 Aug 2022 23:41:07 -0700 Subject: [PATCH] Expose UI_MODE_TYPE_VR_HEADSET in PlatformConstants Summary: The Android version of PlatformConstants exposes the device's [UI Mode]( https://developer.android.com/guide/topics/resources/providing-resources#UiModeQualifier). It is missing the case for 'vrheadset', added in Android API 26. We should return the expected result when this is queried. Changelog: [Android][Added] - Expose UI_MODE_TYPE_VR_HEADSET in PlatformConstants Reviewed By: rshest Differential Revision: D38495875 fbshipit-source-id: fd904bd11213448415b7d75145d9ba6311ed407b --- .../facebook/react/modules/systeminfo/AndroidInfoModule.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java b/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java index 5bc5192dee270c..c03aab436f5fab 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/AndroidInfoModule.java @@ -50,6 +50,8 @@ private String uiMode() { return "desk"; case Configuration.UI_MODE_TYPE_WATCH: return "watch"; + case Configuration.UI_MODE_TYPE_VR_HEADSET: + return "vrheadset"; case Configuration.UI_MODE_TYPE_NORMAL: return "normal"; default: