Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android M: Programmatically revoke permissions

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.

like image 923
W3hri Avatar asked Jul 21 '15 09:07

W3hri


People also ask

What is Read_phone_state permission?

android. permission. READ_PHONE_STATE - You must ask the end user to grant this permission.) Allows read only access to the phone's state, and is used to determine the status of any ongoing calls. You need this permission so you can verify that your end user receives a phone call from Telesign.

What does remove permission if app is unused?

From the App info menu, you can also enable the Remove permissions if app is unused feature, which removes permissions for the app if you haven't used it for three months.

What is SYSTEM_ALERT_WINDOW permission?

The permission was introduced in Android 6.0 and it can allow an app to be displayed on top of another app, obscuring the lower-level app. In order to use the SYSTEM_ALERT_WINDOW permission, an app has to have explicit, manual approval from the user.


1 Answers

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.

like image 119
greywolf82 Avatar answered Sep 22 '22 19:09

greywolf82