Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shouldShowDevMenuOrReload in RELEASE #44364

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arushikesarwani94
Copy link
Contributor

Summary:
In RELEASE mode, the devSupportManager received is ReleaseDevSupportManager for which showDevOptionsDialog() & handleReloadJS() is a no-op
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.java

Which is expected since this is a capability only in Dev mode(useDeveloperSupport = true). However, ATM shouldShowDevMenuOrReload() returns true in RELEASE as well which is a bug.

Since there is no need for shouldShowDevMenuOrReload() in RELEASE, changing it's logic to introduce that check, early exit and return false in case of RELEASE.

Changelog:
[Android][Fixed] shouldShowDevMenuOrReload() in RELEASE mode

Differential Revision: D56851473

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels May 1, 2024
@analysis-bot
Copy link

analysis-bot commented May 1, 2024

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 19,478,556 +12
android hermes armeabi-v7a n/a --
android hermes x86 n/a --
android hermes x86_64 n/a --
android jsc arm64-v8a 22,851,093 +6
android jsc armeabi-v7a n/a --
android jsc x86 n/a --
android jsc x86_64 n/a --

Base commit: 0383669
Branch: main

arushikesarwani94 and others added 2 commits May 1, 2024 18:31
Summary:
In RELEASE mode, the `devSupportManager` received is ReleaseDevSupportManager for which `showDevOptionsDialog()` is a no-op
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.java#L66

Which is expected since this is a capability only in Dev mode(useDeveloperSupport = true). However, ATM `onKeyLongPresss()` returns true in RELEASE as well which is a bug.

Since there is no need for `onKeyLongPress()` in RELEASE, changing it's logic to introduce that check and return false in case of RELEASE.

Changelog:
[Android][Fixed] onKeyLongPress() in RELEASE mode

Differential Revision: D56850466
Summary:
In RELEASE mode, the `devSupportManager` received is ReleaseDevSupportManager for which `showDevOptionsDialog()` & `handleReloadJS()` is a no-op
https://github.com/facebook/react-native/blob/main/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/devsupport/ReleaseDevSupportManager.java

Which is expected since this is a capability only in Dev mode(useDeveloperSupport = true). However, ATM `shouldShowDevMenuOrReload()` returns true in RELEASE as well which is a bug.

Since there is no need for `shouldShowDevMenuOrReload()` in RELEASE, changing it's logic to introduce that check, early exit and return false in case of RELEASE.

Changelog:
[Android][Fixed] shouldShowDevMenuOrReload() in RELEASE mode

Reviewed By: RSNara

Differential Revision: D56851473
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants