Merge "Fix the problem that AccessibilityNodeInfo maybe null and cause a crash." am: 27c5bed4fa

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2606576

Change-Id: If22bf34788bbdd57d41d826baefb5d238c30c37a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Daniel Norman
2023-06-02 21:37:51 +00:00
committed by Automerger Merge Worker

View File

@@ -9137,8 +9137,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
final AccessibilityNodeInfo info = createAccessibilityNodeInfo(); final AccessibilityNodeInfo info = createAccessibilityNodeInfo();
structure.setChildCount(1); structure.setChildCount(1);
final ViewStructure root = structure.newChild(0); final ViewStructure root = structure.newChild(0);
populateVirtualStructure(root, provider, info, forAutofill); if (info != null) {
info.recycle(); populateVirtualStructure(root, provider, info, forAutofill);
info.recycle();
} else {
Log.w(AUTOFILL_LOG_TAG, "AccessibilityNodeInfo is null.");
}
} }
} }