Skip to content

feat: Add getInstalledAccessibilityServices and getEnabledAccessibilityServices APIs#56264

Open
taibin wants to merge 4 commits intofacebook:mainfrom
taibin:feat/accessibility-services-api
Open

feat: Add getInstalledAccessibilityServices and getEnabledAccessibilityServices APIs#56264
taibin wants to merge 4 commits intofacebook:mainfrom
taibin:feat/accessibility-services-api

Conversation

@taibin
Copy link
Copy Markdown

@taibin taibin commented Mar 28, 2026

Summary

Add new AccessibilityInfo APIs to query installed and enabled accessibility services on Android.

  • getInstalledAccessibilityServices(): Returns list of all installed accessibility services
  • getEnabledAccessibilityServices(): Returns list of currently enabled accessibility services

Each service object contains:

  • id: The unique identifier of the accessibility service
  • name: The human-readable name of the service

Use Case

This allows developers to tailor their app's UI based on specific accessibility services the user has installed or enabled. For example:

  • If TalkBack is enabled, developers might want to disable auto-playing videos to avoid interrupting screen reader announcements
  • Apps can provide enhanced accessibility features based on the specific services detected

Changes

  • AccessibilityInfoModule.kt: Added getInstalledAccessibilityServices() and getEnabledAccessibilityServices() native methods using Android's AccessibilityManager
  • NativeAccessibilityInfo.js: Updated TurboModule spec with new method signatures
  • AccessibilityInfo.js: Added JS API with proper platform handling (returns empty array on iOS)
  • AccessibilityInfo.d.ts: Added TypeScript type definitions

API Usage

// Get installed accessibility services
const installedServices = await AccessibilityInfo.getInstalledAccessibilityServices();
// [{id: "com.google.android.marvin.talkback", name: "TalkBack"}, ...]

// Get enabled accessibility services  
const enabledServices = await AccessibilityInfo.getEnabledAccessibilityServices();
// [{id: "com.google.android.marvin.talkback", name: "TalkBack"}]

Test Plan

  • Flow type check passes
  • Android Kotlin compilation passes
  • Existing AccessibilityInfo tests pass

Changelog

[ANDROID] [ADDED] - Added getInstalledAccessibilityServices and getEnabledAccessibilityServices APIs to AccessibilityInfo

Closes #30864
Closes #30862

🤖 Generated with Claude Code

Typin and others added 4 commits March 22, 2026 16:33
The resolve() method in BorderColors had incorrect fallback priority order.
Physical edge colors (BOTTOM, TOP, LEFT, RIGHT) should have higher priority
than logical block colors (BLOCK_START, BLOCK_END, BLOCK) and shorthand colors.
This ensures setting borderBottomColor properly overrides borderBlockColor.

Fixes facebook#38335
…apping

The registerNatives() function incorrectly mapped the JNI 'disable' method
to HermesSamplingProfiler::enable instead of HermesSamplingProfiler::disable,
which corrupted the sampling profiler state when calling
HermesSamplingProfiler.disable() from Java.

Fixes facebook#56126
[Android] [Fixed] - Fix HermesSamplingProfiler JNI 'disable' method mapping
…tyServices APIs

Add new AccessibilityInfo APIs to query installed and enabled accessibility services on Android.

- `getInstalledAccessibilityServices()`: Returns list of all installed accessibility services
- `getEnabledAccessibilityServices()`: Returns list of currently enabled accessibility services

Each service object contains:
- `id`: The unique identifier of the accessibility service
- `name`: The human-readable name of the service

This allows developers to tailor their app's UI based on specific accessibility services
the user has installed or enabled.

Closes facebook#30864
Closes facebook#30862

[ANDROID] [ADDED] - Added getInstalledAccessibilityServices and getEnabledAccessibilityServices APIs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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 Mar 28, 2026
@github-actions
Copy link
Copy Markdown

Caution

Missing Changelog

Please add a Changelog to your PR description. See Changelog format

@github-actions
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

@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 Mar 28, 2026
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: Installed services Android: Enabled services

1 participant