fix: don't mark app installed when Shizuku falls back to system installer#492
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThe pull request refines installation outcome handling by introducing an ChangesInstallation Outcome Tracking & Persistence
Backend Token & Request Semantics Documentation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
Replaces #488 (closed due to merge conflicts after #489 landed). Same root cause, fresh branch off latest main.
Bug
When the user has `InstallerType.SHIZUKU` selected but the Shizuku/Sui binder isn't actually ready (binder dead, Sui module disabled, permission revoked), `ShizukuInstallerWrapper` silently falls back to the standard Android installer and reports `InstallOutcome.DELEGATED_TO_SYSTEM`. `DefaultDownloadOrchestrator.runInstall` was discarding that return value and unconditionally moving the entry to `DownloadStage.Completed`. `DetailsViewModel`'s `Completed` handler then hard-coded `installOutcome = InstallOutcome.COMPLETED` when persisting the DB row. Result: the app was marked installed the moment the system install prompt appeared — even if the user immediately tapped Cancel.
Fix
After this lands, a Shizuku-fallback install that the user cancels at the system prompt leaves the row with `isPendingInstall = true` and a parked file. `PackageEventReceiver` flips it to `false` only when `PACKAGE_ADDED` actually fires; if the user never accepts, the 24h stale-pending sweep in `SyncInstalledAppsUseCase` cleans it up.
Test plan
Summary by CodeRabbit
Release Notes
New Features
Bug Fixes
Documentation