Skip to content

Commit

Permalink
Fix: Return correct permission status for Android's limited media acc…
Browse files Browse the repository at this point in the history
…ess (Baseflow#1362)
  • Loading branch information
VladShturma authored and dogiaplinh committed Sep 13, 2024
1 parent 58fa209 commit 4d75c14
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
4 changes: 4 additions & 0 deletions permission_handler_android/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 12.0.12

* Fixes permission status returned from `Permission.photos.request()` or `Permission.videos.request()` when limited access selected

## 12.0.11

* Adds `TargetApi` annotation to `getManifestNames` method in `PermissionUtils.java`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ public boolean onRequestPermissionsResult(
}

requestResults.put(permission, permissionStatus);
// [grantResults] can only contain PermissionConstants.PERMISSION_STATUS_GRANTED or PermissionConstants.PERMISSION_STATUS_DENIED status.
// But these permissions can have status PermissionConstants.PERMISSION_STATUS_LIMITED, so we need to recheck status
} else if (permission == PermissionConstants.PERMISSION_GROUP_PHOTOS || permission == PermissionConstants.PERMISSION_GROUP_VIDEOS) {
requestResults.put(
permission,
determinePermissionStatus(permission));
} else if (!requestResults.containsKey(permission)) {
requestResults.put(
permission,
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.11
version: 12.0.12

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

0 comments on commit 4d75c14

Please sign in to comment.