Open In App

Understanding Self-Downgrading App Permissions in Android 13

Last Updated : 26 Jan, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Your app can withdraw access to unneeded runtime permissions starting with Android 13. This API enables your program to carry out operations that improve privacy, including the ones listed below:

  1. Follow recommended practices for permissions to increase user confidence. 
  2. You might want to think about displaying a dialogue to the users that lists the permissions you have proactively removed.
  3. Eliminate any unneeded permissions.

In today’s world, there are a lot of pf privacy concerns that are being constantly thought about by people, and the users of your app can feel safe if you actually tell them that you have revoked certain permissions at your will, due to non-use of them. This will all-in-all put more sense of trust in your app and can yield better reviews and downloads of your product from the store. This serves as a kind of boon to the users and as to developers too, as you now have access to downgrade your own self of elect permissions. 

Perform this action when you update your app so that users are more likely to comprehend why your program keeps asking for particular permissions. This information promotes user confidence in your app.

GeekTip #1: Pass the name of the runtime permission you want to revoke access to into the revokeSelfPermissionOnKill function (). Pass a list of permission names into revokeSelfPermissionsOnKill to revoke access to several runtime rights at once ().

All processes connected to your app’s UID are terminated as part of the permission removal procedure, which occurs asynchronously.

GeekTip #2: You must disable access to every permission in a given permission group in order for system settings to reflect that your app doesn’t access data in that group. Calling revokeSelfPermissionsOnKill() and passing in numerous permissions from the permission group may be useful in this situation.

How Does Downgrading the Permissions Work in Android 13?

All processes connected to your program must be terminated for the system to revoke access to the permissions. When you call the API, the system decides when to kill these processes. The system often waits until your program is running in the background rather than the foreground for a significant amount of time. The next time the user runs your program, display a prompt to let them know that access to certain runtime rights is no longer necessary. The list of permissions may be included in this dialogue.

Automatic Resetting of Unused App Permissions

The system safeguards user data by automatically resetting the delicate runtime permissions that the user had granted your app if it targets Android 11 (API level 30) or higher and isn’t utilized for a few months. The tutorial has more information on app hibernation. This was also done so as to make the overall system safer and more secure.

How to Provide all the Runtime Rights to Your Application?

This would only be the case when you are testing your app on an emulator, you cannot have this level of access until your app explicitly declares itself as a System App or a Vital Application requiring the high priv. You can achieve this by running the below code snippet in your Android Studio configuration:

adb shell install -g GFG_APK_FILE_PATH

Best Practices if Some User Still Denies Your Downgraded Requests

Your app needs to inform users of the consequences of declining a permission request if they do so. Your app should specifically inform users of any functionality that are disabled due to a lack of authorization. The following best practices should be kept in mind as you proceed:

  1. You can tell the user the advantage of the permission getting removed and get credited for your app doing so, there are a few chances that the user will still not understand why the permissions were downgraded.
  2. Be Precise: Don’t use a boilerplate message. Instead, be explicit about which functions are disabled because your app lacks the required permission
  3. Keep the User Interface Clear: In other words, avoid showing customers a full-screen warning notice that forbids them from using your app at all. 

Conclusion

The self-downgrading app permission is clearly an advantageous quote to get your app get the extra shine, as you can see you can take this to an advantage and tell the user how your app is concerned about the privacy of the user and thus attain a clean image in today’s world where there are privacy concerns running all over the world for digital apps.


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads