How to programatically revoke Manifest.permission.CALL_PHONE?

Viewed 66

In my app (written in Kotlin), I have a switch for every required permission, so my users can revoke them at any given time; turning on Manifest.permission.CALL_PHONE is easy (I follow the standard procedure, showing required dialogs when needed, etc). My problem is, I'm not sure what to do when my users disable the switch. I would like to either:

  1. Offer the user a way to revoke this permission from the app itself (is this even possible?)
  2. Transfer them to the corresponding place in the device settings in order to turn it off (this is what I do with the rest of my permission, such as Overlay, for example; I didn't find anything for CALL_PHONE under android.provider.Settings.*)

Right now, whenever my user turns this switch off, I show a toast that says "Please revoke from settings" and then they have to go and search the required setting themselves, and my app would keep up to date with that, but in my opinion this is not ideal.

0 Answers
Related