Baseflow / Baseflow/flutter-permission-handler

[Bug]: permissions is already running

Open
#1,371 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
2.2k
Forks
970
Avg merge
14h 22m
Merged PRs (30d)
2

Description

### Please select affected platform(s)

- [x] Android
- [ ] iOS
- [ ] Windows

### Steps to reproduce

1.start to get the permission like camera.
2.cancle the permission dialog by gesture.(onrequestpermissionResult will not callback on this moment)
3.start to get the camera permission again.
4.bug happened.

### Expected results

I tried to fix this, but I'm not sure if it will affect the others。

My modification plan like it↓:

```java
private boolean isAbleToClearCount = false;

@PermissionConstants.PermissionStatus
private int determinePermissionStatus(final @PermissionConstants.PermissionGroup int permission) {
if (isAbleToClearCount) {
isAbleToClearCount = false;
pendingRequestCount = 0;
}

line 435:
if (permissionsToRequest.size() > 0) {
isAbleToClearCount = true;
final String[] requestPermissions = permissionsToRequest.toArray(new String[0]);
ActivityCompat.requestPermissions(
activity,
requestPermissions,
PermissionConstants.PERMISSION_CODE);
}
```

Looking forward to your reply。

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.