Android M: Programmatically revoke permissions

W3hri picture W3hri · Jul 21, 2015 · Viewed 12.4k times · Source

I am currently playing around with android m's new permission system. What i am planning is to add a screen to my in-app settings where the user can grant or revoke permissions.

The screen would look like the regular system settings screen, but will have additional information why my app needs the specific permission. This settings screen would be an addition to the regular permission handling as suggested in the Documentation.

The workflow would be:

  • granting permission: open the systems dialog to grant/revoke (like suggested here)
  • revoking permission: revoke it programmatically

So my question is, can permissions be revoked programatically? I searched a lot, but didn't manage to get some results.

Answer

greywolf82 picture greywolf82 · Jul 21, 2015

You can't do anything (at least until now). In addition, there isn't any intent action to open the activity system settings for your app. My suggestion is to open a "feature request" on the developer preview issue tracker.