Home
last modified time | relevance | path

Searched refs:users (Results 1 – 25 of 197) sorted by relevance

12345678

/cts/common/device-side/bedstead/modules/multiuser/src/test/kotlin/com/android/bedstead/multiuser/
DUsersTest.kt36 import com.android.bedstead.nene.users.UserReference in <lambda>()
37 import com.android.bedstead.nene.users.UserType in <lambda>()
51 .users() in <lambda>()
54 .users() in <lambda>()
57 .users() in <lambda>()
65 .users() in <lambda>()
82 .users() in <lambda>()
98 .users() in <lambda>()
114 assertThat(TestApis.users().supportedType(INVALID_TYPE_NAME)).isNull() in <lambda>()
120 val user = TestApis.users().createUser().create() in <lambda>()
[all …]
DUserReferenceTest.java54 import com.android.bedstead.nene.users.UserReference;
89 assertThat(TestApis.users().find(USER_ID).id()).isEqualTo(USER_ID); in id_returnsId()
94 assertThat(TestApis.users().find(USER_ID).userHandle().getIdentifier()).isEqualTo(USER_ID); in userHandle_referencesId()
99 assertThat(TestApis.users().find(NON_EXISTING_USER_ID).exists()).isFalse(); in exists_doesNotExist_returnsFalse()
115 assertThat(TestApis.users().all()).doesNotContain(user); in remove_userExists_removesUser()
129 () -> TestApis.users().find(NON_EXISTING_USER_ID).start()); in start_userDoesNotExist_throwsException()
204 TestApis.users().find(NON_EXISTING_USER_ID).stop(); in stop_userDoesNotExist_doesNothing()
234 assertThat(TestApis.users().current()).isEqualTo(sDeviceState.secondaryUser()); in switchTo_userIsSwitched()
242 assertThat(TestApis.users().current()).isEqualTo(sDeviceState.workProfile().parent()); in switchTo_profile_switchesToParent()
256 UserReference user = TestApis.users().instrumented(); in serialNo_returnsSerialNo()
[all …]
DMultiUserAnnotationExecutorTest.kt25 import com.android.bedstead.nene.TestApis.users in <lambda>()
38 users().createUser().create().use { _ -> in <lambda>()
39 users().createUser().create().use { _ -> } in <lambda>()
62 Truth.assertThat(users().main()).isNotNull() in <lambda>()
/cts/common/device-side/bedstead/harrier/src/test/java/com/android/bedstead/harrier/
DDeviceStateClassAnnotationTest.java19 import static com.android.bedstead.nene.users.UserType.MANAGED_PROFILE_TYPE_NAME;
20 import static com.android.bedstead.nene.users.UserType.SECONDARY_USER_TYPE_NAME;
71 TestApis.users() in beforeClass()
73 TestApis.users().supportedType(MANAGED_PROFILE_TYPE_NAME), in beforeClass()
74 TestApis.users().initial())) in beforeClass()
103 assertThat(TestApis.users().findProfileOfType( in ensureHasWorkProfileAnnotationOnClass_workProfileExists()
104 TestApis.users().supportedType(MANAGED_PROFILE_TYPE_NAME), in ensureHasWorkProfileAnnotationOnClass_workProfileExists()
105 TestApis.users().instrumented()) in ensureHasWorkProfileAnnotationOnClass_workProfileExists()
112 assertThat(TestApis.users().findProfileOfType( in ensureHasNoWorkProfileAnnotation_overridesClassAnnotation()
113 TestApis.users().supportedType(MANAGED_PROFILE_TYPE_NAME), in ensureHasNoWorkProfileAnnotation_overridesClassAnnotation()
[all …]
DDeviceStateTest.java31 import static com.android.bedstead.nene.users.UserType.MANAGED_PROFILE_TYPE_NAME;
32 import static com.android.bedstead.nene.users.UserType.SECONDARY_USER_TYPE_NAME;
33 import static com.android.bedstead.nene.users.UserType.SYSTEM_USER_TYPE_NAME;
139 import com.android.bedstead.nene.users.UserReference;
182 assertThat(sDeviceState.workProfile()).isEqualTo(TestApis.users().instrumented()); in workProfile_runningOnWorkProfile_returnsCurrentProfile()
194 assertThat(sDeviceState.tvProfile()).isEqualTo(TestApis.users().instrumented()); in tvProfile_runningOnTvProfile_returnsCurrentProfile()
207 try (UserReference tvProfile = TestApis.users().createUser() in tvProfile_createdTvProfile_throwsException()
208 .parent(TestApis.users().instrumented()) in tvProfile_createdTvProfile_throwsException()
209 .type(TestApis.users().supportedType(TV_PROFILE_TYPE_NAME)) in tvProfile_createdTvProfile_throwsException()
218 assertThat(TestApis.users().findProfileOfType( in ensureHasTvProfileAnnotation_tvProfileExists()
[all …]
DDeviceStateClassAnnotationWithoutBedsteadJunit4Test.java19 import static com.android.bedstead.nene.users.UserType.SECONDARY_USER_TYPE_NAME;
42 assertThat(TestApis.users().findUserOfType( in ensureHasSecondaryUserAnnotationOnClass_secondaryUserExists()
43 TestApis.users().supportedType(SECONDARY_USER_TYPE_NAME)) in ensureHasSecondaryUserAnnotationOnClass_secondaryUserExists()
/cts/common/device-side/bedstead/modules/multiuser/src/main/kotlin/com/android/bedstead/multiuser/
DUsersComponent.kt28 import com.android.bedstead.nene.TestApis.users in <lambda>()
32 import com.android.bedstead.nene.users.UserBuilder in <lambda>()
33 import com.android.bedstead.nene.users.UserReference in <lambda>()
34 import com.android.bedstead.nene.users.UserType in <lambda>()
69 users().createUser() in <lambda>()
82 val currentUser = users().current() in <lambda>()
89 val users = users().all().sortedBy { it.id() } in <lambda>() constant
90 for (otherUser in users) { in <lambda>()
116 val currentUser = users().current() in <lambda>()
155 val user = users() in <lambda>()
[all …]
DAnnotationLogicExtensions.kt37 import com.android.bedstead.nene.TestApis.users
41 fun RequireHasMainUser.logic() = assumeTrue(reason, users().main() != null) in RequireHasMainUser()
45 users().supportsMultipleUsers(), in RequireHasMainUser()
53 users().instrumented() == users().main(), in logic()
61 users().canAddPrivateProfile(), in logic()
67 assumeFalse(reason, users().isHeadlessSystemUserMode()) in logic()
71 assumeTrue(reason, users().isHeadlessSystemUserMode()) in RequireHeadlessSystemUserMode()
75 if (!users().isVisibleBackgroundUsersSupported()) { in RequireVisibleBackgroundUsers()
85 if (users().isVisibleBackgroundUsersSupported()) { in RequireNotVisibleBackgroundUsers()
93 if (!users().isVisibleBackgroundUsersOnDefaultDisplaySupported()) { in RequireVisibleBackgroundUsersOnDefaultDisplay()
[all …]
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DListForegroundAffiliatedUsersTest.java33 List<UserHandle> users = mDevicePolicyManager.listForegroundAffiliatedUsers(); in testListForegroundAffiliatedUsers_onlyForegroundUser() local
36 Log.d(TAG, "currentUser: " + currentUser + " users: " + users); in testListForegroundAffiliatedUsers_onlyForegroundUser()
38 assertWithMessage("foreground users").that(users).containsExactly(currentUser); in testListForegroundAffiliatedUsers_onlyForegroundUser()
42 List<UserHandle> users = mDevicePolicyManager.listForegroundAffiliatedUsers(); in testListForegroundAffiliatedUsers_empty() local
43 Log.d(TAG, "users: " + users); in testListForegroundAffiliatedUsers_empty()
45 assertWithMessage("foreground users").that(users).isEmpty(); in testListForegroundAffiliatedUsers_empty()
/cts/common/device-side/bedstead/remotedpc/src/test/java/com/android/bedstead/remotedpc/
DRemoteDpcTest.java46 import com.android.bedstead.nene.users.UserReference;
47 import com.android.bedstead.nene.users.UserType;
71 private static final UserReference sUser = TestApis.users().instrumented();
73 TestApis.users().find(99999);
80 sNonRemoteDpcTestApp.install(TestApis.users().system()); in setupClass()
151 UserReference profile = TestApis.users().createUser() in profileOwner_userHandle_noProfileOwner_returnsNull()
153 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in profileOwner_userHandle_noProfileOwner_returnsNull()
168 UserReference profile = TestApis.users().createUser() in profileOwner_userHandle_nonRemoteDpcProfileOwner_returnsNull()
170 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in profileOwner_userHandle_nonRemoteDpcProfileOwner_returnsNull()
188 UserReference profile = TestApis.users().createUser() in profileOwner_userHandle_remoteDpcProfileOwner_returnsInstance()
[all …]
/cts/common/device-side/bedstead/modules/enterprise/src/test/kotlin/com/android/bedstead/enterprise/
DEnterpriseAnnotationExecutorTest.kt55 import com.android.bedstead.nene.TestApis.users
59 import com.android.bedstead.nene.users.UserReference
60 import com.android.bedstead.nene.users.UserType.MANAGED_PROFILE_TYPE_NAME
256 assertThat(devicePolicy().getProfileOwner(users().instrumented())).isNotNull() in ensureHasProfileOwnerAnnotation_defaultUser_profileOwnerIsSet()
262 assertThat(devicePolicy().getProfileOwner(users().instrumented())).isNull() in ensureHasNoProfileOwnerAnnotation_defaultUser_profileOwnerIsNotSet()
289 assertThat(devicePolicy().getProfileOwner(users().instrumented())).isNotNull() in profileOwner_defaultUser_profileOwnerIsSet_returnsProfileOwner()
336 assertThat(users().instrumented()).isEqualTo(sDeviceState.dpc().user()) in includeRunOnBackgroundDeviceOwnerUserAnnotation_isRunningOnDeviceOwnerUser()
342 assertThat(users().current()).isNotEqualTo(users().instrumented()) in includeRunOnBackgroundDeviceOwnerUserAnnotation_isNotCurrentUser()
348 assertThat(users().instrumented().type().name()).isEqualTo(CLONE_PROFILE_TYPE_NAME) in includeRunOnCloneProfileAlongsideProfileOwnerUsingParentInstance_runsOnCloneProfile()
358 assertThat(users().instrumented().type().name()).isEqualTo(CLONE_PROFILE_TYPE_NAME) in includeRunOnCloneProfileAlongsideOrgOwnedProfileOwnerUsingParentInstance_runsOnCloneProfile()
[all …]
/cts/common/device-side/interactive/steps/src/main/java/com/android/interactive/steps/enterprise/settings/
DAccountsRemoveWorkProfileStep.java19 import static com.android.bedstead.nene.users.UserType.MANAGED_PROFILE_TYPE_NAME;
31 TestApis.users().findProfileOfType( in AccountsRemoveWorkProfileStep()
32 TestApis.users().supportedType( in AccountsRemoveWorkProfileStep()
34 TestApis.users().instrumented()) == null); in AccountsRemoveWorkProfileStep()
DDeviceAdminAppsRemoveWorkProfileStep.java19 import static com.android.bedstead.nene.users.UserType.MANAGED_PROFILE_TYPE_NAME;
28 TestApis.users().findProfileOfType( in DeviceAdminAppsRemoveWorkProfileStep()
29 TestApis.users().supportedType( in DeviceAdminAppsRemoveWorkProfileStep()
31 TestApis.users().instrumented()) == null); in DeviceAdminAppsRemoveWorkProfileStep()
/cts/tests/tests/multiuser/src/android/multiuser/cts/
DUserVisibilityVisibleBackgroundUsersTestCase.java41 import com.android.bedstead.nene.users.UserReference;
42 import com.android.bedstead.nene.users.UserType;
99 .containsAtLeast(TestApis.users().current().userHandle(), in testGetVisibleUsers_backgroundUserOnSecondaryDisplay()
116 .containsAtLeast(TestApis.users().current().userHandle(), user.userHandle()); in testGetVisibleUsers_stoppedProfileOfBackgroundUserOnSecondaryDisplay()
143 try (UserReference parent = TestApis.users().createUser().name("parent_user").create()) { in testStartVisibleBgUser_onSecondaryDisplay_profileOnSameDisplay()
145 try (UserReference profile = TestApis.users().createUser() in testStartVisibleBgUser_onSecondaryDisplay_profileOnSameDisplay()
148 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in testStartVisibleBgUser_onSecondaryDisplay_profileOnSameDisplay()
178 try (UserReference parent = TestApis.users().createUser().name("parent_user").create()) { in testStartVisibleBgUser_onSecondaryDisplay_profileOnDefaultDisplay()
180 try (UserReference profile = TestApis.users().createUser() in testStartVisibleBgUser_onSecondaryDisplay_profileOnDefaultDisplay()
183 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in testStartVisibleBgUser_onSecondaryDisplay_profileOnDefaultDisplay()
[all …]
DUserVisibilityVisibleBackgroundUsersTest.java21 import static com.android.bedstead.nene.TestApis.users;
23 import static com.android.bedstead.nene.users.UserType.SECONDARY_USER_TYPE_NAME;
34 import com.android.bedstead.nene.users.UserReference;
65 UserReference user = users() in testStartVisibleBgUser_onDefaultDisplay()
66 .findUserOfType(users().supportedType(SECONDARY_USER_TYPE_NAME)); in testStartVisibleBgUser_onDefaultDisplay()
/cts/hostsidetests/car/nonrecoverable/src/android/car/cts/
DCarServiceHelperServiceTest.java63 List<Integer> users = getAllPersistentUsers(); in removeAllUsersExceptSystem() local
64 for (int i = 0; i < users.size(); i++) { in removeAllUsersExceptSystem()
65 int userId = users.get(i); in removeAllUsersExceptSystem()
72 users = getAllPersistentUsers(); in removeAllUsersExceptSystem()
73 assertWithMessage("Users").that(users).containsExactly(SYSTEM_USER_ID); in removeAllUsersExceptSystem()
/cts/common/device-side/bedstead/modules/enterprise/src/main/kotlin/com/android/bedstead/enterprise/
DDeviceOwnerComponent.kt29 import com.android.bedstead.nene.TestApis.users
34 import com.android.bedstead.nene.users.UserReference
107 users().isHeadlessSystemUserMode()) { in ensureHasDeviceOwner()
114 users().main() in ensureHasDeviceOwner()
116 users().system() in ensureHasDeviceOwner()
133 val instrumentedUser = users().instrumented() in ensureHasDeviceOwner()
143 for (u: UserReference in users().all()) { in ensureHasDeviceOwner()
207 users().isHeadlessSystemUserMode())) { in ensureHasDeviceOwner()
211 users().initial(), in ensureHasDeviceOwner()
227 var allowedNonTestUsers = if (users().isHeadlessSystemUserMode()) 1 else 0 in removeAllNonTestUsers()
[all …]
/cts/common/device-side/bedstead/nene/src/main/java/com/android/bedstead/nene/devicepolicy/
DDevicePolicy.kt39 import com.android.bedstead.nene.users.UserReference in <lambda>()
118 for (user in TestApis.users().all()) { in <lambda>()
138 fun getProfileOwner(user: UserReference = TestApis.users().instrumented()): ProfileOwner? { in <lambda>()
150 user: UserReference = TestApis.users().system() in <lambda>()
252 fun clearOrganizationId(user: UserReference = TestApis.users().instrumented()) { in <lambda>()
294 if (user == TestApis.users().instrumented()) { in <lambda>()
302 val user = TestApis.users().system() in <lambda>()
354 val user = TestApis.users().system() in <lambda>()
534 user: UserReference = TestApis.users().instrumented() in <lambda>()
538 if (TestApis.users().all().size > 1) { in <lambda>()
[all …]
/cts/common/device-side/bedstead/remotedpc/src/main/java/com/android/bedstead/remotedpc/
DRemoteDpc.java22 import static com.android.bedstead.nene.users.UserType.MANAGED_PROFILE_TYPE_NAME;
41 import com.android.bedstead.nene.users.UserReference;
86 return profileOwner(TestApis.users().instrumented()); in profileOwner()
100 return profileOwner(TestApis.users().find(profile)); in profileOwner()
133 return any(TestApis.users().instrumented()); in any()
148 return any(TestApis.users().find(user)); in any()
198 return setAsDeviceOwner(dpcQuery, TestApis.users().system()); in setAsDeviceOwner()
232 return setAsProfileOwner(TestApis.users().instrumented()); in setAsProfileOwner()
239 return setAsProfileOwner(TestApis.users().instrumented(), dpcQuery); in setAsProfileOwner()
252 return setAsProfileOwner(TestApis.users().find(user), anyRemoteDpcQuery); in setAsProfileOwner()
[all …]
/cts/tests/devicepolicy/src/android/devicepolicy/cts/
DProvisioningTest.kt66 import com.android.bedstead.nene.users.UserReference in <lambda>()
67 import com.android.bedstead.nene.users.UserType in <lambda>()
121 TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME) in <lambda>()
353 val setupComplete = TestApis.users().system().setupComplete in <lambda>()
354 TestApis.users().system().setupComplete = false in <lambda>()
363 TestApis.users().system().setupComplete = setupComplete in <lambda>()
374 val systemSetupComplete = TestApis.users().system().setupComplete in <lambda>()
375 TestApis.users().system().setupComplete = false in <lambda>()
385 TestApis.users().system().setupComplete = systemSetupComplete in <lambda>()
424 val mainUserSetupComplete = TestApis.users().main()?.setupComplete ?: false in <lambda>()
[all …]
DBackupTest.java52 import com.android.bedstead.nene.users.UserReference;
94 TestApis.users().instrumented().type() in setBackupServiceEnabled_true_setsBackupServiceEnabled()
108 .isBackupServiceActive(TestApis.users().instrumented().userHandle())).isTrue(); in setBackupServiceEnabled_true_setsBackupServiceEnabled()
131 .isBackupServiceActive(TestApis.users().instrumented().userHandle())).isFalse(); in setBackupServiceEnabled_false_setsBackupServiceNotEnabled()
148 .isBackupServiceActive(TestApis.users().instrumented().userHandle())).isFalse(); in setBackupServiceEnabled_doesNotApply_doesNotSetBackupServiceEnabled()
257 TestApis.users().all().stream().filter(u -> (u != TestApis.users().instrumented() in ensureNoAdditionalUsers()
258 && u != TestApis.users().system() in ensureNoAdditionalUsers()
259 && u != TestApis.users().current() // We can't remove the profile of in ensureNoAdditionalUsers()
268 + TestApis.users().instrumented() + ", current user is " in ensureNoAdditionalUsers()
269 + TestApis.users().current() + ", system user is " in ensureNoAdditionalUsers()
[all …]
DBugReportTest.kt37 import com.android.bedstead.nene.users.UserReference in <lambda>()
133 TestApis.users().all().stream() in <lambda>()
135 (u != TestApis.users().instrumented() in <lambda>()
137 && u != TestApis.users().current() in <lambda>()
138 && u != TestApis.users().initial() in <lambda>()
139 && u != TestApis.users().system()) in <lambda>()
237 TestApis.users().all().stream() in <lambda>()
239 (u != TestApis.users().instrumented() in <lambda>()
240 && u != TestApis.users().current() in <lambda>()
241 && u != TestApis.users().initial() in <lambda>()
[all …]
/cts/common/device-side/bedstead/nene/src/test/java/com/android/bedstead/nene/devicepolicy/
DDevicePolicyTest.java44 import com.android.bedstead.nene.users.UserReference;
45 import com.android.bedstead.nene.users.UserType;
73 private static final UserReference sUser = TestApis.users().instrumented();
74 private static final UserReference NON_EXISTENT_USER = TestApis.users().find(99999);
87 if (!sUser.equals(TestApis.users().system())) { in setupClass()
89 sTestApp.install(TestApis.users().system()); in setupClass()
102 UserReference profile = TestApis.users().createUser() in setProfileOwner_profileOwnerIsSet()
104 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in setProfileOwner_profileOwnerIsSet()
123 UserReference profile = TestApis.users().createUser() in setProfileOwner_profileOwnerIsAlreadySet_throwsException()
125 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in setProfileOwner_profileOwnerIsAlreadySet_throwsException()
[all …]
/cts/common/device-side/bedstead/deviceadminapp/src/test/java/com/android/bedstead/deviceadminapp/
DDeviceAdminAppTest.java30 import com.android.bedstead.nene.users.UserReference;
31 import com.android.bedstead.nene.users.UserType;
75 try (UserReference profile = TestApis.users().createUser() in setAsProfileOwner_isEnabled()
76 .parent(TestApis.users().instrumented()) in setAsProfileOwner_isEnabled()
77 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in setAsProfileOwner_isEnabled()
/cts/common/device-side/bedstead/nene/src/main/java/com/android/bedstead/nene/users/
DUserReference.java17 package com.android.bedstead.nene.users;
33 import static com.android.bedstead.nene.users.Users.users;
107 return TestApis.users().find(userHandle.getIdentifier()); in of()
191 if (TestApis.users().instrumented().equals(this)) { in remove()
283 if (!TestApis.users().isVisibleBackgroundUsersSupported()) { in startVisibleOnDisplay()
382 if (TestApis.users().current().equals(this)) { in switchTo()
410 Poll.forValue("current user", () -> TestApis.users().current()) in switchTo()
414 if (!TestApis.users().current().equals(this)) { in switchTo()
416 + " (current user is " + TestApis.users().current() + "). Relevant logcat: " in switchTo()
493 UserReference currentUser = TestApis.users().current(); in isVisible()
[all …]

12345678