commit | 0ea217bce0d9980a51337613fb4011dea71786d1 | [log] [tgz] |
---|---|---|
author | Ats Jenk <atsjenk@google.com> | Tue Nov 15 13:41:07 2022 -0800 |
committer | Ats Jenk <atsjenk@google.com> | Tue Nov 15 14:06:26 2022 -0800 |
tree | 9e56f635afc54e6bd026c5256319567cab52aaa5 | |
parent | 1a43d1b5b1cd4157fe1dd558598d0a49205fd839 [diff] |
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
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java index 48c0cea1..d3f1332 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/windowdecor/DragResizeInputListener.java
@@ -317,7 +317,7 @@ } 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));