Android 12 is the dessert of the season, but that doesn't mean older versions can't join in on some of the fun. Android as an OS has been maturing over the past decade, and in a lot of instances, it becomes more important to deliver features to a wider userbase than to bring in new features on a new software version that would take years to propagate. Google is doing the former, as it looks to expand the permission auto-reset feature to Android 6.0 and higher devices with Google Play Services. Today's announcement pushes the initial rollout promise of December 2021, to January 2022.

What is Permission Auto-Reset?

With Android 11 in 2020, Google introduced a few changes to the runtime permissions model, and its worth taking a look at a quick summary. In Android 10 and below, for "dangerous" permissions (aka permissions with a lot of scope for misuse), apps could request permission once and retain it for as long as the app remained installed or the user manually revoked it or cleared the app data. And it was common for apps to request such permissions even when they needed them for a non-core and optional function. Considering the fact that the average user does not understand the scope of the permissions they granted, and that periodic review of such permissions was not something that most users would do, the end result was that way too many apps had access to way too many permissions even when the app itself was not getting used.

Android 11 introduced One-Time Permissions and Permissions Auto-Reset to tackle this problem. One-Time Permissions are exactly that -- they allowed the app access for a very brief period of time, allowing the app to complete its non-core function when the user requested it to. You could still choose to grant permission for a longer period of time if you regularly needed the app to perform this non-core function. Permissions Auto-Reset on the other hand, tackled situations wherein apps that were once granted such permissions for frequent use are no longer being frequently used. If Android detected that the user hasn't used an app for a while, it will automatically revoke all granted permissions. The app can longer initiate those functions in the background now. When the user uses the app the next time, they will get the opportunity to grant those permissions again.

Bringing auto-reset permissions to older OS versions

A few months ago, Google had announced that it will be bringing Android 11's permission auto-reset feature to all devices running Android 6.0 and above. At the time of the announcement, Google mentioned that the feature will start rolling out to Android 6.0 and above devices that have Google Play Services installed in December 2021. The newsworthy bit for today's announcement is that the feature begins rolling out next month, January 2022.

From previous announcements, we know that the feature will be enabled by default for apps targeting Android 11 (API level 30) or higher. For apps targeting API levels 23 to 29, users will have to enable it manually from settings. The feature will not apply to Device Administrator apps, and permissions fixed by enterprise policies will also not be revoked. If required, the app developer can also ask the user to disable the auto-reset permission feature. If your app targets API level 30 or above and you wish to ask the user to disable permission auto-reset, then you’ll need to use the new cross-platform API that’s part of the Jetpack Core library --  androidx.core.content.PackageManagerCompat.getUnusedAppRestrictionsStatus() and androidx.core.content.IntentCompat.createManageUnusedAppRestrictionsIntent(). Doing so is helpful for apps that primarily operate in the background, such as a companion app for your smartwatch.