fix: isVision return false for Platform.android.js (#42381)

Summary:
This PR is a follow up for https://github.com/facebook/react-native/issues/42243 it looks like we need to return `false` for the Platform.android.js to make flow happy.

This is the error we were getting in `react-native-visionos` CI/CD:
![CleanShot 2024-01-19 at 13 01 19@2x](https://github.com/facebook/react-native/assets/52801365/218078b3-44d4-4dc0-bee7-f5d2e08eca50)

## Changelog:

[INTERNAL] [FIXED] - Add `isVision` interface idiom for Platform.android.js

Pull Request resolved: https://github.com/facebook/react-native/pull/42381

Test Plan: CI Green

Reviewed By: cortinico

Differential Revision: D52905993

Pulled By: NickGerleman

fbshipit-source-id: 125d33b63e9114cb6276b554e426f32e0c406ea8
This commit is contained in:
Oskar Kwaśniewski
2024-01-19 10:19:38 -08:00
committed by Facebook GitHub Bot
parent b9621976bc
commit 3d09b6f850
3 changed files with 7 additions and 0 deletions
@@ -69,6 +69,10 @@ const Platform: PlatformType = {
// $FlowFixMe[object-this-reference]
return this.constants.uiMode === 'tv';
},
// $FlowFixMe[unsafe-getters-setters]
get isVision(): boolean {
return false;
},
select: <T>(spec: PlatformSelectSpec<T>): T =>
'android' in spec
? // $FlowFixMe[incompatible-return]
@@ -80,6 +80,8 @@ type AndroidPlatform = {
// $FlowFixMe[unsafe-getters-setters]
get isTV(): boolean,
// $FlowFixMe[unsafe-getters-setters]
get isVision(): boolean,
// $FlowFixMe[unsafe-getters-setters]
get isTesting(): boolean,
// $FlowFixMe[unsafe-getters-setters]
get isDisableAnimations(): boolean,
@@ -9940,6 +9940,7 @@ type AndroidPlatform = {
Manufacturer: string,
|},
get isTV(): boolean,
get isVision(): boolean,
get isTesting(): boolean,
get isDisableAnimations(): boolean,
select: <T>(spec: PlatformSelectSpec<T>) => T,