Skip to content

Fix Android build: accessibility bridge API mismatch - #137

Merged
danielraffel merged 2 commits into
mainfrom
fix/android-accessibility-build
Apr 12, 2026
Merged

Fix Android build: accessibility bridge API mismatch#137
danielraffel merged 2 commits into
mainfrom
fix/android-accessibility-build

Conversation

@danielraffel

Copy link
Copy Markdown
Collaborator

Summary

  • PR Ship feature/android-talkback-87 #127 landed core/view/platform/android/accessibility_android.cpp with two API mismatches that have broken android-build on every subsequent PR.
  • Fixes the two compile errors without touching behaviour on other platforms (file is inside #ifdef __ANDROID__).

Changes:

  1. root.children()root.child_count() + root.child_at(i) loop (matches iOS VoiceOver bridge at core/view/platform/ios/accessibility_ios.mm:105-107).
  2. target->simulate_click()target->simulate_click(Point{cx, cy}) where cx,cy is the view's centre in root coordinates (walks parent chain, same approach as accessibility_ios.mm:66-74).

Test plan

PR #127 landed accessibility_android.cpp with two API mismatches that
broke the android-build CI check:

1. View::children() doesn't exist; use child_count() + child_at(i) to
   iterate children, matching the iOS VoiceOver bridge pattern.
2. View::simulate_click() requires a Point in root coordinates. Walk the
   parent chain to convert the view's local centre into root coords,
   same technique accessibility_ios.mm uses for accessibilityFrame.

No behaviour change on other platforms (file is guarded by __ANDROID__).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8640d22896

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

cx += p->bounds().x;
cy += p->bounds().y;
}
target->simulate_click(pulp::view::Point{cx, cy});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Dispatch ACTION_CLICK from root instead of target

simulate_click expects coordinates relative to the view it is called on (it immediately does hit_test(root_pos) from that receiver in core/view/src/view.cpp), but this change computes cx/cy in root coordinates and then calls target->simulate_click(...). For any accessible node that is not at (0,0) in its own local space, the hit test misses and TalkBack click actions become no-ops. This breaks accessibility activation for nested controls on Android; call simulate_click on g_root_view (or convert to target-local coordinates) to preserve behavior.

Useful? React with 👍 / 👎.

simulate_click(root_pos) runs hit_test from 'this'; calling it on
'target' (which isn't at origin) causes the hit test to miss and the
TalkBack ACTION_CLICK to silently no-op for nested controls. Compute
the target's centre in root coordinates and dispatch via g_root_view
instead, preserving root-space hit-testing.
@danielraffel
danielraffel merged commit 53619ff into main Apr 12, 2026
12 checks passed
@danielraffel
danielraffel deleted the fix/android-accessibility-build branch April 12, 2026 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant