Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2794f563 authored by vadimt's avatar vadimt
Browse files

Adding tracing for switching to overview instead of all apps

Bug: 156095088
Change-Id: I1257617192e913d06edd0879396957b1e40524b7
parent 9e77f25d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@ import android.content.Context;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.UserHandle;
import android.util.Log;
import android.util.Pair;
import android.view.MotionEvent;
import android.view.View;
@@ -55,6 +56,7 @@ import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.appprediction.PredictionUiStateManager;
import com.android.launcher3.statehandlers.DepthController;
import com.android.launcher3.statehandlers.DepthController.ClampedDepthProperty;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.views.FloatingIconView;
import com.android.quickstep.SysUINavigationMode.Mode;
@@ -383,6 +385,9 @@ public final class LauncherActivityInterface implements BaseActivityInterface<La

    @Override
    public boolean switchToRecentsIfVisible(Runnable onCompleteCallback) {
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.OVERIEW_NOT_ALLAPPS, "switchToRecentsIfVisible");
        }
        Launcher launcher = getVisibleLauncher();
        if (launcher == null) {
            return false;
+9 −0
Original line number Diff line number Diff line
@@ -25,12 +25,14 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;

import com.android.launcher3.anim.AnimationSuccessListener;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.states.StateAnimationConfig.AnimationFlags;
import com.android.launcher3.testing.TestProtocol;

import java.io.PrintWriter;
import java.util.ArrayList;
@@ -334,6 +336,10 @@ public class LauncherStateManager {
    }

    private PendingAnimation createAnimationToNewWorkspaceInternal(final LauncherState state) {
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.OVERIEW_NOT_ALLAPPS, "createAnimationToNewWorkspaceInternal: "
                    + state.ordinal);
        }
        PendingAnimation builder = new PendingAnimation(mConfig.duration);
        for (StateHandler handler : getStateHandlers()) {
            handler.setStateWithAnimation(state, mConfig, builder);
@@ -348,6 +354,9 @@ public class LauncherStateManager {

            @Override
            public void onAnimationSuccess(Animator animator) {
                if (TestProtocol.sDebugTracing) {
                    Log.d(TestProtocol.OVERIEW_NOT_ALLAPPS, "onAnimationSuccess: " + state.ordinal);
                }
                onStateTransitionEnd(state);
            }
        });
+1 −0
Original line number Diff line number Diff line
@@ -100,4 +100,5 @@ public final class TestProtocol {

    public static final String PERMANENT_DIAG_TAG = "TaplTarget";
    public static final String PAUSE_NOT_DETECTED = "b/139891609";
    public static final String OVERIEW_NOT_ALLAPPS = "b/156095088";
}
+6 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.os.SystemClock;
import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;

@@ -43,6 +44,7 @@ import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.states.StateAnimationConfig;
import com.android.launcher3.states.StateAnimationConfig.AnimationFlags;
import com.android.launcher3.testing.TestProtocol;
import com.android.launcher3.userevent.nano.LauncherLogProto;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Direction;
import com.android.launcher3.userevent.nano.LauncherLogProto.Action.Touch;
@@ -194,6 +196,10 @@ public abstract class AbstractStateChangeTouchController

        mFromState = newFromState;
        mToState = newToState;
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.OVERIEW_NOT_ALLAPPS, "reinitCurrentAnimation: "
                    + newToState.ordinal);
        }

        mStartProgress = 0;
        mPassedOverviewAtomicThreshold = false;
+2 −2
Original line number Diff line number Diff line
@@ -937,9 +937,9 @@ public final class LauncherInstrumentation {
        executeAndWaitForEvent(
                command,
                event -> isSwitchToStateEvent(event, expectedState, actualEvents),
                () -> "Failed to receive an event for the state change: expected "
                () -> "Failed to receive an event for the state change: expected ["
                        + TestProtocol.stateOrdinalToString(expectedState)
                        + ", actual: " + eventListToString(actualEvents));
                        + "], actual: " + eventListToString(actualEvents));
    }

    private boolean isSwitchToStateEvent(