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

Commit 063d29a9 authored by Matías Hernández's avatar Matías Hernández
Browse files

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
parent 27224f9c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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)));