From f9c1e2976683b715df0a8d7624a96e6c66af0455 Mon Sep 17 00:00:00 2001 From: Schneider Victor-Tulias Date: Tue, 11 Feb 2025 11:14:51 -0500 Subject: [PATCH] Add debug logs to AbsSwipeUpHandler.calculateEndTarget Flag: EXEMPT debug logs Bug: 394364217 Test: logcat Change-Id: I2b95cbbae4fdfb84dc29ebc90e7339aae199237d --- .../com/android/quickstep/AbsSwipeUpHandler.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index f46f9ae12a..d66ffbba8e 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -1112,6 +1112,9 @@ public abstract class AbsSwipeUpHandler< public void onGestureEnded(float endVelocityPxPerMs, PointF velocityPxPerMs) { float flingThreshold = mContext.getResources() .getDimension(R.dimen.quickstep_fling_threshold_speed); + Log.d(TAG, "onGestureEnded: mGestureStarted=" + mGestureStarted + + ", mIsMotionPaused=" + mIsMotionPaused + + ", flingThresholdPassed=" + (Math.abs(endVelocityPxPerMs) > flingThreshold)); boolean isFling = mGestureStarted && !mIsMotionPaused && Math.abs(endVelocityPxPerMs) > flingThreshold; mStateCallback.setStateOnUiThread(STATE_GESTURE_COMPLETED); @@ -1260,12 +1263,12 @@ public abstract class AbsSwipeUpHandler< dpiFromPx(velocityPxPerMs.x), dpiFromPx(velocityPxPerMs.y), Math.toDegrees(Math.atan2(-velocityPxPerMs.y, velocityPxPerMs.x))); - if (mGestureState.isHandlingAtomicEvent()) { // Button mode, this is only used to go to recents. return RECENTS; } + Log.d(TAG, "calculateEndTarget: isCancel=" + isCancel + ", isFlingY=" + isFlingY); GestureEndTarget endTarget; if (isCancel) { endTarget = LAST_TASK; @@ -1275,6 +1278,7 @@ public abstract class AbsSwipeUpHandler< endTarget = calculateEndTargetForNonFling(velocityPxPerMs); } + Log.d(TAG, "calculateEndTarget: endTarget(1)=" + endTarget); if (mDeviceState.isOverviewDisabled() && endTarget == RECENTS) { return LAST_TASK; } @@ -1293,6 +1297,7 @@ public abstract class AbsSwipeUpHandler< return LAST_TASK; } } + Log.d(TAG, "calculateEndTarget: endTarget(2)=" + endTarget); return endTarget; } @@ -1301,9 +1306,12 @@ public abstract class AbsSwipeUpHandler< final boolean willGoToNewTask = isScrollingToNewTask() && Math.abs(velocity.x) > Math.abs(endVelocity); final boolean isSwipeUp = endVelocity < 0; + Log.d(TAG, "calculateEndTargetForFlingY: willGoToNewTask=" + willGoToNewTask + + ", isSwipeUp=" + isSwipeUp); if (!isSwipeUp) { final boolean isCenteredOnNewTask = mRecentsView != null && mRecentsView.getDestinationPage() != mRecentsView.getRunningTaskIndex(); + Log.d(TAG, "calculateEndTargetForFlingY: isCenteredOnNewTask=" + isCenteredOnNewTask); return willGoToNewTask || isCenteredOnNewTask ? NEW_TASK : LAST_TASK; } @@ -1316,6 +1324,9 @@ public abstract class AbsSwipeUpHandler< // Fully gestural mode. final boolean isFlingX = Math.abs(velocity.x) > mContext.getResources() .getDimension(R.dimen.quickstep_fling_threshold_speed); + Log.d(TAG, "calculateEndTargetForNonFling: isScrollingToNewTask=" + isScrollingToNewTask + + ", isFlingX=" + isFlingX + + ", mIsMotionPaused=" + mIsMotionPaused); if (isScrollingToNewTask && isFlingX) { // Flinging towards new task takes precedence over mIsMotionPaused (which only // checks y-velocity). @@ -1325,6 +1336,7 @@ public abstract class AbsSwipeUpHandler< } else if (isScrollingToNewTask) { return NEW_TASK; } + Log.d(TAG, "calculateEndTargetForNonFling: mCanSlowSwipeGoHome=" + mCanSlowSwipeGoHome); return velocity.y < 0 && mCanSlowSwipeGoHome ? HOME : LAST_TASK; }