Analyzer: Keep storage overview available with invalid app list#2444
Draft
d4rken wants to merge 4 commits into
Draft
Analyzer: Keep storage overview available with invalid app list#2444d4rken wants to merge 4 commits into
d4rken wants to merge 4 commits into
Conversation
Skip package-owner forensics when the app inventory setup is incomplete so Storage Analyzer can still size top-level media folders. The fallback media category is read-only, preserving cleanup safety while allowing users to inspect storage usage.
ContentViewModel blocks delete/filter/swiper on read-only MediaCategory groups, but Analyzer.deleteContent() ran target.delete() before inspecting the category, so a ContentDeleteTask aimed at a read-only media group (a real, accessible storage-root path) would still delete. Add a guard before the delete loop that throws UnsupportedOperationException for read-only MediaCategory, matching the SystemCategory contract but running before any destructive call.
Extend the deleteContent pre-delete guard to reject SystemCategory as well as read-only MediaCategory. Deep-scanned system content can hold real deletable paths (/system, /data, ...) on rooted/ADB devices, and the only prior core check was the exhaustiveness throw during category rebuild, which ran after target.delete() had already executed. Resolve the category and group once, fail-closed, before any destructive work, and drop the redundant post-delete lookup.
When the app inventory is unavailable, the media category is shown read-only with no explanation, so delete/filter/Swiper actions silently disappear. Show an info row at the top level (mirroring the system category) telling the user that sizes are shown for reference only and those actions are disabled.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What changed
Lets Storage Analyzer continue showing storage usage when the system returns an invalid app inventory, while keeping potentially unsafe actions blocked.
Technical Context
PkgRepo, which throws when the app inventory is missing core packagesValidation:
./gradlew :app-tool-analyzer:compileDebugKotlin :app-tool-analyzer:testDebugUnitTestCloses #2441