Skip to content

Analyzer: Keep storage overview available with invalid app list#2444

Draft
d4rken wants to merge 4 commits into
mainfrom
fix/analyzer-degraded-storage
Draft

Analyzer: Keep storage overview available with invalid app list#2444
d4rken wants to merge 4 commits into
mainfrom
fix/analyzer-degraded-storage

Conversation

@d4rken
Copy link
Copy Markdown
Member

@d4rken d4rken commented May 24, 2026

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

  • Root cause: the previous partial-scan path still ran top-level owner forensics before the app-category setup guard, and owner forensics can initialize PkgRepo, which throws when the app inventory is missing core packages
  • When app inventory setup is incomplete, Storage Analyzer now skips package-owner forensics and sizes top-level media folders directly through the filesystem gateway
  • The degraded media category is marked read-only so users can inspect storage usage without deletion/filter/swiper actions that rely on trustworthy ownership classification
  • The app category still reports setup incomplete, preserving the safety behavior needed by cleanup tools such as CorpseFinder

Validation:

  • ./gradlew :app-tool-analyzer:compileDebugKotlin :app-tool-analyzer:testDebugUnitTest

Closes #2441

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.
@d4rken d4rken added bug Something isn't working as expected c: StorageAnalyzer api: 31 A12 (Snow Cone) labels May 24, 2026
d4rken added 3 commits May 25, 2026 20:44
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: 31 A12 (Snow Cone) bug Something isn't working as expected c: StorageAnalyzer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Software function abnormality

1 participant