ADFA-4957: deep-op protection layer — foundation + service (engine) - #308
Merged
Conversation
… (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().
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 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.
(now delegates) so a service can quiesce/boot the environment off any Activity.
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.