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

Commit e6e89993 authored by Ats Jenk's avatar Ats Jenk
Browse files

Log event when overflow is opened

Bug: 349845968
Test: atest BubblesTest
Test: manual, switch to overflow, check event is logged
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: I8e0c7493d4876c9acffe1a970bf8a264c46ed89b
parent e6a2f840
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -1350,11 +1350,7 @@ public class BubbleController implements ConfigurationChangeListener,
        if (BubbleOverflow.KEY.equals(key)) {
            mBubbleData.setSelectedBubbleFromLauncher(mBubbleData.getOverflow());
            mLayerView.showExpandedView(mBubbleData.getOverflow());
            if (wasExpanded) {
                mLogger.log(BubbleLogger.Event.BUBBLE_BAR_BUBBLE_SWITCHED);
            } else {
                mLogger.log(BubbleLogger.Event.BUBBLE_BAR_EXPANDED);
            }
            mLogger.log(BubbleLogger.Event.BUBBLE_BAR_OVERFLOW_SELECTED);
            return;
        }

+16 −0
Original line number Diff line number Diff line
@@ -2707,6 +2707,22 @@ public class BubblesTest extends SysuiTestCase {
                eq(BubbleLogger.Event.BUBBLE_BAR_EXPANDED));
    }

    @EnableFlags(FLAG_ENABLE_BUBBLE_BAR)
    @Test
    public void testEventLogging_bubbleBar_openOverflow() {
        mBubbleProperties.mIsBubbleBarEnabled = true;
        mPositioner.setIsLargeScreen(true);
        FakeBubbleStateListener bubbleStateListener = new FakeBubbleStateListener();
        mBubbleController.registerBubbleStateListener(bubbleStateListener);

        mEntryListener.onEntryAdded(mRow);

        clearInvocations(mBubbleLogger);
        mBubbleController.expandStackAndSelectBubbleFromLauncher(BubbleOverflow.KEY, 0);
        verify(mBubbleLogger).log(BubbleLogger.Event.BUBBLE_BAR_OVERFLOW_SELECTED);
        verifyNoMoreInteractions(mBubbleLogger);
    }

    /** Creates a bubble using the userId and package. */
    private Bubble createBubble(int userId, String pkg) {
        final UserHandle userHandle = new UserHandle(userId);