Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 86398bda authored by Svetoslav Ganov's avatar Svetoslav Ganov
Browse files

AccessiblityNodeInfo#findAccessibilityNodesByText returns null if non found.

1. Updated the code to return empty list instead.

2. Updated the doc to explain that the search is done in the
   sub-tree rooted at the info whose method is called.

Change-Id: I560d2563ed4772305bf2d7919560ef19baa30a1d
parent c9507ac7
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -252,7 +252,8 @@ public class AccessibilityNodeInfo implements Parcelable {

    /**
     * Finds {@link AccessibilityNodeInfo}s by text. The match is case
     * insensitive containment.
     * insensitive containment. The search is relative to this info i.e.
     * this info is the root of the traversed tree.
     *
     * @param text The searched text.
     * @return A list of node info.
@@ -260,7 +261,7 @@ public class AccessibilityNodeInfo implements Parcelable {
    public List<AccessibilityNodeInfo> findAccessibilityNodeInfosByText(String text) {
        enforceSealed();
        if (!canPerformRequestOverConnection(mAccessibilityViewId)) {
            return null;
            return Collections.emptyList();
        }
        try {
            return mConnection.findAccessibilityNodeInfosByViewText(text, mAccessibilityWindowId,