/packages/services/Car/tests/carservice_unit_test/src/com/android/car/user/ |
D | MockedUserHandleBuilder.java | 26 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 …]
|
D | UserHandleHelperUnitTest.java | 49 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/ |
D | UserHalHelperTest.java | 96 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/ |
D | ExperimentalCarUserService.java | 92 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 …]
|
D | InitialUserSetter.java | 137 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 …]
|
D | CarUserService.java | 340 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/ |
D | FixedActivityServiceTest.java | 98 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/ |
D | FixedActivityService.java | 269 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/ |
D | CarMediaServiceTest.java | 129 @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/ |
D | CarOccupantZoneServiceTest.java | 97 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/ |
D | CarOccupantZoneService.java | 264 private final UserHandleHelper mUserHandleHelper; field in CarOccupantZoneService 286 mUserHandleHelper = userHandleHelper; in CarOccupantZoneService() 1581 List<UserHandle> profileUsers = mUserHandleHelper.getEnabledProfiles(userId); in updateEnabledProfilesLocked()
|
D | CarMediaService.java | 363 private final UserHandleHelper mUserHandleHelper; field in CarMediaService 416 mUserHandleHelper = userHandleHelper; in CarMediaService() 605 return mUserHandleHelper.isEphemeralUser(userHandle); in isUserEphemeral()
|