This patch works around Android's limitations on reflection. With it embedded platform views that use virtual node hierarchy trees should be accessible on all Android versions to date. The workarounds in this PR are brittle. Ideally the methods would be made public in Android instead so we wouldn't need to employ tactics like these to work around the missing methods. `AccessibilityNodeInfo#getChildId` is blocked from any type of reflection access, but the underlying private member that the getter accesses, `mChildNodeIds`, can still be reflected on. On Android versions where we can't access the getter, this patch falls back on reflectively accessing the field instead. Unfortunately this field is a [`LongArray`](https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/util/LongArray.java), a utility data class private to Android. So in this case we're reflecting to both access the member and actually read data from it, since we need to use reflection to call `LongArray.get(index)`. `AccessibilityNodeInfo#getParent()` doesn't have any lucky available underlying members. However, `AccessibilityNodeInfo` itself is `Parcelable`, and `mParentNodeId` is one of the pieces of data that's written to a parcel via `AccessibilityNodeInfo#writeToParcel`. So the fallback for that is to write the node to a parcel and then read the parcel for the ID in question. This will break if the implementation details of `AccessibilityNodeInfo#writeToParcel` ever change. The details have already changed enough in the past to require two sets of logic for reading from the parcel.
Flutter Engine
Flutter is a new way to build high-performance, cross-platform mobile apps. Flutter is optimized for today's, and tomorrow's, mobile devices. We are focused on low-latency input and high frame rates on Android and iOS.
The Flutter Engine is a portable runtime for hosting Flutter applications. It implements Flutter's core libraries, including animation and graphics, file and network I/O, accessibility support, plugin architecture, and a Dart runtime and compile toolchain. Most developers will interact with Flutter via the Flutter Framework, which provides a modern, reactive framework, and a rich set of platform, layout and foundation widgets.
If you are new to Flutter, then you will find more general information on the Flutter project, including tutorials and samples, on our Web site at Flutter.dev. For specific information about Flutter's APIs, consider our API reference which can be found at the docs.flutter.dev.
If you intend to contribute to Flutter, welcome! You are encouraged to start with our contributor guide, which helps onboard new team members.