Karumi / Dexter

Android library that simplifies the process of requesting permissions at runtime.
http://karumi.com
Apache License 2.0
5.23k stars 671 forks source link

onPermissionRationaleShouldBeShown dialog behind system permission dialog. #184

Open spurd0 opened 6 years ago

spurd0 commented 6 years ago

Expected behaviour

PermissionToken pauses system dialog for permission untill PermissionToken.cancel() or PermissionToken.continue() is called.

Actual behaviour

onPermissionRationaleShouldBeShown dialog is behind system permission dialog. It's only avaiable when user clicks grant or deny button.

Steps to reproduce

Press contacts button, deny permission. Press contacts once more, onPermissionRationaleShouldBeShown dialog should appear before before system dialog.

Version of the library

4.1.1

Serchinastico commented 6 years ago

Hi @spurd0

I'm wondering if it has to do with the change we introduced in 3.1.0 where the BasePermissionListener now calls token.continuePermissionRequest(); in the default onPermissionRationaleShouldBeShown implementation. The reason was that we had several opened issues wondering why the permissions flow suddenly stopped and wasn't working just because they weren't using the token at all.

I think the sample project does that but it's just because we are too lazy to update it (:sweat_smile:).