Fix long-press issue in RelativeTouchListener.

performLongClick does not check if the view is long-clickable, and defaults to showing a context menu if the long-click listener is not set. This crashes Bubbles. Just check if the view is long-clickable first.

Test: manual
Fixes: 154417194
Change-Id: I0bb1363fac3b5a2d16d1f5dc79f40b4a2bf88f4d
This commit is contained in:
Joshua Tsuji
2020-04-21 12:15:50 -04:00
parent ce316be991
commit bbe3b20856

View File

@@ -115,7 +115,9 @@ abstract class RelativeTouchListener : View.OnTouchListener {
performedLongClick = false
handler.postDelayed({
performedLongClick = v.performLongClick()
if (v.isLongClickable) {
performedLongClick = v.performLongClick()
}
}, ViewConfiguration.getLongPressTimeout().toLong())
}