Skip to content

Commit 80230cc

Browse files
[CP-beta]Refine developer message for announcement use (flutter#167505)
This pull request is created by [automatic cherry pick workflow](https://github.com/flutter/flutter/blob/main/docs/releases/Flutter-Cherrypick-Process.md#automatically-creates-a-cherry-pick-request) Please fill in the form below, and a flutter domain expert will evaluate this cherry pick request. ### Issue Link: What is the link to the issue this cherry-pick is addressing? This was a follow-up to flutter#165195 and part of issue flutter#165510 ### Changelog Description: Explain this cherry pick in one line that is accessible to most Flutter developers. See [best practices](https://github.com/flutter/flutter/blob/main/docs/releases/Hotfix-Documentation-Best-Practices.md) for examples Developer warning message in `SemanticService.announce` is not clear when using internal flutter widgets. ### Impact Description: What is the impact (ex. visual jank on Samsung phones, app crash, cannot ship an iOS app)? Does it impact development (ex. flutter doctor crashes when Android Studio is installed), or the shipping production app (the app crashes on launch) Developers see non-actionable warning messages when Accessibility Services are on and developers are using widgets like TimePicker, DatePicker, ExpansionTile, and Form. ### Workaround: Is there a workaround for this issue? No workaround. ### Risk: What is the risk level of this cherry-pick? ### Test Coverage: Are you confident that your fix is well-tested by automated tests? ### Validation Steps: What are the steps to validate that this fix works? Run the example below: https://github.com/flutter/flutter/blob/5491c8c146441d3126aff91beaa3fb5df6d710d0/examples/api/lib/material/time_picker/show_time_picker.0.dart#L10 When opening the time picker, the corrected warning message should show.
1 parent d3abd00 commit 80230cc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,11 @@ public void announce(@NonNull String message) {
308308
TAG,
309309
"Using AnnounceSemanticsEvent for accessibility is deprecated on Android. "
310310
+ "Migrate to using semantic properties for a more robust and accessible "
311-
+ "user experience. See https://developer.android.com/reference/android/view/View#announceForAccessibility(java.lang.CharSequence)");
311+
+ "user experience.\n"
312+
+ "Flutter: If you are unsure why you are seeing this bug, it might be because "
313+
+ "you are using a widget that calls this method. See https://github.com/flutter/flutter/issues/165510 "
314+
+ "for more details.\n"
315+
+ "Android documentation: https://developer.android.com/reference/android/view/View#announceForAccessibility(java.lang.CharSequence)");
312316
}
313317
rootAccessibilityView.announceForAccessibility(message);
314318
}

0 commit comments

Comments
 (0)