Skip to content

ADFA-4957: deep-op protection layer — foundation + service (engine) - #308

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

ADFA-4957: deep-op protection layer — foundation + service (engine)#308
luisguzman-adfa merged 2 commits into
mainfrom
feat/ADFA-4957-deepop-core

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

First slice of the shared resilience layer for backup/restore/clone (they run on the Fragment
executor today with only EnvironmentLock + a mute WatchdogService). No behavior change yet — nothing
starts the service; adoption lands next.

  • DeepOpState + DeepOpProgressRepository: app-scoped observable progress (mirrors InstallState).
  • EnvironmentControl: Context-based pdsm stop/start + createFakeSysData, extracted from ServerController
    (now delegates) so a service can quiesce/boot the environment off any Activity.
  • DeepOpService: foreground service that owns backup/restore off the UI — hardware locks, swipe-proof
    notification (content intent + Cancel), EnvironmentLock (+ InstallGuard on restore), posts to the repo.

Service boot-handoff to ServerController wants a device pass when adoption wires it up.

… (engine)

First slice of the shared resilience layer. backup/restore/clone run their work on the Fragment
executor today with only EnvironmentLock + a mute WatchdogService; this brings the install-grade
mechanism (a service that owns the op + app-scoped progress + a swipe-proof notification) to them.

- DeepOpState + DeepOpProgressRepository: app-scoped observable single source of truth for a deep-env
  op's progress (mirrors InstallState/InstallProgressRepository), so the op screen re-binds after
  recreation/backgrounding and a notification tap can land on the live op.
- EnvironmentControl: Context-based pdsm stop/start + createFakeSysData, extracted from
  ServerController (which now delegates) so a service can quiesce/boot the environment off any Activity.
- DeepOpService: foreground service that OWNS backup/restore off the UI — hardware locks, swipe-proof
  progress notification (re-asserted via startForeground) with a content intent + Cancel, and brackets
  EnvironmentLock (+ InstallGuard for a destructive restore); publishes to DeepOpProgressRepository.

Adoption (migrate BackupJobFragment to start the service + observe the repo, return-to-op routing,
recovery) and clone land next. The service's boot-handoff to the activity's ServerController wants a
device pass. Foundation for ADFA-4957; no behavior change yet (nothing starts the service).
#1 Cancel: the notification Cancel now runs the full terminal cleanup (release EnvironmentLock,
post terminal) via a done-guard, instead of a bare teardown that stranded the environment stopped
and the lock held. Cancel is offered ONLY for backup (read-only); restore has no Cancel action
(destructive, hard gate). A clean restore clears InstallGuard; a FAILED restore leaves it set so
next-launch recovery repairs the torn rootfs.

#2 Boot handoff: the service no longer boots the environment. Mirroring InstallService (whose server
restart is owned by the install index), DeepOpService leaves it stopped and the hosting Activity boots
via serverController.startEnvironment() on return / next launch — so the service and ServerController
never both own the proot container. Removes sBootEngine and the now-unused EnvironmentControl.start().
@luisguzman-adfa
luisguzman-adfa merged commit 81b2983 into main Jul 31, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/ADFA-4957-deepop-core branch July 31, 2026 09:03
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