refactor(deploy): carve backup/restore out of DeployFragment into BackupController#43
Merged
Merged
Conversation
…kupController First god-class carve (strangler-fig) toward re-enabling the disabled Fragment lint detectors (see TECH_DEBT_PLAN.md). No behaviour change. - New backup/presentation/BackupController (non-Fragment) owns the backup selection state + SAF launchers + import-spinner, and wires the backup/restore/ import buttons + the backup menu. Moves ~596 LOC off the Fragment. - New backup/presentation/BackupHost: narrow seam the Fragment implements (isSystemBusy/getSystemBusyMessage/enable|disableSystemProtection/getTermuxArch/ updateDynamicButtons + setImporting/setRestoring/setBackupInProgress/ isBackupInProgress). mainAct is passed in for isServerAlive/runOnUiThread/ invalidateModuleStateTrust. - DeployFragment delegates via backupController.registerLaunchers()/bind(...); the 6 cross-feature methods are now public to satisfy the seam. - DeployFragment 3032 -> 2441 LOC. Lint detectors stay disabled (still bindInstall*/onRootfsSizeResolved/etc.); re-enable after the next carves. Verified: brace/paren balance, no dangling refs (fully contained), seam routed through host., no unprefixed Fragment calls. CI = compile+tests+lint.
…oup imports to BackupController Compile fix for the carve PR (#43): the moved backup-menu row code uses Color.TRANSPARENT and ViewGroup.LayoutParams with simple names; the new file needs the imports. No logic change.
This was referenced Jun 24, 2026
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.
First god-class carve (strangler-fig) toward re-enabling the disabled Fragment lint detectors (see
controller/docs/TECH_DEBT_PLAN.md). No behaviour change — code is relocated, not rewritten.What
backup/presentation/BackupController(non-Fragment): owns the backup selection state + SAF launchers + import spinner; wires the backup/restore/import buttons + the backup menu. ~596 LOC moved off the Fragment.backup/presentation/BackupHost: narrow seam the Fragment implements —isSystemBusy / getSystemBusyMessage / enable|disableSystemProtection / getTermuxArch / updateDynamicButtons+setImporting / setRestoring / setBackupInProgress / isBackupInProgress.mainActis passed in forisServerAlive / runOnUiThread / invalidateModuleStateTrust.backupController.registerLaunchers()/bind(...); the 6 cross-feature methods becamepublicto satisfy the seam. 3032 → 2441 LOC.Why
The disabled checks (
FragmentBackPressedCallback,FragmentLiveDataObserve,FragmentAddMenuProvider) hang because the detector's call-graph walk explodes on oversized Fragment methods. Moving cohesive logic to a non-Fragment class shrinks that graph. This is carve 1 of a few; the detectors stay disabled in this PR (bindInstall*,onRootfsSizeResolved, etc. remain) and get re-enabled onceDeployFragmentis lean.Verification
Brace/paren balanced; the extraction is fully contained (no external refs to the moved members); all seam calls routed through
host.; no unprefixed Fragment calls; lint detectors confirmed still disabled. CI does compile + unit tests + lint. Recommend an on-device backup → export → import → restore smoke test before merge (user-facing feature, moved blind without a local Android build).