AppCleaner: Improve ACS based cache clearing resilience by detecting storage entries "on-the-fly" via app size values #1065
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most "Storage" entries in system details have a summary row that says something like "604 MB in internal storage" While we don't know the translation of "in internal storage", we know the app size, so we can look for "604 MB". There is a slight chance for false-positives if the data-usage of the app is the same as the app size, but that's pretty rare. If that happens SD Maid just keeps retrying as usual.
With 218 apps this had a 99% success rate.
There was one app ("Digital Wellbeing", a system app), that showed the wrong app size (36,06 MB) on first load. Only when SD Maid retried and reloaded the settings details, the size displayed correct (35,96 MB). No idea why the size was displayed incorrectly the first time...
When clearing caches via ACS we now have 3 tier process:
Try to get the storage entry label via string resource ID
Try hard coded labels by language code
Try to find the summary row by looking up the app size
This should make it a lot easier to automatically support ROMs after updates, where the texts change.