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

Commit 40c1b93a authored by Liran Binyamin's avatar Liran Binyamin
Browse files

Add a test for stashed bubble bar

This change introduces a new test protocol event for unstashing the bubble bar.

It's not possible to do this via a UI event because the stashed handle is only visible when an app is in the foreground, but in that state none of the elements in TaskbarDragLayer are visible to accessbility.

Flag: LEGACY persist.wm.debug.bubble_bar DISABLED
Bug: 273994695
Test: atest PlatformScenarioTests:android.platform.test.scenario.sysui.bubble.BubbleBarTest
Change-Id: I4581bf95b07691429966ecbd573232047f820b69
parent ff03dd19
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -1341,6 +1341,16 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        }
    }

    /** Unstashes the Bubble Bar if it is stashed. */
    @VisibleForTesting
    public void unstashBubbleBarIfStashed() {
        mControllers.bubbleControllers.ifPresent(bubbleControllers -> {
            if (bubbleControllers.bubbleStashController.isStashed()) {
                bubbleControllers.bubbleStashController.showBubbleBar(false);
            }
        });
    }

    protected boolean isUserSetupComplete() {
        return mIsUserSetupComplete;
    }
+8 −0
Original line number Diff line number Diff line
@@ -154,6 +154,14 @@ public class QuickstepTestInformationHandler extends TestInformationHandler {
                // Allow null-pointer to catch illegal states.
                runOnTISBinder(tisBinder -> tisBinder.getTaskbarManager().recreateTaskbar());
                return response;

            case TestProtocol.REQUEST_UNSTASH_BUBBLE_BAR_IF_STASHED:
                runOnTISBinder(tisBinder -> {
                    // Allow null-pointer to catch illegal states.
                    tisBinder.getTaskbarManager().getCurrentActivityContext()
                            .unstashBubbleBarIfStashed();
                });
                return response;
        }

        return super.call(method, arg, extras);
+3 −0
Original line number Diff line number Diff line
@@ -172,6 +172,9 @@ public final class TestProtocol {

    public static final String REQUEST_FLAG_ENABLE_GRID_ONLY_OVERVIEW = "enable-grid-only-overview";

    public static final String REQUEST_UNSTASH_BUBBLE_BAR_IF_STASHED =
            "unstash-bubble-bar-if-stashed";

    /** Logs {@link Log#d(String, String)} if {@link #sDebugTracing} is true. */
    public static void testLogD(String tag, String message) {
        if (!sDebugTracing) {
+5 −0
Original line number Diff line number Diff line
@@ -2094,6 +2094,11 @@ public final class LauncherInstrumentation {
        getTestInfo(TestProtocol.REQUEST_UNSTASH_TASKBAR_IF_STASHED);
    }

    /** Shows the bubble bar if it is stashed, otherwise this does nothing. */
    public void showBubbleBarIfHidden() {
        getTestInfo(TestProtocol.REQUEST_UNSTASH_BUBBLE_BAR_IF_STASHED);
    }

    /** Blocks the taskbar from automatically stashing based on time. */
    public void enableBlockTimeout(boolean enable) {
        getTestInfo(enable