Reset a11y bridge state on hot restart #6857
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes flutter/flutter#20388
Previous PRs fixed an issue where the native side wasn't flushing access down to Dart land. This PR makes sure that any internal state the engine has gotten from Dart gets flushed when a hot restart happens, to make sure we don't end up with stale a11y information across hot restarts (I ran into this while manually testing things for the progress indicator semantics work).
I also did a tiny bit of cleanup in the vicinity: moved some returns to newlines in Java, and removed an unused declaration in the C++ iOS header.
/cc @matthew-carroll - I'm touching FlutterNativeView.java here, I assume this will have some impact on your embedding refactor work but I hope it's minimal. We would definitely want to make sure that this call to reset doesn't get lost in that refactor though.