Repository navigation
fix(android): let open --relaunch accept a package Android restarts at once - #4498
Conversation
…t once On Android 17 a provider or broadcast client restarts Settings right after am force-stop, so the relaunch close fence saw a new process and refused with android-app-close-timeout (phase process). A relaunch needs only the processes that ran before the stop to exit; the launch that follows reuses the new one. close keeps refusing a restarted process. Fixes #4482 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
1 issue found across 6 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="packages/platform-android/src/app-lifecycle.ts">
<violation number="1" location="packages/platform-android/src/app-lifecycle.ts:663">
P2: `expired === 'process'` does not prove Android restarted the package. `waitForAndroidPackageProcessGone` also returns false when its final probe or stability wait reaches the deadline, but this branch treats that unconfirmed timeout as a successful relaunch. Return a distinct “replacement observed” result and accept only that result; keep unconfirmed deadline expirations as failures.
(Based on your team's feedback about Android close-fence deadlines.)</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Apex SentinelVerdict: Since the last review: 0 new · 0 still open · 0 no longer raised No findings. 2 findings below Reviewed with this repository's own Sentinel configuration ( Feedback goes in the review comment threads, as a reply under the inline comment of a finding: Reply Useful? Reply Comment Earlier reviewsReview of
|
…ts expiry Address review: a process-fence expiry can be a slow probe, not a proven restart. A relaunch needs only the foreground and exit fences, so the in-open stop no longer runs the process fence, and the owner close accepts a refusal from that fence alone. The close description no longer carries CLI syntax, which MCP tool descriptions reject. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
This PR is ready at 14c4902. I found no problems in the code, and all 22 checks are green with none failing. There are no conflicts, and nothing else blocks the merge. The review thread about process-phase expiry (#4498) no longer applies at this head: the in-open route skips the process fence (app-lifecycle.ts:731), and the owner-close route accepts a refusal only after the exit fence has passed (app-lifecycle.ts:627), so you can resolve it. Not blocking, and you can take or leave these: the live run in the PR body used |
Address review: the in-open stops skipped the process fence through a purpose parameter while the owner close caught its refusal. Both routes now catch a refusal from the process fence alone through passedAndroidRelaunchStopFences. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks. Both notes were right. Live evidence for the catch path, at In-open route. One rule. Done. The |
|
I found no problems in 753e5a2. It keeps the earlier clean review at 14c4902 (#4498 (comment)), and the process expiry no longer asserts a restart. The process fence is reached only after the foreground and exit fences pass, so The review thread on that process expiry is fixed at this head, so the author can resolve it: #4498 (comment) CI is green, with 22 checks and none failing. There are no conflicts. I did not run the unit tests or a device. Nothing else must happen before merge. |
…baseline * origin/main: ci: use smaller runners for control and publishing jobs (#4492) docs(help): point verification at read-only commands, not bare find (#4497) fix(android): let open --relaunch accept a package Android restarts at once (#4498) fix(snapshot): name the captured Android app in the snapshot header (#4499) feat(proxy): configure trusted public upload origins (#4501) fix(android): restore screenshot demo permission state (#4477) feat(harmonyos): support app uninstall beside deploy (#4292) fix(ios): confirm foldable rotation from the lit panel in either simulator set (#4343) (#4440) chore: mark 0.21.37 as released fix(ios): make back the verified left-edge swipe (#4460) fix(ios): mark zero-area nodes unmeasured and point their press refusal at scroll --until (#4495) fix(ios): never repeat a synthesized gesture that may have run (#4474) fix(capture): publish cropped screenshots atomically after scaling (#4478) ci(android): reuse cached system images across emulator workflows (#4490)
Summary
open --relaunch com.android.settingsfailed withandroid-app-close-timeout(phaseprocess) on Android 17. A system client of the Settings slice provider restarts Settings right afteram force-stop, so the close fence saw a new pid. A relaunch needs only the foreground and exit fences: the process fence runs after them, so once they pass, every process that ran before the stop is gone, and the launch reuses the new one. Both relaunch routes — the session-owner close and the in-open stop — accept a refusal from the process fence alone, through one predicate (passedAndroidRelaunchStopFences). Plainclosestill refuses a restarted process.help closeandcommands.mdsay so.6 files touched. Fixes #4482.
Validation
753e5a2bd7, base9676eedac5.closedescription, which MCP shares.purposeparameter.process remained running after closeand pass at head:lifecycle.test.ts(owner-close relaunch) andapp-lifecycle-close.test.ts(in-open relaunch). The existingexit/foregroundrefusals still pass.pnpm exec vitest run --project unit-core packages/platform-android/src packages/command-surface/src/__tests__/command-surface-metadata.test.ts: 137 files, 1413 tests passed.pnpm check:quick: pass.content://android.settings.slices, standing in for the system client. Each run reads the Settingsam_kill/am_proc_startevents from logcat.open com.android.settings --relaunch --foreground(session-owner close)9676eedac5android-app-close-timeout, phaseprocessam_kill; those took 3.1–3.4 s (the 2 s process fence expired and its refusal was accepted). The other 2 had no restart and took 1.7–1.9 s.Without the stand-in clients, base succeeds on this emulator: the restart depends on timing.
open settings --relaunchresolves to an intent and relaunches througham start, so it never reaches the in-open stop. For package targets, open resolution supplies an app id, so relaunches take the owner route. The in-open stop has only its unit test.🤖 Generated with Claude Code