E2E smoke hardening + Android lock/capture fixes #8

Merged
yuanyuanxiang merged 2 commits from review/e2e-android-fixes into main 2026-11-22 21:11:43 +00:00
2 Commits
Author SHA1 Message Date
yuanyuanxianganddeepseek-flash 340fb20518 Fix(android): correct lock/input state and recover screen capture
db148c4 asked KeyguardManager on every heartbeat; some TVs answer "locked"
while playing video, so hosts showed "Locked: HH:MM:SS" forever and the
foreground app never reached the server. Lock state is event-driven again:
SCREEN_OFF records the start, USER_PRESENT clears it, and on SCREEN_ON the
state clears when the device is TV-like or has no keyguard (devices without
a lock screen never send USER_PRESENT); a phone that reconnects while
locked is re-calibrated the same way. Keyguard is consulted only at those
event points, never per heartbeat.

Input strategy and TV heuristics are separate immutable values: isTV (D-pad
focus navigation vs touch injection) only looks at leanback, isTvLike (lock
and encoder heuristics) also accepts television/uiMode. They were once
merged and the TV lost remote control, then an assignment was dropped and
it silently defaulted to false; immutable lazy values make both impossible.
The resolved mode is logged as "input=dpad|touch tvLike=..." and mirrored
into the native ring when available.

Screen capture: on TVs the default encoder configuration is tried first.
After a sleep the existing VirtualDisplay stops composing while the
projection stays alive, so a 5s zero-frame stall rebuilds the encoder and
VirtualDisplay on the same projection (reusing the session's encoded size),
requests a fresh IDR and reports failure only after 13s; if the projection
is gone the native size is cleared so the next request re-authorizes. A
repeated onStartCommand no longer calls nativeInit again (the -1 answer
used to stopSelf and drop the host). Kotlin capture logs mirror into the
native ring and fall back to logcat.

Debug APK builds; device verification pending.

Co-Authored-By: deepseek-flash
2026-11-22 21:51:16 +01:00
yuanyuanxianganddeepseek-flash be19744898 Test: harden the E2E smoke script against hangs and hidden crashes
A crash inside the client-online wait was swallowed by Wait-Until's empty
catch, so a dead server or client surfaced only as "no host online after
60s" once the timeout expired. Record the failure reason and report it
right after the wait.

LVM_GETITEMCOUNT and LVM_GETITEMSTATE used SendMessage without a timeout.
A hung server UI thread - the exact regression this script exists to catch
- would block the script forever instead of failing. Send with
SendMessageTimeout (2s) and treat a timeout as a failure.

-Build ran after settings.ini had been temporarily rewritten for busy
MCP/Web ports, so a build failure left the file modified. Build before
touching settings and restore unconditionally in a catch block.

Verified by re-running the Search feature end to end.

Co-Authored-By: deepseek-flash
2026-11-22 21:51:10 +01:00