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

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

Log event when tapping on do not bubble convo

Bug: 349845968
Test: atest BubbleBarExpandedViewTest
Flag: com.android.wm.shell.enable_bubble_bar
Change-Id: Ib8b3a874febad012fd25ee1d376959261d5c6e1e
parent a36924d7
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -242,6 +242,18 @@ class BubbleBarExpandedViewTest {
        assertThat(uiEventLoggerFake.logs[0]).hasBubbleInfo(bubble)
    }

    @Test
    fun testEventLogging_unBubbleConversation() {
        getInstrumentation().runOnMainSync { bubbleExpandedView.handleView.performClick() }
        val menuItem = bubbleExpandedView.menuView()
            .actionViewWithText(context.getString(R.string.bubbles_dont_bubble_conversation))
        getInstrumentation().runOnMainSync { menuItem.performClick() }
        assertThat(uiEventLoggerFake.numLogs()).isEqualTo(1)
        assertThat(uiEventLoggerFake.logs[0].eventId)
            .isEqualTo(BubbleLogger.Event.BUBBLE_BAR_APP_MENU_OPT_OUT.id)
        assertThat(uiEventLoggerFake.logs[0]).hasBubbleInfo(bubble)
    }

    private fun BubbleBarExpandedView.menuView(): BubbleBarMenuView {
        return findViewByPredicate { it is BubbleBarMenuView }
    }
+1 −0
Original line number Diff line number Diff line
@@ -241,6 +241,7 @@ public class BubbleBarExpandedView extends FrameLayout implements BubbleTaskView
                if (mListener != null) {
                    mListener.onUnBubbleConversation(bubble.getKey());
                }
                mBubbleLogger.log(bubble, BubbleLogger.Event.BUBBLE_BAR_APP_MENU_OPT_OUT);
            }

            @Override