-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android: System Property Detection Detect State change #30863
Comments
I'd like to work on this issue. |
Thank you @grgr-dkrk! |
I'm sorry for replying late. I try to implement |
@grgr-dkrk , Good call out on the name! I think the name is I've also made a new issue to add some easier methods for some specific services that have both iOS and Android versions (SwitchAccess/SwitchControl, SelectToSpeak/SpeakScreen) here #31346. That might be a better issue to start on, as behind the scenes it will need to do much of the same work of querying the AccessibilityManager's service list, and using the AccessibilityStateChangeListener to detect when services become enabled/disabled, but will provide users with a simpler API. I think there is still value to the API outlined in this issue, but it is Android-specific, and would only really be necessary for the edge case of services that wouldn't be covered by #31346. Let me know what you think! |
I would consider getting the status with |
I think all three of these issues are definitely related as you said, but what the right API on the RN side is an open question. I created #31346 because this would allow for an API that works on both iOS and Android and covers the most common use cases. I think that would be a good starting point for this space, and once it's implemented we may discover that #30862 is not really necessary for most users. If you have a specific use case in mind where you need to implement #30862 (detecting a non-Google, 3rd party service on Android for example), I'm happy to review the implementation. But I want to make sure that we also solve the more common case as well, which #31346 handles. |
@blavalla I got it. Thanks! |
Requires API Proposal
This issue may require a new API, or a change to an existing API. An API proposal should be added and discussed before proceeding with implementation. The API proposal can be added in the comments of this issue or linked as a separate issue.
Description
Currently the AccessibilityInfo API can only detect "screenReaderChanged", and not other services. It would be nice to be able to detect other services such as Select to Speak, Switch Access, Voice Access, etc.
React Native version:
v0.63
Expected Behavior
The ability to detect a general change in the accessibility state of the system should be supported in the AccessibilityInfo API.
Android Details
The AccessibilityManager class has a general "accessibilityStateChange" listener, that is triggered when any accessibility service changes from active to inactive or vice-versa.
https://developer.android.com/reference/android/view/accessibility/AccessibilityManager#addAccessibilityStateChangeListener(android.view.accessibility.AccessibilityManager.AccessibilityStateChangeListener)
Note: The currently supported "screenReaderChanged" method maps to the TouchExplorationStateChangeListener.
The text was updated successfully, but these errors were encountered: