[GH-ISSUE #2996] [Bug] inspect_adb_window reports no focus on Android 16 because focus lines moved out of dumpsys window windows #1048

Closed
opened 2026-10-15 18:30:39 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @cyberpunk47 on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/2996

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Process capture or runtime observation

Observed behavior

On Android 16 (SDK 36), inspect-adb-window returns focused_window: null, focused_app: null and observed_lines: [] while an app is clearly on screen. The only limitation says the values are the window manager's declarations, so the agent reads this as "nothing is focused".

REA reads only dumpsys window windows. On Android 16 that section no longer prints mCurrentFocus / mFocusedApp; they are printed by dumpsys window displays (and plain dumpsys window).

AGENTS.md: "Unresolved identity or applicability must remain unknown rather than be treated as absent, foreign, or aligned."

Reproduction

Run these commands on any Android 16 Device or Stock Emulator
rea inspect-adb-window --serial emulator-5554 --format json
adb -s emulator-5554 shell "dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'" # no lines
adb -s emulator-5554 shell "dumpsys window displays | grep -E 'mCurrentFocus|mFocusedApp'" # both lines

Expected behavior

Report the focus the device declares. When dumpsys window windows declares neither line, read dumpsys window displays. If neither section declares focus, say focus is unknown rather than returning bare nulls.

Impact and scope

Affects: inspect_adb_window (CLI and MCP) on Android 16 builds.
Agents get a wrong "no focus" answer, for example when checking which app is in front before reading logs.
Not affected: older builds where windows still prints the lines; other ADB tools. I compared inspect-adb-device, inspect-adb-display and list-adb-packages against raw adb on the same devices, and they matched.

REA version

6.4.0 (main @ 45a3509db)

Runtime and platform

Node.js 22, host Windows 11 and Linux x64; adb 36

Target and artifact context

Android emulator, SDK 36, build BE2A.250530.026.D1 (stock Google image) Physical device on LineageOS 23 (SDK 36) Same result on both.

Interface

CLI

Earliest failure stage

Capture or observation

Relevant output or evidence

{ "focused_window": null, "focused_app": null, "observed_lines": [] }
and 
adb shell "dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'": no output.

adb shell "dumpsys window displays | grep -E 'mCurrentFocus|mFocusedApp'":

mCurrentFocus=Window{62b7d6c u0 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity}
mFocusedApp=ActivityRecord{29617218 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t2}

Typed outcome or recovery expected

No response

Analysis or suspected cause

src/adb/AdbProvider.ts, case inspect_adb_window, runs only dumpsys window windows and passes it to parseWindowFocusOutput (src/adb/AdbShellOutput.ts). When the section has no focus lines, both values stay null and no limitation says why.

The test stub shellStub in src/adb/AdbProvider.test.ts matches only the first two shell words (dumpsys window), so the existing test cannot tell windows from displays.

Additional context

No response

Originally created by @cyberpunk47 on GitHub (Oct 13, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/2996 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Process capture or runtime observation ### Observed behavior On Android 16 (SDK 36), inspect-adb-window returns focused_window: null, focused_app: null and observed_lines: [] while an app is clearly on screen. The only limitation says the values are the window manager's declarations, so the agent reads this as "nothing is focused". REA reads only dumpsys window windows. On Android 16 that section no longer prints mCurrentFocus / mFocusedApp; they are printed by dumpsys window displays (and plain dumpsys window). AGENTS.md: "Unresolved identity or applicability must remain unknown rather than be treated as absent, foreign, or aligned." ### Reproduction Run these commands on any Android 16 Device or Stock Emulator `rea inspect-adb-window --serial emulator-5554 --format json ` `adb -s emulator-5554 shell "dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'" # no lines ` `adb -s emulator-5554 shell "dumpsys window displays | grep -E 'mCurrentFocus|mFocusedApp'" # both lines` ### Expected behavior Report the focus the device declares. When dumpsys window windows declares neither line, read dumpsys window displays. If neither section declares focus, say focus is unknown rather than returning bare nulls. ### Impact and scope Affects: inspect_adb_window (CLI and MCP) on Android 16 builds. Agents get a wrong "no focus" answer, for example when checking which app is in front before reading logs. Not affected: older builds where windows still prints the lines; other ADB tools. I compared inspect-adb-device, inspect-adb-display and list-adb-packages against raw adb on the same devices, and they matched. ### REA version 6.4.0 (main @ 45a3509db) ### Runtime and platform Node.js 22, host Windows 11 and Linux x64; adb 36 ### Target and artifact context Android emulator, SDK 36, build BE2A.250530.026.D1 (stock Google image) Physical device on LineageOS 23 (SDK 36) Same result on both. ### Interface CLI ### Earliest failure stage Capture or observation ### Relevant output or evidence ```text { "focused_window": null, "focused_app": null, "observed_lines": [] } and adb shell "dumpsys window windows | grep -E 'mCurrentFocus|mFocusedApp'": no output. adb shell "dumpsys window displays | grep -E 'mCurrentFocus|mFocusedApp'": mCurrentFocus=Window{62b7d6c u0 com.google.android.apps.nexuslauncher/com.google.android.apps.nexuslauncher.NexusLauncherActivity} mFocusedApp=ActivityRecord{29617218 u0 com.google.android.apps.nexuslauncher/.NexusLauncherActivity t2} ``` ### Typed outcome or recovery expected _No response_ ### Analysis or suspected cause src/adb/AdbProvider.ts, case inspect_adb_window, runs only dumpsys window windows and passes it to parseWindowFocusOutput (src/adb/AdbShellOutput.ts). When the section has no focus lines, both values stay null and no limitation says why. The test stub shellStub in src/adb/AdbProvider.test.ts matches only the first two shell words (dumpsys window), so the existing test cannot tell windows from displays. ### Additional context _No response_
bsakaguchi 2026-10-15 18:30:39 +00:00
Author
Owner

@morluto commented on GitHub (Oct 14, 2026):

Addressed on main in d4bd65c53.

Android 16 dumpsys focus parsing falls back to displays only when neither focus declaration is in windows; closes reported missing-focus parsing defect.

Validation: AdbProvider suite 58/58; global check, docs:check, Python and package verification pass.

Verification scope: No Android 16 device run.

<!-- gh-comment-id:6158636387 --> @morluto commented on GitHub (Oct 14, 2026): Addressed on main in [d4bd65c53](https://github.com/morluto/rea/commit/d4bd65c53). Android 16 dumpsys focus parsing falls back to displays only when neither focus declaration is in windows; closes reported missing-focus parsing defect. Validation: AdbProvider suite 58/58; global check, docs:check, Python and package verification pass. Verification scope: No Android 16 device run.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#1048
No description provided.