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

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

Merge "Adding diags to getWidget" into ub-launcher3-rvc-dev

parents 9915a7c6 180c2e10
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -91,7 +91,8 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
    }

    public Widget getWidget(String labelText) {
        try (LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
        try (LauncherInstrumentation.Closable e = mLauncher.eventsCheck();
             LauncherInstrumentation.Closable c = mLauncher.addContextLayer(
                     "getting widget " + labelText + " in widgets list")) {
            final UiObject2 widgetsContainer = verifyActiveContainer();
            mLauncher.assertTrue("Widgets container didn't become scrollable",
@@ -119,6 +120,8 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
                        maxWidth = Math.max(mLauncher.getVisibleBounds(sibling).width(), maxWidth);
                    }

                    if (mLauncher.getVisibleBounds(widget).bottom
                            <= displaySize.y - mLauncher.getBottomGestureSize()) {
                        int visibleDelta = maxWidth - mLauncher.getVisibleBounds(widget).width();
                        if (visibleDelta > 0) {
                            Rect parentBounds = mLauncher.getVisibleBounds(cell);
@@ -128,8 +131,6 @@ public final class Widgets extends LauncherInstrumentation.VisibleContainer {
                                    parentBounds.centerY(), 10, true, GestureScope.INSIDE);
                        }

                    if (mLauncher.getVisibleBounds(widget).bottom
                            <= displaySize.y - mLauncher.getBottomGestureSize()) {
                        return new Widget(mLauncher, widget);
                    }
                }