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

Commit 629e52b9 authored by liangguihao1's avatar liangguihao1 Committed by Guihao Liang
Browse files

Fix the problem that AccessibilityNodeInfo maybe null and cause a crash.



If the mAccessibilityDelegate of a view is not null, the mAccessibilityDelegate also has a corresponding AccessibilityNodeProvider object. If the AccessibilityNodeProvider does not overload the createAccessibilityNodeInfo(int virtualViewId) method, the app will crash. This bugfix is to add a non-null judgment here.

Bug:285078234

Change-Id: Iaccca83e9e47cfeb271186d0a4344555d6b433b6
Signed-off-by: default avatarliangguihao1 <liangguihao1@xiaomi.corp-partner.google.com>
parent 9a350627
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -9097,8 +9097,12 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
            final AccessibilityNodeInfo info = createAccessibilityNodeInfo();
            structure.setChildCount(1);
            final ViewStructure root = structure.newChild(0);
            if (info != null) {
                populateVirtualStructure(root, provider, info, forAutofill);
                info.recycle();
            } else {
                Log.w(AUTOFILL_LOG_TAG, "AccessibilityNodeInfo is null.");
            }
        }
    }