Home
last modified time | relevance | path

Searched refs:mUserHandleHelper (Results 1 – 12 of 12) sorted by relevance

/packages/services/Car/tests/carservice_unit_test/src/com/android/car/user/
DMockedUserHandleBuilder.java26 private UserHandleHelper mUserHandleHelper; field in MockedUserHandleBuilder
30 mUserHandleHelper = userHandleHelper; in MockedUserHandleBuilder()
33 when(mUserHandleHelper.isEnabledUser(mUser)).thenReturn(true); in MockedUserHandleBuilder()
34 when(mUserHandleHelper.getExistingUserHandle(userId)).thenReturn(mUser); in MockedUserHandleBuilder()
38 when(mUserHandleHelper.isEnabledUser(mUser)).thenReturn(false); in setDisabled()
43 when(mUserHandleHelper.isAdminUser(mUser)).thenReturn(true); in setAdmin()
48 when(mUserHandleHelper.isGuestUser(mUser)).thenReturn(true); in setGuest()
53 when(mUserHandleHelper.isEphemeralUser(mUser)).thenReturn(true); in setEphemeral()
58 when(mUserHandleHelper.isManagedProfile(mUser)).thenReturn(true); in setManagedProfile()
64 when(mUserHandleHelper.isAdminUser(mUser)).thenThrow(exception); in expectGettersFail()
[all …]
DUserHandleHelperUnitTest.java49 private UserHandleHelper mUserHandleHelper; field in UserHandleHelperUnitTest
60 mUserHandleHelper = new UserHandleHelper(mMockContext, mUserManager); in setup()
75 expectThat(mUserHandleHelper.getExistingUserHandle(100)).isEqualTo(user100); in testGetExistingUserHandle()
76 expectThat(mUserHandleHelper.getExistingUserHandle(101)).isEqualTo(user101); in testGetExistingUserHandle()
77 expectThat(mUserHandleHelper.getExistingUserHandle(102)).isEqualTo(user102); in testGetExistingUserHandle()
78 expectThat(mUserHandleHelper.getExistingUserHandle(103)).isNull(); in testGetExistingUserHandle()
87 assertThat(mUserHandleHelper.getEnabledProfiles( in testGetEnabledProfiles()
95 assertThat(mUserHandleHelper.isGuestUser(mContextUser)).isTrue(); in testIsGuestUser()
102 assertThat(mUserHandleHelper.isAdminUser(mContextUser)).isTrue(); in testIsAdminUser()
110 assertThat(mUserHandleHelper.isEphemeralUser(user)).isTrue(); in testIsEphemeralUser()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/hal/
DUserHalHelperTest.java96 private UserHandleHelper mUserHandleHelper; field in UserHalHelperTest
147 UserHandle user = expectSystemUserExists(mUserHandleHelper, UserHandle.USER_SYSTEM); in testConvertFlags()
150 user = expectRegularUserExists(mUserHandleHelper, 101); in testConvertFlags()
153 user = expectAdminUserExists(mUserHandleHelper, 102); in testConvertFlags()
156 user = expectEphemeralUserExists(mUserHandleHelper, 103); in testConvertFlags()
159 user = expectGuestUserExists(mUserHandleHelper, 104, /* isEphemeral= */ true); in testConvertFlags()
171 () -> UserHalHelper.getFlags(mUserHandleHelper, 101)); in testGetFlags_noUser()
176 UserHandle user = expectSystemUserExists(mUserHandleHelper, UserHandle.USER_SYSTEM); in testGetFlags_ok()
179 user = expectRegularUserExists(mUserHandleHelper, 101); in testGetFlags_ok()
182 user = expectAdminUserExists(mUserHandleHelper, 102); in testGetFlags_ok()
[all …]
/packages/services/Car/service/src/com/android/car/user/
DExperimentalCarUserService.java92 private final UserHandleHelper mUserHandleHelper; field in ExperimentalCarUserService
144 mUserHandleHelper = userHandleHelper; in ExperimentalCarUserService()
250 UserHandle driver = mUserHandleHelper.getExistingUserHandle(driverId); in createPassenger()
255 if (mUserHandleHelper.isGuestUser(driver)) { in createPassenger()
314 && mUserHandleHelper.isEnabledUser(user) in getAllDrivers()
315 && !mUserHandleHelper.isManagedProfile(user) in getAllDrivers()
316 && !mUserHandleHelper.isEphemeralUser(user)); in getAllDrivers()
331 && mUserHandleHelper.isEnabledUser(user) in getPassengers()
332 && mUserHandleHelper.isManagedProfile(user) in getPassengers()
391 UserHandle passenger = mUserHandleHelper.getExistingUserHandle(passengerId); in stopPassengerInternal()
[all …]
DInitialUserSetter.java137 private final UserHandleHelper mUserHandleHelper; field in InitialUserSetter
163 mUserHandleHelper = userHandleHelper; in InitialUserSetter()
394 UserHandle currentUser = mUserHandleHelper.getExistingUserHandle(currentUserId); in replaceUser()
478 UserHandle user = mUserHandleHelper.getExistingUserHandle(userId); in switchUser()
486 if (mUserHandleHelper.isGuestUser(user) && replaceGuest) { in switchUser()
526 if (!mUserHandleHelper.isGuestUser(user)) { in canReplaceGuestUser()
561 if (mUserHandleHelper.isEphemeralUser(user)) { in replaceGuestIfNeeded()
732 UserHandle user = mUserHandleHelper.getExistingUserHandle(userId); in setLastActiveUser()
737 if (!mUserHandleHelper.isEphemeralUser(user)) { in setLastActiveUser()
858 if (mUserHandleHelper.isManagedProfile(user)) { in hasInitialUser()
[all …]
DCarUserService.java340 private final UserHandleHelper mUserHandleHelper; field in CarUserService
374 mUserHandleHelper = userHandleHelper; in CarUserService()
378 (u) -> setInitialUser(u), mUserHandleHelper) : initialUserSetter; in CarUserService()
705 UserHandle currentUser = mUserHandleHelper.getExistingUserHandle(currentUserId); in initResumeReplaceGuest()
763 UsersInfo usersInfo = UserHalHelper.newUsersInfo(mUserManager, mUserHandleHelper); in initBootUser()
917 UserHandle targetUser = mUserHandleHelper.getExistingUserHandle(targetUserId); in switchUser()
1013 UsersInfo usersInfo = UserHalHelper.newUsersInfo(mUserManager, mUserHandleHelper); in handleSwitchUser()
1126 if (!mUserHandleHelper.isAdminUser(UserHandle.of(callingUserId)) in removeUser()
1137 UserHandle user = mUserHandleHelper.getExistingUserHandle(userId); in handleRemoveUser()
1144 halUser.flags = UserHalHelper.convertFlags(mUserHandleHelper, user); in handleRemoveUser()
[all …]
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/am/
DFixedActivityServiceTest.java98 private UserHandleHelper mUserHandleHelper; field in FixedActivityServiceTest
124 mActivityService, mDisplayManager, mUserHandleHelper); in setUp()
538 when(mUserHandleHelper.getEnabledProfiles(101)) in onUserSwitchToUserWithEnabledProfile_noChangeInRunningActivities()
665 when(mUserHandleHelper.getEnabledProfiles(userId)).thenReturn(new ArrayList<UserHandle>()); in expectNoProfileUser()
/packages/services/Car/service/src/com/android/car/am/
DFixedActivityService.java269 private final UserHandleHelper mUserHandleHelper; field in FixedActivityService
285 mUserHandleHelper = userHandleHelper; in FixedActivityService()
582 List<UserHandle> profiles = mUserHandleHelper.getEnabledProfiles(currentUser); in isUserAllowedToLaunchActivity()
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/media/
DCarMediaServiceTest.java129 @Mock private UserHandleHelper mUserHandleHelper; field in CarMediaServiceTest
179 when(mUserHandleHelper.isEphemeralUser(UserHandle.of(TEST_USER_ID))).thenReturn(false); in setUp()
183 mMockCarPowerManagementService, mUserHandleHelper); in setUp()
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/
DCarOccupantZoneServiceTest.java97 private UserHandleHelper mUserHandleHelper; field in CarOccupantZoneServiceTest
266 /* enableProfileUserAssignmentForMultiDisplay= */ false, mUserHandleHelper); in setUp()
395 /* enableProfileUserAssignmentForMultiDisplay= */ true, mUserHandleHelper); in setUpServiceWithProfileSupportEnabled()
409 doReturn(profileUsers).when(mUserHandleHelper).getEnabledProfiles(CURRENT_USER); in setUpServiceWithProfileSupportEnabled()
/packages/services/Car/service/src/com/android/car/
DCarOccupantZoneService.java264 private final UserHandleHelper mUserHandleHelper; field in CarOccupantZoneService
286 mUserHandleHelper = userHandleHelper; in CarOccupantZoneService()
1581 List<UserHandle> profileUsers = mUserHandleHelper.getEnabledProfiles(userId); in updateEnabledProfilesLocked()
DCarMediaService.java363 private final UserHandleHelper mUserHandleHelper; field in CarMediaService
416 mUserHandleHelper = userHandleHelper; in CarMediaService()
605 return mUserHandleHelper.isEphemeralUser(userHandle); in isUserEphemeral()