Merge "Fix long click crash." into udc-dev am: 8cedc2a3f4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23358336 Change-Id: Ida14e76314e63f42bcc46fded699b98f71ac93bf Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -7734,13 +7734,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
|
|||||||
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
|
sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_LONG_CLICKED);
|
||||||
|
|
||||||
boolean handled = false;
|
boolean handled = false;
|
||||||
final ListenerInfo li = mListenerInfo;
|
final OnLongClickListener listener =
|
||||||
|
mListenerInfo == null ? null : mListenerInfo.mOnLongClickListener;
|
||||||
boolean shouldPerformHapticFeedback = true;
|
boolean shouldPerformHapticFeedback = true;
|
||||||
if (li != null && li.mOnLongClickListener != null) {
|
if (listener != null) {
|
||||||
handled = li.mOnLongClickListener.onLongClick(View.this);
|
handled = listener.onLongClick(View.this);
|
||||||
if (handled) {
|
if (handled) {
|
||||||
shouldPerformHapticFeedback =
|
shouldPerformHapticFeedback = listener.onLongClickUseDefaultHapticFeedback(
|
||||||
li.mOnLongClickListener.onLongClickUseDefaultHapticFeedback(View.this);
|
View.this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!handled) {
|
if (!handled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user