diff options
| author | 2020-12-03 02:37:03 +0000 | |
|---|---|---|
| committer | 2020-12-03 02:37:03 +0000 | |
| commit | 4f4064c143b7c3b5825e5afa062bc2b007614d33 (patch) | |
| tree | f03c330439680a9a635f359953708939bf8df17b | |
| parent | 29bca68828b2a537ca72c4c65e5d43a08ec8aca3 (diff) | |
| parent | 574e6b42944d0c4a7bedf2d2425b331b96d8feb9 (diff) | |
Merge "Wire displayId from input event to PipTouchState"
| -rw-r--r-- | libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchState.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchState.java b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchState.java index 217150770084..5f2327ce98d6 100644 --- a/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchState.java +++ b/libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchState.java @@ -19,6 +19,7 @@ package com.android.wm.shell.pip.phone; import android.graphics.PointF; import android.os.Handler; import android.util.Log; +import android.view.Display; import android.view.MotionEvent; import android.view.VelocityTracker; import android.view.ViewConfiguration; @@ -64,6 +65,7 @@ public class PipTouchState { private boolean mStartedDragging = false; private boolean mAllowDraggingOffscreen = false; private int mActivePointerId; + private int mLastTouchDisplayId = Display.INVALID_DISPLAY; public PipTouchState(ViewConfiguration viewConfig, Handler handler, Runnable doubleTapTimeoutCallback, Runnable hoverExitTimeoutCallback) { @@ -81,12 +83,14 @@ public class PipTouchState { mIsDragging = false; mStartedDragging = false; mIsUserInteracting = false; + mLastTouchDisplayId = Display.INVALID_DISPLAY; } /** * Processes a given touch event and updates the state. */ public void onTouchEvent(MotionEvent ev) { + mLastTouchDisplayId = ev.getDisplayId(); switch (ev.getActionMasked()) { case MotionEvent.ACTION_DOWN: { if (!mAllowTouches) { @@ -266,6 +270,13 @@ public class PipTouchState { } /** + * @return Display ID of the last touch event. + */ + public int getLastTouchDisplayId() { + return mLastTouchDisplayId; + } + + /** * Sets whether touching is currently allowed. */ public void setAllowTouches(boolean allowTouches) { @@ -378,6 +389,7 @@ public class PipTouchState { pw.println(prefix + TAG); pw.println(innerPrefix + "mAllowTouches=" + mAllowTouches); pw.println(innerPrefix + "mActivePointerId=" + mActivePointerId); + pw.println(innerPrefix + "mLastTouchDisplayId=" + mLastTouchDisplayId); pw.println(innerPrefix + "mDownTouch=" + mDownTouch); pw.println(innerPrefix + "mDownDelta=" + mDownDelta); pw.println(innerPrefix + "mLastTouch=" + mLastTouch); |