Merge "check for null listenerInfo for drag&drop" into sc-v2-dev

This commit is contained in:
Sally Yuen
2021-10-14 20:35:23 +00:00
committed by Android (Google) Code Review

View File

@@ -27060,7 +27060,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
switch (event.mAction) { switch (event.mAction) {
case DragEvent.ACTION_DRAG_STARTED: { case DragEvent.ACTION_DRAG_STARTED: {
if (result && li.mOnDragListener != null) { if (result && li != null && li.mOnDragListener != null) {
sendWindowContentChangedAccessibilityEvent( sendWindowContentChangedAccessibilityEvent(
AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED); AccessibilityEvent.CONTENT_CHANGE_TYPE_UNDEFINED);
} }
@@ -27074,7 +27074,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
refreshDrawableState(); refreshDrawableState();
} break; } break;
case DragEvent.ACTION_DROP: { case DragEvent.ACTION_DROP: {
if (result && (li.mOnDragListener != null | li.mOnReceiveContentListener != null)) { if (result && li != null && (li.mOnDragListener != null
|| li.mOnReceiveContentListener != null)) {
sendWindowContentChangedAccessibilityEvent( sendWindowContentChangedAccessibilityEvent(
AccessibilityEvent.CONTENT_CHANGE_TYPE_DRAG_DROPPED); AccessibilityEvent.CONTENT_CHANGE_TYPE_DRAG_DROPPED);
} }