Skip to content

Commit

Permalink
Fix issue 1360 (#1361)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvanbeusekom authored Aug 16, 2024
1 parent 9ea0aff commit 3d8f958
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
10 changes: 8 additions & 2 deletions permission_handler_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
## 12.0.10

* 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`).

## 12.0.9
* Added Make the status return of the READ_MEDIA_VISUAL_USER_SELECTED permission more accurate.

* Makes the status returned when requesting the READ_MEDIA_VISUAL_USER_SELECTED permission more accurate.

## 12.0.8

* Added support for limited photo and video permission on Android.
* Adds support for limited photo and video permission on Android.

## 12.0.7

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ public boolean onActivityResult(int requestCode, int resultCode, Intent data) {
return false;
}

// The [onActivityResult] with a [requestResult] that is `null` when the Application was
// terminated while not in the foreground with a permission request in progress (e.g. when
// Android decides to kill apps while requesting one of the special permissions). In these
// cases we should casually return and make sure the `pendingRequestCount` is set to `0`.
if (requestResults == null) {
pendingRequestCount = 0;
return false;
}

int status, permission;

if (requestCode == PermissionConstants.PERMISSION_CODE_IGNORE_BATTERY_OPTIMIZATIONS) {
Expand Down
2 changes: 1 addition & 1 deletion permission_handler_android/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: permission_handler_android
description: Permission plugin for Flutter. This plugin provides the Android API to request and check permissions.
homepage: https://github.com/baseflow/flutter-permission-handler
version: 12.0.9
version: 12.0.10

environment:
sdk: ">=2.15.0 <4.0.0"
Expand Down

0 comments on commit 3d8f958

Please sign in to comment.