Commit 39ede95
Fix request permission is not always resolving in Android 16 (facebook#53898)
Summary:
Fixes: facebook#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: facebook#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: 7bf33b379a1b6606ad2da2f75d337bf951e3986b1 parent d7bcaf6 commit 39ede95
File tree
1 file changed
+25
-1
lines changed- packages/react-native/ReactAndroid/src/main/java/com/facebook/react
1 file changed
+25
-1
lines changedLines changed: 25 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
248 | 249 | | |
249 | 250 | | |
250 | 251 | | |
251 | | - | |
| 252 | + | |
252 | 253 | | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
258 | 259 | | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
259 | 283 | | |
260 | 284 | | |
261 | 285 | | |
| |||
0 commit comments