diff --git a/permission_handler_android/CHANGELOG.md b/permission_handler_android/CHANGELOG.md index 2279c7d68..633d85129 100644 --- a/permission_handler_android/CHANGELOG.md +++ b/permission_handler_android/CHANGELOG.md @@ -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'. diff --git a/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionManager.java b/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionManager.java index 7e53f9d02..187474eef 100644 --- a/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionManager.java +++ b/permission_handler_android/android/src/main/java/com/baseflow/permissionhandler/PermissionManager.java @@ -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]; diff --git a/permission_handler_android/pubspec.yaml b/permission_handler_android/pubspec.yaml index ff45a62d8..0d80738f7 100644 --- a/permission_handler_android/pubspec.yaml +++ b/permission_handler_android/pubspec.yaml @@ -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"