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

Commit 26185e1f authored by vadimt's avatar vadimt
Browse files

Adding debug tracing for a lab-only issue

Task doesn't get resumed upon clicking at it.

Bug: 133765434
Change-Id: I8c5c1308041949d94c6982c78b8337ea81ad400f
parent f07cf179
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.logging.UserEventDispatcher;
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;
@@ -182,6 +183,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {
        super(context, attrs, defStyleAttr);
        mActivity = BaseDraggingActivity.fromContext(context);
        setOnClickListener((view) -> {
            if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
                android.util.Log.d(TestProtocol.NO_START_TASK_TAG, "TaskView onClick");
            }
            if (getTask() == null) {
                return;
            }
@@ -285,6 +289,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {

    public void launchTask(boolean animate, boolean freezeTaskList, Consumer<Boolean> resultCallback,
            Handler resultCallbackHandler) {
        if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
            android.util.Log.d(TestProtocol.NO_START_TASK_TAG, "launchTask");
        }
        if (ENABLE_QUICKSTEP_LIVE_TILE.get()) {
            if (isRunningTask()) {
                getRecentsView().finishRecentsAnimation(false /* toRecents */,
@@ -299,6 +306,9 @@ public class TaskView extends FrameLayout implements PageCallbacks, Reusable {

    private void launchTaskInternal(boolean animate, boolean freezeTaskList,
            Consumer<Boolean> resultCallback, Handler resultCallbackHandler) {
        if (com.android.launcher3.testing.TestProtocol.sDebugTracing) {
            android.util.Log.d(TestProtocol.NO_START_TASK_TAG, "launchTaskInternal");
        }
        if (mTask != null) {
            final ActivityOptions opts;
            if (animate) {
+1 −0
Original line number Diff line number Diff line
@@ -70,4 +70,5 @@ public final class TestProtocol {
    public static final String REQUEST_DISABLE_DEBUG_TRACING = "disable-debug-tracing";
    public static final String NO_DRAG_TAG = "b/133009122";
    public static final String NO_START_TAG = "b/132900132";
    public static final String NO_START_TASK_TAG = "b/133765434";
}
+10 −3
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ import androidx.test.uiautomator.Direction;
import androidx.test.uiautomator.UiObject2;
import androidx.test.uiautomator.Until;

import com.android.launcher3.testing.TestProtocol;

/**
 * A recent task in the overview panel carousel.
 */
@@ -59,9 +61,14 @@ public final class OverviewTask {
     */
    public Background open() {
        verifyActiveContainer();
        mLauncher.getTestInfo(TestProtocol.REQUEST_ENABLE_DEBUG_TRACING);
        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                "clicking an overview task")) {
            mLauncher.assertTrue("Launching task didn't open a new window: " +
                            mTask.getParent().getContentDescription(),
                    mTask.clickAndWait(Until.newWindow(), WAIT_TIME_MS));
        }
        mLauncher.getTestInfo(TestProtocol.REQUEST_DISABLE_DEBUG_TRACING);
        return new Background(mLauncher);
    }
}