New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
@OnNeverAskAgain not being called #78
Comments
@emarc-m Ah, could u use 2.0.2 for the time being? It might works well. So sorry! |
@hotchemi Thanks for that info. |
It's time to add functional tests. |
Right code is as follows. static void onRequestPermissionsResult(BaseActivity target, int requestCode, int[] grantResults) {
switch (requestCode) {
case REQUEST_INITIALIZESCANNING:
+ // Never ask again is never shown if Build.VERSION. SDK_INT is under 23
+ if (Build.VERSION. SDK_INT < 23 && !PermissionUtils.hasSelfPermissions(target, PERMISSION_INITIALIZESCANNING)) {
target.showDenied();
return;
}
if (PermissionUtils.verifyPermissions(grantResults)) {
target.initializeScanning();
} else {
if (!PermissionUtils.shouldShowRequestPermissionRationale(target, PERMISSION_INITIALIZESCANNING)) {
target.showNeverAsk(); // this is NEVER called
} else {
target.showDenied();
}
}
break;
default:
break;
}
} |
@shiraji Might be the good idea but it takes a bunch of cost...worrisome problem. |
Wait, I think there is one more problem. PermissionDispatcher must take care of SYSTEM_ALERT_WINDOW and WRITE_SETTINGS. This test case is not correct. Should be following: if (!Settings.System.canWrite(target)) This line should check if it is in We need to refactor Do you want me to send pull request for this? |
@shiraji Umm, actually this line is just workaround for under M devices. See #45 (comment) . I'm not sure the same thing happens in SYSTEM_ALERT_WINDOW and WRITE_SETTINGS.
Sure! |
That makes life easier! |
@emarc-m Just released 2.0.4. Really appreciated for your report. |
@hotchemi Thanks for the support. |
Annotating a method with @OnNeverAskAgain is not called. What is called is the method annotated with @OnPermissionDenied.
I think the generated code conditions checks are incorrect.
Thanks. Great work BTW.
The text was updated successfully, but these errors were encountered: