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

Commit 97daacd0 authored by Uwais Ashraf's avatar Uwais Ashraf
Browse files

Add logging for overview over home bug

Test: NA (just logging added)
Bug: 279059025
Flag: NA
Change-Id: Ic8bfa1e5975088f472b297e40535f243cad099f6
parent e8f4fbf0
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -40,6 +40,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
@@ -227,7 +229,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)) {