public static AXTreeNode generateAccessibilityTree(View view, @Nullable AXTreeNode parent) {
    AXTreeNode axTree = new AXTreeNode(view, parent);

    if (view instanceof ViewGroup) {
      ViewGroup viewGroup = (ViewGroup) view;
      for (int i = 0; i < viewGroup.getChildCount(); i++) {
        AXTreeNode descendantTree = generateAccessibilityTree(viewGroup.getChildAt(i), axTree);
        axTree.addChild(descendantTree);
      }
    }

    return axTree;
  }
Returns whether a given {@link View} will be focusable by Google's TalkBack screen reader.

@param view The {@link View} to evaluate.
@return {@code boolean} if the view will be ignored by TalkBack.
core/src/main/java/com/facebook/testing/screenshot/layouthierarchy/AccessibilityUtil.java