ADFA-4957: backup/restore adopt DeepOpService + close boot handoff - #309
Merged
Conversation
… boot handoff Backup/restore no longer run on the Fragment executor — the foreground DeepOpService owns the kill-sensitive work and BackupJobFragment just starts it and OBSERVES DeepOpProgressRepository, so the status line, hard gate and Done re-bind after a recreation or backgrounding. - BackupJobFragment: backup -> DeepOpService.startBackup; restore -> copy+validate+destructive confirm HERE (pre-extract, safe to lose) -> DeepOpService.startRestore. UI is driven by the repo (seq-gated terminals); the fragment no longer stops/starts the server or holds the lock itself. - Boot handoff (review #2): the service leaves the server stopped. ServerController.handleServerLaunchClick now refuses while EnvironmentLock.isHeld (no boot mid-op, e.g. Home auto-start during a backup), and LibraryActivity boots once when it observes the deep-op terminal (lock already released). A failed restore keeps InstallGuard set, so the existing recovery repairs the rootfs instead. Note: the notification content intent lands on Home (auto-start boots there); deep-linking the tap back to the exact op screen is a minor follow-up. Wants a device pass.
…tore screen Mirrors module install: the DeepOpService notification opens LibraryActivity, which inspects the app-scoped repo and, if a deep-env op is running, routes straight to the op screen instead of Home (which fights the gate and would try to boot the server mid-op) — exactly like ModuleQueueRepository -> SetupProgressActivity for module installs. - SetupLibraryActivity: EXTRA_BR_JOB_MODE opens BackupJobFragment(mode) directly (deep-link). - LibraryActivity.onCreate: DeepOpProgressRepository.isRunning() -> open the backup/restore op screen with the running owner's mode; BackupJobFragment re-binds to the live op from the repo. So: swipe the app away, tap the notification (or relaunch) -> you land back on the running backup/ restore with its status + gate, not on a Home that ignores the deep operation.
isHeld includes isBusyNow() (ZIM/Books content downloads), which run on the LIVE server and hold no owner marker. Guarding the server toggle on isHeld would refuse 'Turn off K2Go' mid-download and hang turnOffK2Go until the 120s safety. Use ownerHeld — true only for a backup/restore/clone/install that actually OWNS the environment (stopped the server) — so downloads don't block the toggle. Same predicate applied to LibraryActivity's post-terminal boot check for consistency.
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.
Backup/restore no longer run on the Fragment executor — the foreground DeepOpService owns the kill-sensitive work and BackupJobFragment just starts it and OBSERVES DeepOpProgressRepository, so the status line, hard gate and Done re-bind after a recreation or backgrounding.
Note: the notification content intent lands on Home (auto-start boots there); deep-linking the tap back to the exact op screen is a minor follow-up. Wants a device pass.