Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Didn't get right result when set targetSdkVersion to 15 #140

Open
johnwatsondev opened this issue Mar 28, 2017 · 6 comments
Open

Didn't get right result when set targetSdkVersion to 15 #140

johnwatsondev opened this issue Mar 28, 2017 · 6 comments
Assignees

Comments

@johnwatsondev
Copy link

johnwatsondev commented Mar 28, 2017

Expected behaviour

Testing Device: Nexus 5 (6.0.1)

  1. My production environment project's targetSdkVersion was set to 15. So I used Dexter's sample to test. (Changed the targetSdkVersion to 15 in sample module's build.gradle)
  2. When I installed the app, all requesting permissions were allowed by default.
  3. Then I denied the Camera and Contacts permissions as follow.
    deny permission in setting
  4. I clicked the REQUEST ALL button and debugged the feedbackViewMultiplePermissionListener instance.
    I wanted the onPermissionsChecked(MultiplePermissionsReport report) method's parameter report giving me the right result. But the debugger's SNAPSHOT as follow:
    debug the report variable

Actual behaviour

Please read it in Expected behaviour section 4's SNAPSHOT.

Steps to reproduce

Please read it in Expected behaviour section 1 - 3.

Version of the library

Branch master's code with 737c419

@Serchinastico
Copy link
Contributor

Hi @johnwatsondev

Interesting behaviour you just found here... I'm wondering if you can give us more information about the Android version of the device you were using to test.

@johnwatsondev
Copy link
Author

johnwatsondev commented Mar 28, 2017

@Serchinastico
I have got a solution after did some research.
I should use PermissionChecker.checkSelfPermission() check whether user granted the permission.
I have tested this method on my device --- Nexus 5 (6.0.1) with targetSdkVersion 15

@johnwatsondev johnwatsondev changed the title Didn't get right result when set targetSdkVersion to 14 Didn't get right result when set targetSdkVersion to 15 Mar 28, 2017
@johnwatsondev
Copy link
Author

johnwatsondev commented Mar 28, 2017

I thought we should just add this info to README instead of modified the AndroidPermissionService class's implement.

Because of this library was intended to check RUNTIME permission for API level more than 23.
More info click here android-6.0-changes

@Serchinastico
Copy link
Contributor

Honestly, I didn't even know of the existence of that class 😱, we'll probably need to migrate to that API so that we don't have this problem in the future.

Thanks again for reporting back! We'll tackle the problem, one way or the other.

@johnwatsondev
Copy link
Author

johnwatsondev commented Mar 28, 2017

Here was a workaround.
Please checked it. :)

@Serchinastico
BTW, should we provide another util class to handle this check mission? I'm glad hear about the idea from you.

@Serchinastico
Copy link
Contributor

I've just created a PR to address this issue, @johnwatsondev feel free to review it if you want!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants