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

Commit 16fb9fac authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Adding tracing for switching to overview instead of all apps" into ub-launcher3-rvc-dev

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


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


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


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


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


            @Override
            @Override
            public void onAnimationSuccess(Animator animator) {
            public void onAnimationSuccess(Animator animator) {
                if (TestProtocol.sDebugTracing) {
                    Log.d(TestProtocol.OVERIEW_NOT_ALLAPPS, "onAnimationSuccess: " + state.ordinal);
                }
                onStateTransitionEnd(state);
                onStateTransitionEnd(state);
            }
            }
        });
        });
+1 −0
Original line number Original line 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 PERMANENT_DIAG_TAG = "TaplTarget";
    public static final String PAUSE_NOT_DETECTED = "b/139891609";
    public static final String PAUSE_NOT_DETECTED = "b/139891609";
    public static final String OVERIEW_NOT_ALLAPPS = "b/156095088";
}
}
+6 −0
Original line number Original line Diff line number Diff line
@@ -31,6 +31,7 @@ import android.animation.AnimatorListenerAdapter;
import android.animation.AnimatorSet;
import android.animation.AnimatorSet;
import android.animation.ValueAnimator;
import android.animation.ValueAnimator;
import android.os.SystemClock;
import android.os.SystemClock;
import android.util.Log;
import android.view.HapticFeedbackConstants;
import android.view.HapticFeedbackConstants;
import android.view.MotionEvent;
import android.view.MotionEvent;


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


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


        mStartProgress = 0;
        mStartProgress = 0;
        mPassedOverviewAtomicThreshold = false;
        mPassedOverviewAtomicThreshold = false;
+2 −2
Original line number Original line Diff line number Diff line
@@ -937,9 +937,9 @@ public final class LauncherInstrumentation {
        executeAndWaitForEvent(
        executeAndWaitForEvent(
                command,
                command,
                event -> isSwitchToStateEvent(event, expectedState, actualEvents),
                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)
                        + TestProtocol.stateOrdinalToString(expectedState)
                        + ", actual: " + eventListToString(actualEvents));
                        + "], actual: " + eventListToString(actualEvents));
    }
    }


    private boolean isSwitchToStateEvent(
    private boolean isSwitchToStateEvent(