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

Commits on May 2, 2024

  1. Fix onKeyLongPress() in RELEASE

    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
    arushikesarwani94 authored and facebook-github-bot committed May 2, 2024
    Configuration menu
    Copy the full SHA
    f3894d7 View commit details
    Browse the repository at this point in the history
  2. Fix shouldShowDevMenuOrReload in RELEASE

    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
    arushikesarwani94 authored and facebook-github-bot committed May 2, 2024
    Configuration menu
    Copy the full SHA
    3d95e2b View commit details
    Browse the repository at this point in the history