code: public static CharSequence getNodeText(AccessibilityNodeInfoCompat node) {
          if (node == null) {
              return null;
          }
  
          // Prefer content description over text.
          // TODO: Why are we checking the trimmed length?
          final CharSequence contentDescription = node.getContentDescription();
          if (!TextUtils.isEmpty(contentDescription)
                  && (TextUtils.getTrimmedLength(contentDescription) > 0)) {
              return contentDescription;
          }
  
          final CharSequence text = node.getText();
          if (!TextUtils.isEmpty(text)
                  && (TextUtils.getTrimmedLength(text) > 0)) {
              return text;
          }
  
          return null;
      }
docs: Gets the text of a <code>node</code> by returning the content description
  (if available) or by returning the text.
  
  @param node The node.
  @return The node text.