Fix crash when handling touch on caption
http://ag/20355140 moved drag detection outside the switch block. It now can be true when we are not going to handle the touch. Add extra check for mShouldHandleEvents before processing ACTION_UP or ACTION_CANCEL. Bug: 259297955 Test: touch down outside the window, in caption area, drag finger and release Test: attach a bluetooth mouse and resize the window from sides Change-Id: I6645479eb1709e68ade87d2d7e7babdf99f232aa
This commit is contained in:
@@ -317,7 +317,7 @@ class DragResizeInputListener implements AutoCloseable {
|
||||
}
|
||||
case MotionEvent.ACTION_UP:
|
||||
case MotionEvent.ACTION_CANCEL: {
|
||||
if (mDragging) {
|
||||
if (mShouldHandleEvents && mDragging) {
|
||||
int dragPointerIndex = e.findPointerIndex(mDragPointerId);
|
||||
mCallback.onDragResizeEnd(
|
||||
e.getRawX(dragPointerIndex), e.getRawY(dragPointerIndex));
|
||||
|
||||
Reference in New Issue
Block a user