Skip to content
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: Return correct permission status for Android's limited media access #1362

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -260,6 +260,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
Loading