Skip to content

ADFA-4957: backup/restore adopt DeepOpService + close boot handoff - #309

Merged
luisguzman-adfa merged 3 commits into
mainfrom
feat/ADFA-4957-deepop-adopt
Jul 31, 2026
Merged

ADFA-4957: backup/restore adopt DeepOpService + close boot handoff#309
luisguzman-adfa merged 3 commits into
mainfrom
feat/ADFA-4957-deepop-adopt

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

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 [android] stick to yarn on proot by default #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.

… 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.
@luisguzman-adfa
luisguzman-adfa merged commit b71fbb5 into main Jul 31, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/ADFA-4957-deepop-adopt branch July 31, 2026 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant