Automatic Permission Removal

Android 11 adds a user option to have Android automatically revoke permissions if your app is unused for an extended period of time (months):

BackgroundLocation Permissions Screen in Settings, Showing Auto Revoke Permissions Option
BackgroundLocation Permissions Screen in Settings, Showing Auto Revoke Permissions Option

Once again, this should not be a major problem for well-written apps. Partly, that is because this is not significantly different than the user revoking permissions manually, which you have needed to handle. Partly, that is because a well-written app is likely to be used frequently enough to avoid the automatic permission removal.

In theory, you can add android:autoRevokePermissions="disallowed" to the <application> element to say that the switch would be off by default. The documentation for this setting states “This declaration may cause an additional review when publishing your app”. In addition, it does not work.

Another option is android:autoRevokePermissions="discouraged". This is supposed to allow you to use ACTION_AUTO_REVOKE_PERMISSIONS to lead the user to a screen where they can toggle the switch to the off position. However, this does not work, insofar as it only leads the user to the main page for your app in Settings, not to “UI to manage auto-revoke state” as is stated in the documentation.


Prev Table of Contents Next

This book is licensed under the Creative Commons Attribution-ShareAlike 4.0 International license.