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

Commit ae710a2f authored by Uwais Ashraf's avatar Uwais Ashraf Committed by Android (Google) Code Review
Browse files

Merge "Add logging for overview over home bug" into main

parents 78745df2 97daacd0
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -42,6 +42,8 @@ import com.android.launcher3.testing.shared.TestProtocol;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.stream.Collectors;

/**
 * Class to manage transitions between different states for a StatefulActivity based on different
@@ -229,7 +231,15 @@ public class StateManager<STATE_TYPE extends BaseState<STATE_TYPE>> {

    private void goToState(
            STATE_TYPE state, boolean animated, long delay, AnimatorListener listener) {
        Log.d(TestProtocol.OVERVIEW_OVER_HOME, "go to state " + state);
        String stackTrace = Log.getStackTraceString(new Exception("tracing state transition"));
        String truncatedTrace =
                Arrays.stream(stackTrace.split("\\n"))
                    .limit(5)
                    .skip(1) // Removes the line "java.lang.Exception: tracing state transition"
                    .filter(traceLine -> !traceLine.contains("StateManager.goToState"))
                    .collect(Collectors.joining("\n"));
        Log.d(TestProtocol.OVERVIEW_OVER_HOME,
                "go to state " + state + " partial trace:\n" + truncatedTrace);

        animated &= areAnimatorsEnabled();
        if (mActivity.isInState(state)) {