Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@chunhtai
Copy link
Contributor

@chunhtai chunhtai commented Aug 17, 2022

fixes flutter/flutter#109521

There isn't an API to detect whether voice access and switch access is running. Android team also shift away the strategy from exposing the state of assistive technology. Their strategies are exposing API that targets specific use case. For example, most app need to know whether assistive technologies are running to decide modal fadeout durations. So Android team expose adhoc getRecommendedTimeoutMillis for this use case. Unfortunately we can't use these adhoc API due to the reason mentioned in flutter/flutter#109521 (comment). Therefore, I implement this pr to workaround the issue.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@chunhtai chunhtai requested a review from xster August 18, 2022 16:02
@chinmaygarde
Copy link
Member

cc @dnfield

// Use the setter to update this property if needed.
@VisibleForTesting public boolean hasAssistiveTechnology = false;

private void setHasAssistiveTechnology(boolean value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nitpick: Maybe call this updateHasAssistiveTechnology. Alternatively, require sendLatestAccessibilityFlagsToFlutter to take a boolean and have it set the flags. Then in tests you don't need the extra flag taken.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant to make this a setter of hasAssistiveTechnology. I am very lazy so I just search online, this is the common way people name it. WDYT?

sendLatestAccessibilityFlagsToFlutter sends the entire feature flags over, unless I create an API specific for ACCESSIBLE_NAVIGATION it feels weird to add an parameter to sendLatestAccessibilityFlagsToFlutter for ACCESSIBLE_NAVIGATION only.

@chunhtai chunhtai requested a review from dnfield August 19, 2022 15:54
Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[a11y] MediaQuery accessibleNavigation unable to detect Android Voice Access

3 participants