Android 12 will automatically hibernate unused apps to free up space

Although Google doesn’t release the source code for newer versions of Android until the stable release for Pixel phones is ready, we rarely take a look at future features through code changes sent to AOSP Gerrit. One of the features we expected to land in the next version of Android 12 is hibernation of applications, a feature that will free up storage space by deleting temporary files from unused applications. Although this feature did not appear in either of the two publicly available developer versions, we can confirm that the code for the feature is present in the leaked version we recently obtained.

An APK breakdown can often predict features that may appear in a future update of an application, but any of the features mentioned here may not do so in a future release. This is because these features are currently not implemented in the live version and can be extracted at any time by the developers in a future version.

With the release of Android 11 Developer Preview 3, Google has added a new “automatic revocation of permissions” feature that revokes an app’s permission if the app hasn’t been used for months. After the stable release of Android 11, Google shared several details about the feature, including a screenshot showing a notification informing the user when an app’s permissions have been revoked, and a screenshot showing an “unused apps” settings page with a list of applications whose permissions have been automatically revoked.

In Android 12, Google seems to extend the concept of “unused applications” with the new application hibernation feature. In addition to automatically revoking permissions for unused apps, Android 12 will also delete temporary files to free up storage space.

We’ve enabled a new “Unused apps” section on the “App info” page for each app and contains a new “Remove permissions and free space” switch. In comparison, Android 11’s “automatic revocation permissions” switch (later renamed to “remove permissions if app isn’t used”) can be found in the “App Permissions” subpage of an app’s “App Info” page. This change of location makes sense, because the new switching takes care of both permissions and storage, not just permissions.

After manually hibernating a few apps, the “Unused apps” page appeared in Settings> Apps. This page displays applications that haven’t been opened in a few months, and its description states that permissions are revoked, notifications are turned off, and temporary files are deleted if an application hasn’t been used in a few months.

According to the code changes we noticed earlier this year, the application’s hibernation feature will clear the cache and / or clear the build artifacts to free up storage space. None of these actions will free up a lot of space, but this depends on exactly what application is hibernating and how many / what kind of cache files have been stored. Users who have state-of-the-art devices with less storage space will benefit from more than one advantage, but all users will benefit from unused applications that have their permissions revoked automatically.

Although the version we got is newer than Developer Preview 2, we don’t know if the app’s hibernation feature will make a public appearance in DP3 or Beta 1. However, once it’s available, its command-line interface can be accessed through “cmd app_hibernation“Command.

Thanks to PNF Software for providing us with a license to use JEB decompiler, a professional-grade reverse engineering tool for Android applications.

Source