diff options
| author | 2024-12-13 16:12:57 +0100 | |
|---|---|---|
| committer | 2024-12-13 16:12:57 +0100 | |
| commit | 063d29a9bd624d006a74d5fbb1036b1a758cd239 (patch) | |
| tree | b0e43c71d3974be959c82032e73795c3205d92f9 | |
| parent | 27224f9cdd4157dc311723f84064c49b6932f17c (diff) | |
Fix mocking of UserManager in EventConditionProviderTest
When mUserId != 0, getProfiles(0) was returning an empty list, making the onBootCompleted test fail.
Fixes: 383073905
Test: atest EventConditionProviderTest
Flag: EXEMPT test bugfix
Change-Id: Ifb2ec3bae73457a613b6e36d4d65c3335a019eba
| -rw-r--r-- | services/tests/uiservicestests/src/com/android/server/notification/EventConditionProviderTest.java | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/services/tests/uiservicestests/src/com/android/server/notification/EventConditionProviderTest.java b/services/tests/uiservicestests/src/com/android/server/notification/EventConditionProviderTest.java index fa1372d9f4ef..87b9154cfb4d 100644 --- a/services/tests/uiservicestests/src/com/android/server/notification/EventConditionProviderTest.java +++ b/services/tests/uiservicestests/src/com/android/server/notification/EventConditionProviderTest.java @@ -88,6 +88,8 @@ public class EventConditionProviderTest extends UiServiceTestCase { mService.mContext = this.getContext(); mContext.addMockSystemService(UserManager.class, mUserManager); + when(mUserManager.getProfiles(eq(UserHandle.USER_SYSTEM))).thenReturn( + List.of(new UserInfo(UserHandle.USER_SYSTEM, "USER_SYSTEM", 0))); when(mUserManager.getProfiles(eq(mUserId))).thenReturn( List.of(new UserInfo(mUserId, "mUserId", 0))); |