3

I am upgrading my app for Android Q. But here is a restriction such as any default app is approved as a role manager.

When request for setting a particular Role (eg. ROLE_SMS) then a popup is showing to set that role.

But in that dialog their is an option that user can check 'don't ask again' option.

My question is, How can i ask or redirect the user to role setting screen for granting that role again?

Pradeep Kumar
  • 586
  • 3
  • 19
  • Does this answer your question? [Android M - anyway to know if a user has chosen never to show the grant permissions dialog ever again?](https://stackoverflow.com/questions/33224432/android-m-anyway-to-know-if-a-user-has-chosen-never-to-show-the-grant-permissi) – Martin Marconcini Nov 22 '19 at 13:39
  • Just check that permission is granted or not. If not then navigate user to the settings to grant particular permission. You can also display dialog with custom message before letting user to the Settings screen. https://stackoverflow.com/questions/19517417/opening-android-settings-programmatically – Jaimin Modi Nov 22 '19 at 13:39
  • I thought it is different from android m permissions. Because Role and Manifest permissions are different. – Pradeep Kumar Nov 22 '19 at 14:06
  • @PradeepKumar - Have you found a solution to this? – Aitor Viana Nov 25 '20 at 09:32
  • Have you found a solution? – tm1 Jan 06 '22 at 06:51

2 Answers2

0

According to the docs Android will stop displaying system dialog for allowing permissions if the user has denied the request more than once during an installation. Haven't found an API for this but you can keep track of denials internally.

You can navigate to the App Info view in the settings app via a startActivity.

Clocker
  • 1,316
  • 2
  • 19
  • 29
0

People answering this question confuse Permissions with Roles.

For Permissions "don't ask again" or "never ask again" can be easily detected - just check shouldShowRequestPermissionRationale() in the permission request result callback.

Unfortunately, for Roles I haven't found any way to detect permanent denial.

Woland
  • 111
  • 1
  • 2
  • 9