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

Commit fc1d2daa authored by Pat Manning's avatar Pat Manning
Browse files

Prevent taskbar icon tooltip from showing on hotseat transition.

Fix: 350512938
Test: TaskbarHoverToolTipControllerTest
Flag: EXEMPT bugfix
Change-Id: Ifc1647834358366b2d98555138edd4ad6286c16e
parent 58f5d08d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -1649,6 +1649,10 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
        return mControllers.uiController.canToggleHomeAllApps();
    }

    boolean isIconAlignedWithHotseat() {
        return mControllers.uiController.isIconAlignedWithHotseat();
    }

    @VisibleForTesting
    public TaskbarControllers getControllers() {
        return mControllers;
+4 −0
Original line number Diff line number Diff line
@@ -159,6 +159,10 @@ public class TaskbarHoverToolTipController implements View.OnHoverListener {
        if (mHoverView == null || mToolTipText == null) {
            return;
        }
        // Do not show tooltip if taskbar icons are transitioning to hotseat.
        if (mActivity.isIconAlignedWithHotseat()) {
            return;
        }
        if (mHoverView instanceof FolderIcon && !((FolderIcon) mHoverView).getIconVisible()) {
            return;
        }
+16 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase {
        when(taskbarActivityContext.getDragLayer()).thenReturn(mTaskbarDragLayer);
        when(taskbarActivityContext.getMainLooper()).thenReturn(context.getMainLooper());
        when(taskbarActivityContext.getDisplay()).thenReturn(mDisplay);
        when(taskbarActivityContext.isIconAlignedWithHotseat()).thenReturn(false);

        when(mTaskbarDragLayer.getChildCount()).thenReturn(1);
        mSpyFolderView = spy(new Folder(new ActivityContextWrapper(context), null));
@@ -243,6 +244,21 @@ public class TaskbarHoverToolTipControllerTest extends TaskbarBaseTestCase {
                false);
    }

    @Test
    public void onHover_hoverEnterIconAlignedWithHotseat_noReveal() {
        when(mMotionEvent.getAction()).thenReturn(MotionEvent.ACTION_HOVER_ENTER);
        when(mMotionEvent.getActionMasked()).thenReturn(MotionEvent.ACTION_HOVER_ENTER);
        when(taskbarActivityContext.isIconAlignedWithHotseat()).thenReturn(true);

        boolean hoverHandled =
                mTaskbarHoverToolTipController.onHover(mHoverBubbleTextView, mMotionEvent);
        waitForIdleSync();

        assertThat(hoverHandled).isTrue();
        verify(taskbarActivityContext).setAutohideSuspendFlag(FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS,
                true);
    }

    private void waitForIdleSync() {
        mTestableLooper.processAllMessages();
    }