Skip to content

[Android][Accessibility] Guard fontWeightAdjustment access in AccessibilityBridge - #184287

Closed
lukemmtt wants to merge 1 commit into
flutter:mainfrom
lukemmtt:codex/font-weight-adjustment-guard
Closed

lukemmtt wants to merge 1 commit into
flutter:mainfrom
lukemmtt:codex/font-weight-adjustment-guard

Conversation

@lukemmtt

Copy link
Copy Markdown
Contributor

Summary

  • move the API 31 fontWeightAdjustment field access behind a dedicated helper in engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java
  • mark that helper as @DoNotInline so the field access stays out of the main code path
  • fall back to "bold text unsupported" if an affected runtime still throws NoSuchFieldError

Context

This follows up on #184286.

AndroidX Compose hardened the same access pattern in July 2024, and this mirrors that shape while keeping the engine change to a single file.

I do not have a public repro project yet, so I am opening this as a draft to get feedback on the patch shape before I spend more time on a standalone reproducer.

Move the API 31 fontWeightAdjustment field access behind a dedicated helper so the direct field reference stays out of AccessibilityBridge's main code path.

Also fall back to bold-text unsupported if an affected runtime still throws NoSuchFieldError during startup.

See flutter#184286.
@github-actions github-actions Bot added platform-android Android applications specifically engine flutter/engine related. See also e: labels. team-android Owned by Android platform team labels Mar 28, 2026
@lukemmtt lukemmtt closed this Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

engine flutter/engine related. See also e: labels. platform-android Android applications specifically team-android Owned by Android platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant