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

Commit 50164745 authored by Schneider Victor-tulias's avatar Schneider Victor-tulias Committed by Automerger Merge Worker
Browse files

Merge "Add debug logs to debug flaky workspace binding" into tm-qpr-dev am:...

Merge "Add debug logs to debug flaky workspace binding" into tm-qpr-dev am: cd173106 am: 4f4962fb

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/21542943



Change-Id: If92717381b6f7ae5b958098141edb3dfa43f91bc
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 3e3f308e 4f4962fb
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -1860,6 +1860,9 @@ public class Launcher extends StatefulActivity<LauncherState>
    }
    }


    private void setWorkspaceLoading(boolean value) {
    private void setWorkspaceLoading(boolean value) {
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.FLAKY_BINDING, "running: setWorkspaceLoading=" + value);
        }
        mWorkspaceLoading = value;
        mWorkspaceLoading = value;
    }
    }


@@ -2306,6 +2309,9 @@ public class Launcher extends StatefulActivity<LauncherState>
     */
     */
    public void startBinding() {
    public void startBinding() {
        Object traceToken = TraceHelper.INSTANCE.beginSection("startBinding");
        Object traceToken = TraceHelper.INSTANCE.beginSection("startBinding");
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.FLAKY_BINDING, "running: startBinding");
        }
        // Floating panels (except the full widget sheet) are associated with individual icons. If
        // Floating panels (except the full widget sheet) are associated with individual icons. If
        // we are starting a fresh bind, close all such panels as all the icons are about
        // we are starting a fresh bind, close all such panels as all the icons are about
        // to go away.
        // to go away.
@@ -2778,6 +2784,9 @@ public class Launcher extends StatefulActivity<LauncherState>
     */
     */
    public void finishBindingItems(IntSet pagesBoundFirst) {
    public void finishBindingItems(IntSet pagesBoundFirst) {
        Object traceToken = TraceHelper.INSTANCE.beginSection("finishBindingItems");
        Object traceToken = TraceHelper.INSTANCE.beginSection("finishBindingItems");
        if (TestProtocol.sDebugTracing) {
            Log.d(TestProtocol.FLAKY_BINDING, "running: finishBindingItems");
        }
        mWorkspace.restoreInstanceStateForRemainingPages();
        mWorkspace.restoreInstanceStateForRemainingPages();


        setWorkspaceLoading(false);
        setWorkspaceLoading(false);
+6 −0
Original line number Original line Diff line number Diff line
@@ -246,6 +246,9 @@ public abstract class BaseLauncherBinder {
            sortWorkspaceItemsSpatially(idp, otherWorkspaceItems);
            sortWorkspaceItemsSpatially(idp, otherWorkspaceItems);


            // Tell the workspace that we're about to start binding items
            // Tell the workspace that we're about to start binding items
            if (TestProtocol.sDebugTracing) {
                Log.d(TestProtocol.FLAKY_BINDING, "scheduling: startBinding");
            }
            executeCallbacksTask(c -> {
            executeCallbacksTask(c -> {
                c.clearPendingBinds();
                c.clearPendingBinds();
                c.startBinding();
                c.startBinding();
@@ -264,6 +267,9 @@ public abstract class BaseLauncherBinder {
            Executor pendingExecutor = pendingTasks::add;
            Executor pendingExecutor = pendingTasks::add;
            bindWorkspaceItems(otherWorkspaceItems, pendingExecutor);
            bindWorkspaceItems(otherWorkspaceItems, pendingExecutor);
            bindAppWidgets(otherAppWidgets, pendingExecutor);
            bindAppWidgets(otherAppWidgets, pendingExecutor);
            if (TestProtocol.sDebugTracing) {
                Log.d(TestProtocol.FLAKY_BINDING, "scheduling: finishBindingItems");
            }
            executeCallbacksTask(c -> c.finishBindingItems(currentScreenIds), pendingExecutor);
            executeCallbacksTask(c -> c.finishBindingItems(currentScreenIds), pendingExecutor);
            pendingExecutor.execute(
            pendingExecutor.execute(
                    () -> {
                    () -> {
+1 −0
Original line number Original line Diff line number Diff line
@@ -154,6 +154,7 @@ public final class TestProtocol {
    public static final String MISSING_PROMISE_ICON = "b/202985412";
    public static final String MISSING_PROMISE_ICON = "b/202985412";
    public static final String TASKBAR_IN_APP_STATE = "b/227657604";
    public static final String TASKBAR_IN_APP_STATE = "b/227657604";
    public static final String NPE_TRANSIENT_TASKBAR = "b/257549303";
    public static final String NPE_TRANSIENT_TASKBAR = "b/257549303";
    public static final String FLAKY_BINDING = "b/270216650";


    public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
    public static final String REQUEST_EMULATE_DISPLAY = "emulate-display";
    public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";
    public static final String REQUEST_STOP_EMULATE_DISPLAY = "stop-emulate-display";
+9 −1
Original line number Original line Diff line number Diff line
@@ -33,6 +33,7 @@ import com.android.launcher3.celllayout.testcases.ReorderTestCase;
import com.android.launcher3.celllayout.testcases.SimpleReorderCase;
import com.android.launcher3.celllayout.testcases.SimpleReorderCase;
import com.android.launcher3.tapl.Widget;
import com.android.launcher3.tapl.Widget;
import com.android.launcher3.tapl.WidgetResizeFrame;
import com.android.launcher3.tapl.WidgetResizeFrame;
import com.android.launcher3.testing.shared.TestProtocol;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.AbstractLauncherUiTest;
import com.android.launcher3.ui.TaplTestsLauncher3;
import com.android.launcher3.ui.TaplTestsLauncher3;
import com.android.launcher3.util.rule.ShellCommandRule;
import com.android.launcher3.util.rule.ShellCommandRule;
@@ -118,7 +119,14 @@ public class ReorderWidgets extends AbstractLauncherUiTest {
        // waitForLauncherCondition to wait for that condition, otherwise the condition would
        // waitForLauncherCondition to wait for that condition, otherwise the condition would
        // always be true and it wouldn't wait for the changes to be applied.
        // always be true and it wouldn't wait for the changes to be applied.
        resetLoaderState();
        resetLoaderState();
        waitForLauncherCondition("Workspace didn't finish loading", l -> !l.isWorkspaceLoading());
        Log.d(TestProtocol.FLAKY_BINDING, "waiting for: isWorkspaceLoading=false");
        waitForLauncherCondition("Workspace didn't finish loading", l -> {
            boolean isWorkspaceLoading = l.isWorkspaceLoading();

            Log.d(TestProtocol.FLAKY_BINDING, "checking: isWorkspaceLoading=" + isWorkspaceLoading);

            return !isWorkspaceLoading;
        });
        Widget widget = mLauncher.getWorkspace().getWidgetAtCell(mainWidgetCellPos.getCellX(),
        Widget widget = mLauncher.getWorkspace().getWidgetAtCell(mainWidgetCellPos.getCellX(),
                mainWidgetCellPos.getCellY());
                mainWidgetCellPos.getCellY());
        assertNotNull(widget);
        assertNotNull(widget);