Repository navigation
fix(android): record the launched intent owner from the device - #3600
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 10 files
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 12 files (changes from recent commits).
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
|
The code in 19d113b looks good, and I found nothing that blocks it. All 19 checks pass at this head. The PR body places the live API 35 run in the head-19d113ba7 validation section but does not name the commit for the device run itself. I could not reproduce it. The live output shows Not blocking, and fine to take or leave: The open inline thread on lifecycle.test.ts:44-47 still stands: #3600 (comment). The mock returns the same report for the follow-up open, so the test at :485-500 would stay green if lifecycle.ts:177 read the wrong report. Please key the mock's report on The catch-path thread does not apply, so please resolve it: #3600 (comment). The catch fires only if |
An ADB open of an intent or alias target (open settings) now records the package the device resumed as the session appBundleId, so post-open observation, frame-perf reset, and helper leasing use it. A framework foreground (chooser, cross-profile forwarder) is never an owner. open --relaunch closes only a requested package; an intent target instead launches with am start -S so the handler the device resolves is force-stopped and restarted, never close(<target>). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A package target whose requested package did not resolve before launch now force-stops the resolved package before starting it, so open --relaunch never degrades to a plain foreground open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
am start -W names the activity the launch resumed. That component, not a later foreground read, is the owner, so a permission prompt over the launched app is never recorded. The foreground read remains only for a launch that names no activity. Deep-link and app-bound launches honor relaunch termination like intent and package launches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Key the lifecycle fixture's launch report on the opened target so the runtime-URL follow-up reports a different package. Drop the unreachable deep-link -S branch, since a bare URL relaunch is rejected before dispatch, and document Android intent ownership and relaunch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
19d113b to
d9a7268
Compare
|
Addressed the review of 19d113b at
Gate: |
|
|
This PR is ready at d9a7268. The earlier findings from 19d113b are fixed, and I found nothing new in the delta. Not blocking: the docs note at website/docs/docs/commands.md:93 says "Android (adb)", but Limrun Android is also adb-backed and opens through Of the open threads, the ones on #3600 (comment) (mock follow-up target), #3600 (comment) (focused-window owner), #3600 (comment) (report fallback catch), #3600 (comment) (relaunch with bare URL) and #3600 (comment) (launch-report test) no longer apply. The first and third are fixed at this head, and the other three are benign as written, so you can resolve them. No conflicts. Smoke Tests is queued, not failed, and the delta only touches an unreachable deep-link |
* origin/main: feat(leasing): proxy CLI names each new lease, daemon keeps a caller-chosen lease id (#3479) feat(remote): name the held lease on upload, artifact download and diagnostics requests (#3594) fix(android): record the launched intent owner from the device (#3600) fix(selectors): type rect-requiring targets as addressable (#3608) feat(snapshot): interpret iOS node facts once at producer seams (#3592) refactor(gates): own the client-only replay rule as daemon-process reachability (R82) (#3604)
* origin/main: feat(remote): name the held lease on upload, artifact download and diagnostics requests (#3594) fix(android): record the launched intent owner from the device (#3600) fix(selectors): type rect-requiring targets as addressable (#3608) feat(snapshot): interpret iOS node facts once at producer seams (#3592) refactor(gates): own the client-only replay rule as daemon-process reachability (R82) (#3604)
* origin/main: feat(remote): name the held lease on upload, artifact download and diagnostics requests (#3594) fix(android): record the launched intent owner from the device (#3600) fix(selectors): type rect-requiring targets as addressable (#3608) feat(snapshot): interpret iOS node facts once at producer seams (#3592) refactor(gates): own the client-only replay rule as daemon-process reachability (R82) (#3604)
#3600 routed package relaunch through the same stop helper as close, so the fence refusal now also guards relaunch before any launch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#3600 routed package relaunch through the same stop helper as close, so the fence refusal now also guards relaunch before any launch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#3600 routed package relaunch through the same stop helper as close, so the fence refusal now also guards relaunch before any launch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(android): refuse close when stop fences expire * fix(android): reject close probes that finish after deadline * refactor(android): bound close fences with Deadline Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs(close): state the Android ADB close fence timeout Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(android): refuse a package relaunch whose stop fence expires #3600 routed package relaunch through the same stop helper as close, so the fence refusal now also guards relaunch before any launch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(android): let killApp classify a survivor after the shared stop wait The stop wait now reports which fence expired instead of throwing. Close and relaunch turn that into android-app-close-timeout; killApp keeps its own android-kill-process-survived classification, as on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(android): move closeAndroidApp and stop-fence tests to their own file app-lifecycle-open.test.ts crossed the test-file size tripwire; the close and stop-fence cases move unchanged to app-lifecycle-close.test.ts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(android): keep both stop waits on the killApp path The stop wait returned at an expired foreground fence, so killApp skipped the process wait and sampled pidof once. Kill now runs both waits as on main and classifies a survivor itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
On ADB-backed Android (local adb and ADB providers),
open settingsand other intent targets leftappBundleIdundefined, and--relaunchclosed the raw target.am start -Wreports on itsActivity:line, then the foreground package when no activity is named. The frameworkandroidchooser/forwarder and a permission prompt over the app are never owners.--relaunchcloses only a requested package. Otherwise the launch stops the handler:-Sfor intents, force-stop then start for package and app-bound targets. Bare-URL relaunch stays rejected before dispatch. An unresolved app-bound package previously closed the raw target name.WebDriver/Appium opens only by package, so its owner is the requested package; Limrun is unchanged.
Supersedes #3555
Related to #3077
Validation
Head
d9a726882, rebased on mainba7730af0:pnpm check:affected --base origin/main --runpassed (464 files / 3,235 tests). The owner test fails if the lifecycle reads the follow-up open's report.Live at
19d113ba7(owner route unchanged since), API 35 emulator, built CLI:open settingsreportsappBundleId: com.android.settings;open settings --relaunchrestarts Settings (PID 981 → 3249).Risk:
am start -Srefuses an implicit intent matching several activities (rawam start -W -S -a MAIN -c HOME:can't stop).settingshas one handler here; OEM builds with several Settings handlers would fail a relaunch, where a plain open already shows the chooser.🤖 Generated with Claude Code