public static boolean isSpeakingNode(
      @Nullable AccessibilityNodeInfoCompat node, @Nullable View view) {
    if (node == null || view == null) {
      return false;
    }

    final int important = ViewCompat.getImportantForAccessibility(view);
    if (important == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS
        || (important == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_NO && node.getChildCount() <= 0)) {
      return false;
    }

    return node.isCheckable() || hasText(node) || hasNonActionableSpeakingDescendants(node, view);
  }
Returns whether the supplied {@link View} and {@link AccessibilityNodeInfoCompat} would produce
spoken feedback if it were accessibility focused. NOTE: not all speaking nodes are focusable.

@param view The {@link View} to evaluate
@param node The {@link AccessibilityNodeInfoCompat} to evaluate
@return {@code true} if it meets the criterion for producing spoken feedback
core/src/main/java/com/facebook/testing/screenshot/layouthierarchy/AccessibilityUtil.java