Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +18 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.graphics.Region; import android.hardware.input.InputManager; import android.os.Looper; import android.provider.DeviceConfig; import android.util.Log; import android.view.BatchedInputEventReceiver; import android.view.Choreographer; import android.view.InputChannel; Loading Loading @@ -243,6 +244,7 @@ public class PipResizeGestureHandler { @VisibleForTesting void onInputEvent(InputEvent ev) { Log.d(TAG, "onInputEvent: " + ev); if (!mEnableDragCornerResize && !mEnablePinchResize) { // No need to handle anything if neither form of resizing is enabled. return; Loading @@ -256,6 +258,17 @@ public class PipResizeGestureHandler { if (ev instanceof MotionEvent) { MotionEvent mv = (MotionEvent) ev; int action = mv.getActionMasked(); // TODO: remove logging once b/269505548 is resolved if (action == MotionEvent.ACTION_MOVE && mFirstIndex != -1 && mSecondIndex != -1) { float x0 = mv.getRawX(mFirstIndex); float y0 = mv.getRawY(mFirstIndex); float x1 = mv.getRawX(mSecondIndex); float y1 = mv.getRawY(mSecondIndex); Log.d(TAG, "at onInputEvent (" + x0 + ", " + y0 + ")"); Log.d(TAG, "at onInputEvent (" + x1 + ", " + y1 + ")"); } final Rect pipBounds = mPipBoundsState.getBounds(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { if (!pipBounds.contains((int) mv.getRawX(), (int) mv.getRawY()) Loading Loading @@ -393,6 +406,7 @@ public class PipResizeGestureHandler { @VisibleForTesting void onPinchResize(MotionEvent ev) { Log.d(TAG, "onPinchResize: " + ev); int action = ev.getActionMasked(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { Loading Loading @@ -436,6 +450,10 @@ public class PipResizeGestureHandler { mLastPoint.set(x0, y0); mLastSecondPoint.set(x1, y1); // TODO: remove logging once b/269505548 is resolved Log.d(TAG, "at onPinchResize (" + x0 + ", " + y0 + ")"); Log.d(TAG, "at onPinchResize (" + x1 + ", " + y1 + ")"); // Capture inputs if (!mThresholdCrossed && (distanceBetween(mDownSecondPoint, mLastSecondPoint) > mTouchSlop Loading tests/FlickerTests/src/com/android/server/wm/flicker/helpers/GestureHelper.java +5 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.app.Instrumentation; import android.app.UiAutomation; import android.os.SystemClock; import android.util.Log; import android.view.InputDevice; import android.view.InputEvent; import android.view.MotionEvent; Loading @@ -30,6 +31,7 @@ import android.view.MotionEvent.PointerProperties; * Injects gestures given an {@link Instrumentation} object. */ public class GestureHelper { private static final String TAG = GestureHelper.class.getSimpleName(); // Inserted after each motion event injection. private static final int MOTION_EVENT_INJECTION_DELAY_MILLIS = 5; Loading Loading @@ -153,6 +155,9 @@ public class GestureHelper { for (int j = 0; j < coords.length; j++) { coords[j].x += (endPoints[j].x - startPoints[j].x) / steps; coords[j].y += (endPoints[j].y - startPoints[j].y) / steps; // TODO: remove logging once b/269505548 is resolved Log.d(TAG, "(" + coords[j].x + ", " + coords[j].y + ")"); } eventTime = SystemClock.uptimeMillis(); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +18 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,7 @@ import android.graphics.Region; import android.hardware.input.InputManager; import android.os.Looper; import android.provider.DeviceConfig; import android.util.Log; import android.view.BatchedInputEventReceiver; import android.view.Choreographer; import android.view.InputChannel; Loading Loading @@ -243,6 +244,7 @@ public class PipResizeGestureHandler { @VisibleForTesting void onInputEvent(InputEvent ev) { Log.d(TAG, "onInputEvent: " + ev); if (!mEnableDragCornerResize && !mEnablePinchResize) { // No need to handle anything if neither form of resizing is enabled. return; Loading @@ -256,6 +258,17 @@ public class PipResizeGestureHandler { if (ev instanceof MotionEvent) { MotionEvent mv = (MotionEvent) ev; int action = mv.getActionMasked(); // TODO: remove logging once b/269505548 is resolved if (action == MotionEvent.ACTION_MOVE && mFirstIndex != -1 && mSecondIndex != -1) { float x0 = mv.getRawX(mFirstIndex); float y0 = mv.getRawY(mFirstIndex); float x1 = mv.getRawX(mSecondIndex); float y1 = mv.getRawY(mSecondIndex); Log.d(TAG, "at onInputEvent (" + x0 + ", " + y0 + ")"); Log.d(TAG, "at onInputEvent (" + x1 + ", " + y1 + ")"); } final Rect pipBounds = mPipBoundsState.getBounds(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { if (!pipBounds.contains((int) mv.getRawX(), (int) mv.getRawY()) Loading Loading @@ -393,6 +406,7 @@ public class PipResizeGestureHandler { @VisibleForTesting void onPinchResize(MotionEvent ev) { Log.d(TAG, "onPinchResize: " + ev); int action = ev.getActionMasked(); if (action == MotionEvent.ACTION_UP || action == MotionEvent.ACTION_CANCEL) { Loading Loading @@ -436,6 +450,10 @@ public class PipResizeGestureHandler { mLastPoint.set(x0, y0); mLastSecondPoint.set(x1, y1); // TODO: remove logging once b/269505548 is resolved Log.d(TAG, "at onPinchResize (" + x0 + ", " + y0 + ")"); Log.d(TAG, "at onPinchResize (" + x1 + ", " + y1 + ")"); // Capture inputs if (!mThresholdCrossed && (distanceBetween(mDownSecondPoint, mLastSecondPoint) > mTouchSlop Loading
tests/FlickerTests/src/com/android/server/wm/flicker/helpers/GestureHelper.java +5 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import android.annotation.NonNull; import android.app.Instrumentation; import android.app.UiAutomation; import android.os.SystemClock; import android.util.Log; import android.view.InputDevice; import android.view.InputEvent; import android.view.MotionEvent; Loading @@ -30,6 +31,7 @@ import android.view.MotionEvent.PointerProperties; * Injects gestures given an {@link Instrumentation} object. */ public class GestureHelper { private static final String TAG = GestureHelper.class.getSimpleName(); // Inserted after each motion event injection. private static final int MOTION_EVENT_INJECTION_DELAY_MILLIS = 5; Loading Loading @@ -153,6 +155,9 @@ public class GestureHelper { for (int j = 0; j < coords.length; j++) { coords[j].x += (endPoints[j].x - startPoints[j].x) / steps; coords[j].y += (endPoints[j].y - startPoints[j].y) / steps; // TODO: remove logging once b/269505548 is resolved Log.d(TAG, "(" + coords[j].x + ", " + coords[j].y + ")"); } eventTime = SystemClock.uptimeMillis(); Loading