Skip to content
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

deprecate Android announcement events and add deprecation warning. #165195

Merged
merged 6 commits into from
Mar 20, 2025

Conversation

ash2moon
Copy link
Contributor

@ash2moon ash2moon commented Mar 14, 2025

Due to this Android deprecation Flutter needs to show deprecation warnings to developers when using announce on Android.

Unfortunately testing this log statement is impossible since robolectric currently does not support API >=36.
#165220 will add the test code in once robolectric supports 36.

Pre-launch Checklist

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

@ash2moon ash2moon requested a review from a team March 14, 2025 14:41
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added platform-android Android applications specifically framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine repository. See also e: labels. a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) labels Mar 14, 2025
Comment on lines 306 to 312
if (Build.VERSION.SDK_INT >= API_LEVELS.API_36) {
Log.w(
TAG,
"Using AnnounceSemanticsEvent for accessibility is deprecated on Android. "
+ "Migrate to using semantic properties for a more robust and accessible "
+ "user experience");
}
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 tried adding a test for this log, but the problem is that robolectric does not support API 36 yet so there's no way of testing this if statement.

Copy link
Contributor

Choose a reason for hiding this comment

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

File an issue and link that issue here. It is fine that we cant test something with roboletric that isn't supported.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just created it: robolectric/robolectric#10103
Adding it to my PR description now too.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please close that. We dont need to bother the robolectric team they know they need to add support for api 36. I meant file a bug against us to add the test once there is a version we can support.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah gotcha, sorry that makes much more sense! Just added that issue:
#165220

Copy link
Contributor

Choose a reason for hiding this comment

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

Also if there is android owned public documentation can you link to that?
Maybe https://developer.android.com/reference/android/view/View#announceForAccessibility(java.lang.CharSequence)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, added this.

@matanlurey
Copy link
Contributor

test-exempt: Not supported by platform infrastructure.

Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

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

approve % removal of flutter_min or re-add of @VisibleForTesting annotation.

Comment on lines 306 to 312
if (Build.VERSION.SDK_INT >= API_LEVELS.API_36) {
Log.w(
TAG,
"Using AnnounceSemanticsEvent for accessibility is deprecated on Android. "
+ "Migrate to using semantic properties for a more robust and accessible "
+ "user experience");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Also if there is android owned public documentation can you link to that?
Maybe https://developer.android.com/reference/android/view/View#announceForAccessibility(java.lang.CharSequence)

@ash2moon ash2moon added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 18, 2025
Copy link
Contributor

auto-submit bot commented Mar 18, 2025

autosubmit label was removed for flutter/flutter/165195, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@ash2moon ash2moon added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 19, 2025
Copy link
Contributor

auto-submit bot commented Mar 19, 2025

autosubmit label was removed for flutter/flutter/165195, because - The status or check suite Google testing has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 19, 2025
@ash2moon ash2moon added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 19, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Mar 19, 2025
Merged via the queue into flutter:master with commit ecbb115 Mar 20, 2025
173 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) engine flutter/engine repository. See also e: labels. framework flutter/packages/flutter repository. See also f: labels. platform-android Android applications specifically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants