Skip to content

Commit 3d8f958

Browse files
authored
Fix issue 1360 (#1361)
1 parent 9ea0aff commit 3d8f958

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

permission_handler_android/CHANGELOG.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
1+
## 12.0.10
2+
3+
* Fixes a bug that causes a `NullPointerException` when the application is restarted after being killed by Android during the request of special permissions (like, `Permission.ignoreBatteryOptimizations`, `Permission.systemAlertWindow`, `Permission.accessNotificationPolicy`, `Permission.scheduleExactAlarm` and `Permission.manageExternalStorage`).
4+
15
## 12.0.9
2-
* Added Make the status return of the READ_MEDIA_VISUAL_USER_SELECTED permission more accurate.
6+
7+
* Makes the status returned when requesting the READ_MEDIA_VISUAL_USER_SELECTED permission more accurate.
8+
39
## 12.0.8
410

5-
* Added support for limited photo and video permission on Android.
11+
* Adds support for limited photo and video permission on Android.
612

713
## 12.0.7
814

permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
7474
return false;
7575
}
7676

77+
// The [onActivityResult] with a [requestResult] that is `null` when the Application was
78+
// terminated while not in the foreground with a permission request in progress (e.g. when
79+
// Android decides to kill apps while requesting one of the special permissions). In these
80+
// cases we should casually return and make sure the `pendingRequestCount` is set to `0`.
81+
if (requestResults == null) {
82+
pendingRequestCount = 0;
83+
return false;
84+
}
85+
7786
int status, permission;
7887

7988
if (requestCode == PermissionConstants.PERMISSION_CODE_IGNORE_BATTERY_OPTIMIZATIONS) {

permission_handler_android/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: permission_handler_android
22
description: Permission plugin for Flutter. This plugin provides the Android API to request and check permissions.
33
homepage: https://github.com/baseflow/flutter-permission-handler
4-
version: 12.0.9
4+
version: 12.0.10
55

66
environment:
77
sdk: ">=2.15.0 <4.0.0"

0 commit comments

Comments
 (0)