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

[DEBUG] Notify client that permission process has ended #163

Closed bastienpaulfr closed 7 years ago

bastienpaulfr commented 7 years ago

Hi,

I have noticed that if DexterActivity is launched when screen is off, DexterActivity.onRequestPermissionsResult() is never called. Thus client is never notified that permission process has ended.

I have implemented a simple mechanism to detect that DexterActivity.onRequestPermissionsResult() is called before DexterActivity.onDestroy(). If it not the case, then we simulate a permission request cancel.

Regards,

B.

flipper83 commented 7 years ago

Why do you change the classes visibitily for most restrictive visibility? this is a breaking change with the public api definition and could provoke problems and we need upgrade the major api version.

bastienpaulfr commented 7 years ago

@flipper83 : Checkstyle is telling me to put constructors to the same visibility level than class definition.

Serchinastico commented 7 years ago

Hi @bastienpaulfr

I'm thinking on the implications of these changes and I'm worried about how it changes the execution flow when the user somehow closes/pauses the app and the inner activity dies. In that case we'd be reporting the permissions as denied when nothing really happened.

Again, this PR addresses an issue that we don't want to support (we don't ask for permissions when the screen is off ourselves so we don't know how it'll behave). I'd recommend you to create a fork to handle these specific issues.