tbruyelle/RxPermissions

Shouldn't automatic GRANTED on pre M

Closed this issue · 5 comments

As descrived in: http://developer.android.com/reference/android/content/pm/PackageManager.html#checkPermission(java.lang.String, java.lang.String)

Permissions in pre M can be denied too, so library doesn't retuirn true by default

(As example: Cyanogen ROMs allow to disable permissions)

Good point.

Do you know if there's relation between PackageManager.checkPermission and Context.checkSelfPermission() ?

My first attempt to fix thgis issue is to check PackageManager.checkPermission only pre-M but I have a doubt, maybe I should check it for all versions ?

Using ContextCompat and ActivityCompat instead of activity directly will automatic grant access on pre M
the android training https://developer.android.com/intl/es/training/permissions/requesting.html use them

@ffgiraldez Yes I saw that but I didn't use it to prevent an external dependency and also because I thought it's easy to implement.

But I wasn't aware of the PackageManager.checkPermission thing. I would like to see the source of ContextCompat.checkSelfPermissions() but it seems it's not released yet (https://github.com/android/platform_frameworks_support/blob/master/v4/java/android/support/v4/content/ContextCompat.java)

ContextCompat.checkSelfPermissions() is now visible, but there is no call to PackageManage.checkPermission().

Closed because no idea of what to do here