Skip to content

accessibility.rs: pending Java exceptions are not cleared #40

Closed

Description

@Bombatomica64

Priority: P2 (robustness). Code audit of gpui-mobile src/android/accessibility.rs (fork main 4dd00ad, upstream PR longbridge/gpui-mobile#25).

It calls Java through accesskit_android's jni 0.21 API (call_method for isEnabled, getContext, getSystemService, getWindow, getDecorView, findViewById; new_string; new_global_ref). On a Java exception these return Err and leave the exception pending; nothing clears it, so the next JNI call on the render thread (shared with the jni 0.22 code, which clears through or_clear) runs with an exception pending, which is undefined behaviour and aborts under CheckJNI.

Delegate set off the UI thread: checked, InjectingAdapter::new already posts setAccessibilityDelegate to the UI thread; only the read-only lookups run on the render thread.

Activity

  1. changed the title [-]accessibility.rs: pending Java exceptions not cleared; delegate set off the UI thread[/-] [+]accessibility.rs: pending Java exceptions are not cleared[/+] on Oct 9, 2026
  2. Bombatomica64 commented on Oct 9, 2026

    @Bombatomica64
    OwnerAuthor

    Fixed in gpui-mobile android-a11y-clear-exceptions (#43): pending exceptions are described and cleared after the host-view lookups, isEnabled and each tree update. Code fix only; no throwing case was reproduced on the device. TalkBack still works on the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessibilityBarrier affecting people with disabilities

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions