Add local network permission prompt on android 17#57291
Open
alanjhughes wants to merge 4 commits into
Open
Conversation
|
Warning JavaScript API change detected This PR commits an update to
This change was flagged as: |
zoontek
reviewed
Jun 19, 2026
| * that declares it, regardless of targetSdk. | ||
| */ | ||
| @JvmStatic | ||
| internal fun isAtLeastSdk37(): Boolean = Build.VERSION.SDK_INT >= VERSION_CODE_CINNAMON_BUN |
Contributor
There was a problem hiding this comment.
I think the permission can only be requested if targetSdkVersion is >= VERSION_CODE_CINNAMON_BUN too.
Collaborator
Author
There was a problem hiding this comment.
It's required on any device running android 17 regardless of the target level
|
@fabriziocucci has imported this pull request. If you are a Meta employee, you can view this in D109160057. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Android 17 (SDK 37) introduces Local Network Protection. Reaching any local-network address now requires the runtime
ACCESS_LOCAL_NETWORKpermission. This is how the dev server is reached, so on an Android 17 device the dev bundle download is blockedThis adds a debug-only path that requests
ACCESS_LOCAL_NETWORKbefore the first bundle load and defersloadAppuntil the user answers, so a slow response can't cause an errorcc @zoontek
Changelog:
[Android] [Fixed] - Request
ACCESS_LOCAL_NETWORKso the dev server stays reachable on Android 17 (SDK 37)[Android] [Added] - AddACCESS_LOCAL_NETWORKtoPermissionsAndroidTest Plan:
Validated on an Android 17 emulator and physical device.
launch → prompt appears → grant → bundle loads.
Deny → app starts and shows the normal red-box connection error.
adb reverse: no prompt (loopback is exempt).