diff options
| author | 2025-02-28 15:10:12 -0800 | |
|---|---|---|
| committer | 2025-03-06 11:38:14 -0800 | |
| commit | fe4095f73b513074be9917540fe4b507f894ae2f (patch) | |
| tree | 084e7bf49e95c683af10c35d5608fe30c86a8f26 | |
| parent | 48012db107f4ae85d6f9f54639adc4ef7c66c96b (diff) | |
Fix test failures on HSUM build
- In setup, call switch user which will set up the mocks for
  the user on the device -- necessary for HSUM build where
  the user isn't 0
- Set the user on the group entry builder (it defaults
  to 0 which will fail on HSUM).
Flag: EXEMPT test fix
Test: atest BubblesTest on HSUM build
      (lunch tangorpro_hsum-trunk_staging-eng)
Bug: 384280396
Change-Id: Ifec01bba0494988351058f1f96bacb8ac098df6a
2 files changed, 4 insertions, 1 deletions
| diff --git a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java index c376fad1503f..0c116f125642 100644 --- a/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java +++ b/packages/SystemUI/multivalentTests/src/com/android/systemui/statusbar/notification/row/NotificationTestHelper.java @@ -359,6 +359,7 @@ public class NotificationTestHelper {                  .setUid(UID)                  .setInitialPid(2000)                  .setNotification(summary) +                .setUser(USER_HANDLE)                  .setParent(GroupEntry.ROOT_ENTRY)                  .build();          GroupEntryBuilder groupEntry = new GroupEntryBuilder() diff --git a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java index 341bd3a38999..a8cd9ed60a01 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java @@ -136,7 +136,6 @@ import com.android.systemui.statusbar.RankingBuilder;  import com.android.systemui.statusbar.SysuiStatusBarStateController;  import com.android.systemui.statusbar.notification.NotifPipelineFlags;  import com.android.systemui.statusbar.notification.collection.GroupEntry; -import com.android.systemui.statusbar.notification.collection.GroupEntryBuilder;  import com.android.systemui.statusbar.notification.collection.NotifPipeline;  import com.android.systemui.statusbar.notification.collection.NotificationEntry;  import com.android.systemui.statusbar.notification.collection.NotificationEntryBuilder; @@ -605,6 +604,9 @@ public class BubblesTest extends SysuiTestCase {          // Get a reference to KeyguardStateController.Callback          verify(mKeyguardStateController, atLeastOnce())                  .addCallback(mKeyguardStateControllerCallbackCaptor.capture()); + +        // Make sure mocks are set up for current user +        switchUser(ActivityManager.getCurrentUser());      }      @After |