-
Notifications
You must be signed in to change notification settings - Fork 24.9k
Fix request permission is not always resolving in Android 16 #53898
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 request permission is not always resolving in Android 16 #53898
Conversation
@cortinico has imported this pull request. If you are a Meta employee, you can view this in D83059478. |
packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactActivityDelegate.java
Outdated
Show resolved
Hide resolved
@gabrieldonadel any timeline regarding when this issue could be resolved? |
@gabrieldonadel will there be a release with this fix for react native 0.79? |
@cortinico has imported this pull request. If you are a Meta employee, you can view this in D83059478. |
This pull request was successfully merged by @lukmccall in 39ede95 When will my fix make it into a release? | How to file a pick request? |
will this be included in version 0.81.5? |
@irekrog there's a pick request open for 0.81: reactwg/react-native-releases#1151 |
Summary: Fixes: #53887 Fixes: expo/expo#39480 In the latest Android 16 update, requesting permissions does not always change the app's state (the `onPause` and `onResume` functions aren't called). For instance, when you deny permission 3 times, the last promise won't resolve until you move the app to the background. The current logic inside the `ReactActivityDelegate` assumes that Android will call `onResume` after receiving permission state information from the system, which is no longer the case. Probably connected with [this commit](https://android.googlesource.com/platform/packages/modules/Permission/%2B/5dca0ccb26f2b99d706a1d3e9402f851e849c913) ## Changelog: [ANDROID] [FIXED] - Fix request permission not always resolving in Android 16 Pull Request resolved: #53898 Test Plan: - I've tested it in the RNTester by denying the camera permission three times. - I've also checked if the patch works with the Expo permissions code. Reviewed By: javache Differential Revision: D83059478 Pulled By: cortinico fbshipit-source-id: 7bf33b379a1b6606ad2da2f75d337bf951e3986b
This pull request was successfully merged by @lukmccall in 447a7a3 When will my fix make it into a release? | How to file a pick request? |
Summary:
Fixes: #53887
Fixes: expo/expo#39480
In the latest Android 16 update, requesting permissions does not always change the app's state (the
onPause
andonResume
functions aren't called). For instance, when you deny permission 3 times, the last promise won't resolve until you move the app to the background. The current logic inside theReactActivityDelegate
assumes that Android will callonResume
after receiving permission state information from the system, which is no longer the case.Probably connected with this commit
Changelog:
[ANDROID] [FIXED] - Fix request permission not always resolving in Android 16
Test Plan: