From 80230cc7c4954c4502761b7d5722e5480ea8f43e Mon Sep 17 00:00:00 2001 From: flutteractionsbot <154381524+flutteractionsbot@users.noreply.github.com> Date: Mon, 21 Apr 2025 16:32:08 -0700 Subject: [PATCH] [CP-beta]Refine developer message for announcement use (#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 https://github.com/flutter/flutter/pull/165195 and part of issue https://github.com/flutter/flutter/issues/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. --- .../android/io/flutter/view/AccessibilityBridge.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java index a6cc440ed5..3ae1d86999 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -308,7 +308,11 @@ public class AccessibilityBridge extends AccessibilityNodeProvider { TAG, "Using AnnounceSemanticsEvent for accessibility is deprecated on Android. " + "Migrate to using semantic properties for a more robust and accessible " - + "user experience. See https://developer.android.com/reference/android/view/View#announceForAccessibility(java.lang.CharSequence)"); + + "user experience.\n" + + "Flutter: If you are unsure why you are seeing this bug, it might be because " + + "you are using a widget that calls this method. See https://github.com/flutter/flutter/issues/165510 " + + "for more details.\n" + + "Android documentation: https://developer.android.com/reference/android/view/View#announceForAccessibility(java.lang.CharSequence)"); } rootAccessibilityView.announceForAccessibility(message); }