From bea7e2ee6e7a7c457f83260015d439c0e1631b4f Mon Sep 17 00:00:00 2001 From: vadimt Date: Mon, 23 Aug 2021 13:57:51 -0700 Subject: [PATCH] More logging for for Nexus home activity appearing after to-home gesture in L3 Bug: 192018189 Test: presubmit Change-Id: I92cfa9e40f71773e636c700ab7f84df1d9feac19 --- .../android/quickstep/AbsSwipeUpHandler.java | 17 +++++++++++++++++ .../OtherActivityInputConsumer.java | 7 +++++++ 2 files changed, 24 insertions(+) diff --git a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java index fe16b33069..46d58577cd 100644 --- a/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java +++ b/quickstep/src/com/android/quickstep/AbsSwipeUpHandler.java @@ -65,6 +65,7 @@ import android.graphics.RectF; import android.os.Build; import android.os.IBinder; import android.os.SystemClock; +import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.View.OnApplyWindowInsetsListener; @@ -87,6 +88,7 @@ import com.android.launcher3.logging.StatsLogManager; import com.android.launcher3.logging.StatsLogManager.StatsLogger; import com.android.launcher3.statemanager.BaseState; import com.android.launcher3.statemanager.StatefulActivity; +import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.tracing.InputConsumerProto; import com.android.launcher3.tracing.SwipeHandlerProto; import com.android.launcher3.util.TraceHelper; @@ -876,6 +878,9 @@ public abstract class AbsSwipeUpHandler, */ @UiThread public void onGestureEnded(float endVelocity, PointF velocity, PointF downPos) { + if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { + Log.d(TestProtocol.L3_SWIPE_TO_HOME, "3"); + } float flingThreshold = mContext.getResources() .getDimension(R.dimen.quickstep_fling_threshold_speed); boolean isFling = mGestureStarted && !mIsMotionPaused @@ -1037,6 +1042,9 @@ public abstract class AbsSwipeUpHandler, @UiThread private void handleNormalGestureEnd(float endVelocity, boolean isFling, PointF velocity, boolean isCancel) { + if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { + Log.d(TestProtocol.L3_SWIPE_TO_HOME, "4"); + } long duration = MAX_SWIPE_DURATION; float currentShift = mCurrentShift.value; final GestureEndTarget endTarget = calculateEndTarget(velocity, endVelocity, @@ -1155,6 +1163,9 @@ public abstract class AbsSwipeUpHandler, @UiThread private void animateToProgress(float start, float end, long duration, Interpolator interpolator, GestureEndTarget target, PointF velocityPxPerMs) { + if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { + Log.d(TestProtocol.L3_SWIPE_TO_HOME, "5"); + } runOnRecentsAnimationStart(() -> animateToProgressInternal(start, end, duration, interpolator, target, velocityPxPerMs)); } @@ -1183,6 +1194,9 @@ public abstract class AbsSwipeUpHandler, @UiThread private void animateToProgressInternal(float start, float end, long duration, Interpolator interpolator, GestureEndTarget target, PointF velocityPxPerMs) { + if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { + Log.d(TestProtocol.L3_SWIPE_TO_HOME, "7"); + } maybeUpdateRecentsAttachedState(); // If we are transitioning to launcher, then listen for the activity to be restarted while @@ -1812,6 +1826,9 @@ public abstract class AbsSwipeUpHandler, * be run when it is next started. */ protected void runOnRecentsAnimationStart(Runnable action) { + if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { + Log.d(TestProtocol.L3_SWIPE_TO_HOME, "6"); + } if (mRecentsAnimationTargets == null) { mRecentsAnimationStartCallbacks.add(action); } else { diff --git a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java index 725c7c45a5..e6285f2902 100644 --- a/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java +++ b/quickstep/src/com/android/quickstep/inputconsumers/OtherActivityInputConsumer.java @@ -50,6 +50,7 @@ import android.view.ViewConfiguration; import androidx.annotation.UiThread; import com.android.launcher3.R; +import com.android.launcher3.Utilities; import com.android.launcher3.testing.TestLogging; import com.android.launcher3.testing.TestProtocol; import com.android.launcher3.tracing.InputConsumerProto; @@ -356,6 +357,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC } case ACTION_CANCEL: case ACTION_UP: { + if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { + Log.d(TestProtocol.L3_SWIPE_TO_HOME, "1"); + } if (DEBUG_FAILED_QUICKSWITCH && !mPassedWindowMoveSlop) { float displacementX = mLastPos.x - mDownPos.x; float displacementY = mLastPos.y - mDownPos.y; @@ -409,6 +413,9 @@ public class OtherActivityInputConsumer extends ContextWrapper implements InputC * the animation can still be running. */ private void finishTouchTracking(MotionEvent ev) { + if (Utilities.IS_RUNNING_IN_TEST_HARNESS) { + Log.d(TestProtocol.L3_SWIPE_TO_HOME, "2"); + } Object traceToken = TraceHelper.INSTANCE.beginSection(UP_EVT, FLAG_CHECK_FOR_RACE_CONDITIONS);