Files
SoulStream/handoff/rounds/ins-r48-walk-helper.txt
T
KeelrLeek 9f0601027c android: the handoff — the pending rounds, the pipeline, and what is unverified
Everything written this session that has not been through the device: rounds 43
to 48 (each patch adversarially verified, 43's transient-notice expectation
fixed), a partial round 49, the pipeline scripts, the Android Auto design and
the icon comparison mock. Also the two harness changes that were never A/B'd —
adaptive waits, which may only shorten a declared wait and never lengthen it,
and a ship that runs the mock walk and the deploy at the same time. The A/B and
its 255-step baseline are in handoff/tools; main stays at what the phone has
actually walked.
2026-09-14 07:57:41 -05:00

43 lines
2.5 KiB
Plaintext

/* ── the service, the focus stack and the noisy receiver ──────────────
* Three things `dumpsys` can say about the media session that no page and
* no notification can. ALL THREE ARE ADVISORY: they print on every run and
* fail nothing. None of these dump formats has ever been read back from
* this phone, and a format surprise must not turn into a false red on a
* walk that is otherwise green.
*
* What they are for is the morning after a change to how the service is
* made. `fgs` says whether the service exists at all and whether media3
* promoted it; `focus` whether the audio-focus request this plugin still
* makes BY HAND is in the system's stack, which is the direct regression
* guard for "another app takes the output and we pause"; `noisy` whether
* the becoming-noisy receiver is REGISTERED, which is the half of
* "headphones out pauses" that a creation-path change actually breaks.
*
* Neither of the last two proves the pause itself, and nothing here can:
* ACTION_AUDIO_BECOMING_NOISY is a protected broadcast, so `am broadcast`
* from the shell uid is refused outright, and the receiver is registered
* RECEIVER_NOT_EXPORTED besides. Those two are Kyle's hands. */
function mediaPlumbing() {
const out = { fgs: "", focus: "", noisy: "" };
try {
const svc = adb("shell", "dumpsys", "activity", "services", "com.soulstream.app").toString();
const at = svc.indexOf("com.soulstream.mediasession.MediaService");
out.fgs = at < 0 ? "absent" : (/isForeground=true/.test(svc.slice(at, at + 6000)) ? "foreground" : "created");
} catch (e) { out.fgs = "ERR " + e.message; }
try {
const audio = adb("shell", "dumpsys", "audio").toString();
out.focus = /pack: com\.soulstream\.app/.test(audio) ? "held" : "not in the stack";
} catch (e) { out.focus = "ERR " + e.message; }
try {
const bc = adb("shell", "dumpsys", "activity", "broadcasts").toString();
/* each registered receiver is one `ReceiverList{...}` block with its
package on the first line and its filters under it; the windows
keep a match from wandering into the next block */
const ours = bc.split("ReceiverList{").filter((b) =>
/com\.soulstream\.app/.test(b.slice(0, 400)) && /AUDIO_BECOMING_NOISY/.test(b.slice(0, 2000)));
out.noisy = ours.length ? "registered" : "not found";
} catch (e) { out.noisy = "ERR " + e.message; }
return out;
}