Skip to content

Commit

Permalink
Reply already submitted in Android 13 while user request permissions (B…
Browse files Browse the repository at this point in the history
…aseflow#1147)

* Reply already submitted in Android 13 while user request permissions(eg.
post_notification, locations)

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

Co-authored-by: Jeroen Weener <[email protected]>

---------

Co-authored-by: Jeroen Weener <[email protected]>
  • Loading branch information
jinchengwu-ola and JeroenWeener authored Sep 13, 2023
1 parent d8882f1 commit 4026813
Show file tree
Hide file tree
Showing 3 changed files with 10 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 @@
## 11.0.1

* Fixes `java.lang.IllegalStateException: Reply already submitted` when requesting post notification permission.

## 11.0.0

* **BREAKING CHANGE:** Fixes a bug where the permission status would return 'denied' regardless of whether the status was 'denied' or 'permanently denied'.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ public boolean onRequestPermissionsResult(
return false;
}

if (permissions.length == 0 && grantResults.length == 0) {
Log.w(PermissionConstants.LOG_TAG, "onRequestPermissionsResult is called without results. This is probably caused by interfering request codes. If you see this error, please file an issue in flutter-permission-handler, including a list of plugins used by this application: https://github.com/Baseflow/flutter-permission-handler/issues");
return false;
}

for (int i = 0; i < permissions.length; i++) {
final String permissionName = permissions[i];

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: 11.0.0
version: 11.0.1

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

0 comments on commit 4026813

Please sign in to comment.