From 84bcd8935262476a3efa5792666f8a4d9df983ab Mon Sep 17 00:00:00 2001 From: sallyyuen Date: Mon, 11 Oct 2021 07:23:08 -0700 Subject: [PATCH] check for null listenerInfo for drag&drop Bug: 201778218 Test: n/a Change-Id: I9c50a429ee409e4a040c03bba9ac28729720a929 --- core/java/android/view/View.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java index afdb755179a6b..fae5a5df54932 100644 --- a/core/java/android/view/View.java +++ b/core/java/android/view/View.java @@ -27059,7 +27059,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback, switch (event.mAction) { case DragEvent.ACTION_DRAG_STARTED: { - if (result && li.mOnDragListener != null) { + if (result && li != null && li.mOnDragListener != null) { sendWindowContentChangedAccessibilityEvent( AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED); } @@ -27073,7 +27073,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback, refreshDrawableState(); } break; case DragEvent.ACTION_DROP: { - if (result && (li.mOnDragListener != null | li.mOnReceiveContentListener != null)) { + if (result && li != null && (li.mOnDragListener != null + || li.mOnReceiveContentListener != null)) { sendWindowContentChangedAccessibilityEvent( AccessibilityEvent.CONTENT_CHANGE_TYPE_DRAG_DROPPED); }