Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

feat: Add getEnabledAccessibilityServices to AccessibilityInfo (Android) - #57864

Open
ecryptoguru wants to merge 2 commits into
react:mainfrom
ecryptoguru:feat/accessibility-enabled-services
Open

ecryptoguru wants to merge 2 commits into
react:mainfrom
ecryptoguru:feat/accessibility-enabled-services

Conversation

@ecryptoguru

@ecryptoguru ecryptoguru commented Aug 8, 2026 •

Copy link
Copy Markdown

Summary:

An Android app can ask whether a screen reader is running, but that doesn’t tell it which accessibility services are enabled. This PR adds AccessibilityInfo.getEnabledAccessibilityServices(feedbackTypeFlags?). It returns the service IDs reported by Android’s AccessibilityManager. Omitting the argument requests all feedback types; passing a mask filters the list.

On iOS the promise resolves to []. On Android it rejects if the native method is unavailable. The change includes the Flow and TypeScript declarations, the generated API snapshot, and the Jest mock.

Closes #30862. PR #59234 also addresses this issue; this version includes the optional feedback mask.

Changelog:

[ANDROID] [ADDED] - Apps can call AccessibilityInfo.getEnabledAccessibilityServices() to list enabled Android accessibility service IDs, optionally filtered by feedback type.

Test Plan:

  • Ran the AccessibilityInfo-test.js Jest suite on b33ed0ec: 42 tests passed. The four new cases cover the Android service IDs, passing a feedback mask to native, rejection when the native method is missing, and the empty array on iOS.
  • yarn build-types --validate, yarn test-typescript-legacy, and yarn test-generated-typescript passed. ESLint passed on all four changed JavaScript files.
  • Built an ARM64 release of RNTester from b33ed0ec and ran it on Android 17 (API 37) with TalkBack 17.0. With TalkBack enabled, both the no-argument call and FEEDBACK_SPOKEN returned its service ID. After disabling TalkBack and relaunching, both returned []. Fixture and device logs.

Implementation prepared with Devin. Codex assisted with verification and the PR description.

Add a new `AccessibilityInfo.getEnabledAccessibilityServices()` method
that returns the list of currently enabled accessibility service IDs
on Android, using `AccessibilityManager.getEnabledAccessibilityServiceList()`.

This addresses the need to query which accessibility services a user
has enabled, allowing apps to tailor their UI accordingly (e.g.,
disabling video autoplay when a screen reader service is active).

Changes:
- Add `getEnabledAccessibilityServices(feedbackTypeFlags?)` to the
  JS AccessibilityInfo API (returns Promise<Array<string>>)
- Implement native Android module method in AccessibilityInfoModule.kt
- Add optional method to NativeAccessibilityInfo Flow spec
- Update TypeScript definitions (.d.ts) and generated ReactNativeApi.d.ts
- Update Jest mock and add comprehensive unit tests
- Add typetest coverage

Closes react#30862

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@meta-cla

meta-cla Bot commented Aug 8, 2026

Copy link
Copy Markdown

Hi @ecryptoguru!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

Warning

JavaScript API change detected

This PR commits an update to ReactNativeApi.d.ts, indicating a change to React Native's public JavaScript API.

  • Please include a clear changelog message.
  • This change will be subject to additional review.

This change was flagged as: POTENTIALLY_BREAKING

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 8, 2026
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Aug 8, 2026

This branch has not been deployed

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

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android: Enabled services

1 participant