Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +4 −0 Original line number Diff line number Diff line Loading @@ -1979,11 +1979,15 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void addBubble(Bubble addedBubble) { // Only log metrics event mLogger.log(addedBubble, BubbleLogger.Event.BUBBLE_BAR_BUBBLE_POSTED); // Nothing to do for adds, these are handled by launcher / in the bubble bar. } @Override public void updateBubble(Bubble updatedBubble) { // Only log metrics event mLogger.log(updatedBubble, BubbleLogger.Event.BUBBLE_BAR_BUBBLE_UPDATED); // Nothing to do for updates, these are handled by launcher / in the bubble bar. } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleLogger.java +0 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.wm.shell.bubbles; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.internal.util.FrameworkStatsLog; Loading @@ -33,7 +32,6 @@ public class BubbleLogger { /** * Bubble UI event. */ @VisibleForTesting public enum Event implements UiEventLogger.UiEventEnum { // region bubble events Loading packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +32 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyList; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doReturn; Loading Loading @@ -2470,6 +2471,37 @@ public class BubblesTest extends SysuiTestCase { verify(stackView, never()).showOverflow(anyBoolean()); } @EnableFlags(FLAG_ENABLE_BUBBLE_BAR) @Test public void testEventLogging_bubbleBar_addBubble() { mBubbleProperties.mIsBubbleBarEnabled = true; mPositioner.setIsLargeScreen(true); FakeBubbleStateListener bubbleStateListener = new FakeBubbleStateListener(); mBubbleController.registerBubbleStateListener(bubbleStateListener); mEntryListener.onEntryAdded(mRow); verify(mBubbleLogger).log(argThat(b -> b.getKey().equals(mRow.getKey())), eq(BubbleLogger.Event.BUBBLE_BAR_BUBBLE_POSTED)); } @EnableFlags(FLAG_ENABLE_BUBBLE_BAR) @Test public void testEventLogging_bubbleBar_updateBubble() { mBubbleProperties.mIsBubbleBarEnabled = true; mPositioner.setIsLargeScreen(true); FakeBubbleStateListener bubbleStateListener = new FakeBubbleStateListener(); mBubbleController.registerBubbleStateListener(bubbleStateListener); mEntryListener.onEntryAdded(mRow); // Mark the notification as updated NotificationEntryHelper.modifyRanking(mRow).setTextChanged(true).build(); mEntryListener.onEntryUpdated(mRow, /* fromSystem= */ true); verify(mBubbleLogger).log(argThat(b -> b.getKey().equals(mRow.getKey())), eq(BubbleLogger.Event.BUBBLE_BAR_BUBBLE_UPDATED)); } /** Creates a bubble using the userId and package. */ private Bubble createBubble(int userId, String pkg) { final UserHandle userHandle = new UserHandle(userId); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +4 −0 Original line number Diff line number Diff line Loading @@ -1979,11 +1979,15 @@ public class BubbleController implements ConfigurationChangeListener, @Override public void addBubble(Bubble addedBubble) { // Only log metrics event mLogger.log(addedBubble, BubbleLogger.Event.BUBBLE_BAR_BUBBLE_POSTED); // Nothing to do for adds, these are handled by launcher / in the bubble bar. } @Override public void updateBubble(Bubble updatedBubble) { // Only log metrics event mLogger.log(updatedBubble, BubbleLogger.Event.BUBBLE_BAR_BUBBLE_UPDATED); // Nothing to do for updates, these are handled by launcher / in the bubble bar. } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleLogger.java +0 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.wm.shell.bubbles; import com.android.internal.annotations.VisibleForTesting; import com.android.internal.logging.UiEvent; import com.android.internal.logging.UiEventLogger; import com.android.internal.util.FrameworkStatsLog; Loading @@ -33,7 +32,6 @@ public class BubbleLogger { /** * Bubble UI event. */ @VisibleForTesting public enum Event implements UiEventLogger.UiEventEnum { // region bubble events Loading
packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +32 −0 Original line number Diff line number Diff line Loading @@ -46,6 +46,7 @@ import static org.mockito.ArgumentMatchers.anyBoolean; import static org.mockito.ArgumentMatchers.anyInt; import static org.mockito.ArgumentMatchers.anyList; import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.argThat; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.doReturn; Loading Loading @@ -2470,6 +2471,37 @@ public class BubblesTest extends SysuiTestCase { verify(stackView, never()).showOverflow(anyBoolean()); } @EnableFlags(FLAG_ENABLE_BUBBLE_BAR) @Test public void testEventLogging_bubbleBar_addBubble() { mBubbleProperties.mIsBubbleBarEnabled = true; mPositioner.setIsLargeScreen(true); FakeBubbleStateListener bubbleStateListener = new FakeBubbleStateListener(); mBubbleController.registerBubbleStateListener(bubbleStateListener); mEntryListener.onEntryAdded(mRow); verify(mBubbleLogger).log(argThat(b -> b.getKey().equals(mRow.getKey())), eq(BubbleLogger.Event.BUBBLE_BAR_BUBBLE_POSTED)); } @EnableFlags(FLAG_ENABLE_BUBBLE_BAR) @Test public void testEventLogging_bubbleBar_updateBubble() { mBubbleProperties.mIsBubbleBarEnabled = true; mPositioner.setIsLargeScreen(true); FakeBubbleStateListener bubbleStateListener = new FakeBubbleStateListener(); mBubbleController.registerBubbleStateListener(bubbleStateListener); mEntryListener.onEntryAdded(mRow); // Mark the notification as updated NotificationEntryHelper.modifyRanking(mRow).setTextChanged(true).build(); mEntryListener.onEntryUpdated(mRow, /* fromSystem= */ true); verify(mBubbleLogger).log(argThat(b -> b.getKey().equals(mRow.getKey())), eq(BubbleLogger.Event.BUBBLE_BAR_BUBBLE_UPDATED)); } /** Creates a bubble using the userId and package. */ private Bubble createBubble(int userId, String pkg) { final UserHandle userHandle = new UserHandle(userId); Loading