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

Sets focus before sending a11y focus event in Android #27992

Merged
merged 1 commit into from
Aug 13, 2021

Conversation

chunhtai
Copy link
Contributor

In the original issue, the slider is not announce because android think it is not focused when it receive the focus event. This PR makes sure the a11ynodeinfo returns isAccessibilityFocus = true before sending out a11y event

Fixes flutter/flutter#79528

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.

Copy link

@blasten blasten left a comment

Choose a reason for hiding this comment

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

LGTM

TestSemanticsUpdate testSemanticsUpdate = root.toUpdate();
testSemanticsUpdate.sendUpdateToBridge(accessibilityBridge);

class Verifier {
Copy link

Choose a reason for hiding this comment

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

nit: is this class necessary? it could also use ArgumentCaptor to extract AccessibilityEvent

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 need to verify the focus is set at the exact moment the requestSendAccessibilityEvent is called

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so i need a callback to run when requestSendAccessibilityEvent is called

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See line 845

@chunhtai chunhtai added the waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land. label Aug 12, 2021
@fluttergithubbot fluttergithubbot merged commit 56cf819 into flutter:master Aug 13, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 13, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 13, 2021
zanderso added a commit that referenced this pull request Aug 14, 2021
zanderso added a commit that referenced this pull request Aug 14, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 14, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 14, 2021
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 14, 2021
chunhtai added a commit to chunhtai/engine that referenced this pull request Aug 16, 2021
@WillowWisp
Copy link

WillowWisp commented Nov 24, 2021

Hi, has this change been on stable channel already?
I'm still getting the bug #79528 . Thanks.

Edit: This doesn't work on beta channel either.

flutter doctor -v
[✓] Flutter (Channel beta, 2.8.0-3.2.pre, on macOS 11.6 20G165 darwin-x64, locale en)
    • Flutter version 2.8.0-3.2.pre at /Users/nguyenthang/Desktop/ThangDev/FlutterSDK/flutter_macos_2.8.0-3.2.pre-beta
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2901cd7208 (6 days ago), 2021-11-18 11:15:09 -0800
    • Engine revision bcc2b7f12c
    • Dart version 2.15.0 (build 2.15.0-268.18.beta)

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nguyenthang/Library/Android/sdk
    • Platform android-31, build-tools 31.0.0
    • ANDROID_HOME = /Users/nguyenthang/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)

[✓] VS Code (version 1.62.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • CPH2219 (mobile) • a2e11d62 • android-arm64  • Android 11 (API 30)
    • Chrome (web)     • chrome   • web-javascript • Google Chrome 96.0.4664.55

• No issues found!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes platform-android waiting for tree to go green This PR is approved and tested, but waiting for the tree to be green to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Accessibility] Talkback doesn't announce anything about Slider when focused
4 participants