AccessibilityBridge installs various listeners for Android events
that invoke Flutter engine APIs. These listeners are removed in
AccessibilityBridge.release. However, in some environments there may
be deferred calls to the listener that will still execute even after
the listener has been removed. This change sets a flag during release
and ignores any listener invocations that happen after the flag is set.
See https://github.com/flutter/flutter/issues/63555 and
https://github.com/flutter/engine/pull/17311
This shouldn't result in any logical changes. I've done a quick smoke
test by building a local Android engine and running Flutter gallery, no
compile errors or other obvious issues.
Applied by running `/ci/format.sh | patch -p0` with the altered script
added in flutter/engine#16500. I did locally modify the script slightly
further so it would run against all Java files in the repo instead of
just modified ones.
This keeps us from setting the text on a node if it is a SCOPES_ROUTE node, and sends the "TYPE_VIEW_FOCUSED" event when we update the semantics information and a view has the input focus.
This adds an isFocusable to SemanticsFlag so that the framework can tell the engine what semantics nodes are allowed to be focused, which will affect what platform flags are applied to the semantics information.
This flag is not yet in use by the frame
This change modifies the accessibility bridge so that if a node has input focus, then it will tell TalkBack so that it will request the accessibility focus for the view.
It also sets the content change types bit field to include CONTENT_CHANGE_TYPE_SUBTREE to indicate that the subtree for the view has changed for API levels after, and including, KitKat (19)
Prevents NPEs and simplifies the code needed to handle these collections. There doesn't seem to have been a meaningful difference between null and empty collection here. The specific crash was happening when `object.scrollChildren > 0` while `object.childrenInHitTestOrder == null`, which looks like it may be a bug on its own and probably needs further investigation.
Delegate a11y events and action to/from embedded Android platfrom views.
This handles delegation of:
* AccessibilityNodeProvider#performAction
* ViewGroup#requestSendAccessibilityEvent
* View#onHoverEvent
Additionally updates the currently input accessibility focused node state that is
tracked by the a11y bridge when an embedded view's node is focused.
This PR mirrors virtual a11y tree of embedded platform views in the Flutter
a11y tree.
Non virtual hierarchies are not currently supported.
Only works on Android versions earlier than Android P as it relies on
reflection access to hidden system APIs which cannot be done starting
Android P.
A11y is not yet working as we also need to delegate a11y events from the
platform view to the FlutterView. This will be done in a following PR to
keep the change size a little saner.
PlatformViewsDelegate.
Since onDetachedFromWindow can be called after the activity was
destroyed, the previous call to detach the accessibility bridge could
have crash as the NativeFlutterView was already null.
From build log:
```
../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:95: error: cannot find symbol
private final LocalizationChannel localizationChannel;
^
symbol: class LocalizationChannel
location: class FlutterView
../../flutter/shell/platform/android/io/flutter/view/FlutterView.java:172: error: cannot find symbol
localizationChannel = new LocalizationChannel(dartExecutor);
^
symbol: class LocalizationChannel
location: class FlutterView
2 errors
```
This reverts commit 256db4bc23b7931509233df0dc04e44e16608229.