Skip to content

Commit 04323b8

Browse files
committed
fix page may hang in Android 12 due to unrequested but autogranted notification perm
1 parent 5da3bf9 commit 04323b8

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

lib/flutter_force_permission.dart

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,17 @@ class FlutterForcePermission {
4949
for (final permConfig in config.permissionItemConfigs) {
5050
for (final perm in permConfig.permissions) {
5151
if (!(permissionStatuses[perm]?.requested ?? true)) {
52-
needShow = true;
53-
break;
54-
}
55-
if (permissionStatuses[perm]?.status != PermissionStatus.granted &&
56-
permConfig.required) {
57-
needShow = true;
58-
break;
59-
}
60-
if (perm is PermissionWithService &&
61-
permissionStatuses[perm]?.serviceStatus == ServiceStatus.disabled &&
62-
permConfig.required) {
63-
needShow = true;
52+
if (permissionStatuses[perm]?.status != PermissionStatus.granted &&
53+
permConfig.required) {
54+
needShow = true;
55+
break;
56+
}
57+
if (perm is PermissionWithService &&
58+
permissionStatuses[perm]?.serviceStatus == ServiceStatus.disabled &&
59+
permConfig.required) {
60+
needShow = true;
61+
break;
62+
}
6463
break;
6564
}
6665
}

0 commit comments

Comments
 (0)