Home
last modified time | relevance | path

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

1234

/cts/common/device-side/bedstead/nene/src/test/java/com/android/bedstead/nene/users/
DUsersTest.java17 package com.android.bedstead.nene.users;
26 import static com.android.bedstead.nene.users.UserType.MANAGED_PROFILE_TYPE_NAME;
27 import static com.android.bedstead.nene.users.UserType.SECONDARY_USER_TYPE_NAME;
28 import static com.android.bedstead.nene.users.UserType.SYSTEM_USER_TYPE_NAME;
72 TestApis.users().supportedType(SECONDARY_USER_TYPE_NAME);
74 TestApis.users().supportedType(MANAGED_PROFILE_TYPE_NAME);
75 private final UserReference mInstrumentedUser = TestApis.users().instrumented();
87 TestApis.users().supportedTypes().stream().filter( in supportedTypes_containsManagedProfile()
100 TestApis.users().supportedTypes().stream().filter( in supportedTypes_containsSystemUser()
113 TestApis.users().supportedType(MANAGED_PROFILE_TYPE_NAME); in supportedType_validType_returnsType()
[all …]
DUserReferenceTest.java17 package com.android.bedstead.nene.users;
66 assertThat(TestApis.users().find(USER_ID).id()).isEqualTo(USER_ID); in id_returnsId()
71 assertThat(TestApis.users().find(USER_ID).userHandle().getIdentifier()).isEqualTo(USER_ID); in userHandle_referencesId()
76 assertThat(TestApis.users().find(NON_EXISTING_USER_ID).exists()).isFalse(); in exists_doesNotExist_returnsFalse()
87 assertThrows(NeneException.class, () -> TestApis.users().find(USER_ID).remove()); in remove_userDoesNotExist_throwsException()
92 UserReference user = TestApis.users().createUser().create(); in remove_userExists_removesUser()
96 assertThat(TestApis.users().all()).doesNotContain(user); in remove_userExists_removesUser()
102 () -> TestApis.users().find(NON_EXISTING_USER_ID).start()); in start_userDoesNotExist_throwsException()
107 UserReference user = TestApis.users().createUser().create().stop(); in start_userNotStarted_userIsUnlocked()
130 TestApis.users().find(NON_EXISTING_USER_ID).stop(); in stop_userDoesNotExist_doesNothing()
[all …]
/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;
66 assertThat(TestApis.users().findProfileOfType( in beforeClass()
67 TestApis.users().supportedType(MANAGED_PROFILE_TYPE_NAME), in beforeClass()
68 TestApis.users().instrumented()) in beforeClass()
70 assertThat(TestApis.users().findUserOfType( in beforeClass()
71 TestApis.users().supportedType(SECONDARY_USER_TYPE_NAME)) in beforeClass()
98 assertThat(TestApis.users().findProfileOfType( in ensureHasWorkProfileAnnotationOnClass_workProfileExists()
99 TestApis.users().supportedType(MANAGED_PROFILE_TYPE_NAME), in ensureHasWorkProfileAnnotationOnClass_workProfileExists()
100 TestApis.users().instrumented()) in ensureHasWorkProfileAnnotationOnClass_workProfileExists()
[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/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.java45 import com.android.bedstead.nene.users.UserReference;
46 import com.android.bedstead.nene.users.UserType;
68 private static final UserReference sUser = TestApis.users().instrumented();
70 TestApis.users().find(99999);
82 sNonRemoteDpcTestApp.install(TestApis.users().system()); in setupClass()
153 UserReference profile = TestApis.users().createUser() in profileOwner_userHandle_noProfileOwner_returnsNull()
155 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in profileOwner_userHandle_noProfileOwner_returnsNull()
170 UserReference profile = TestApis.users().createUser() in profileOwner_userHandle_nonRemoteDpcProfileOwner_returnsNull()
172 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in profileOwner_userHandle_nonRemoteDpcProfileOwner_returnsNull()
190 UserReference profile = TestApis.users().createUser() in profileOwner_userHandle_remoteDpcProfileOwner_returnsInstance()
[all …]
/cts/common/device-side/bedstead/nene/src/test/java/com/android/bedstead/nene/devicepolicy/
DDevicePolicyTest.java39 import com.android.bedstead.nene.users.UserReference;
40 import com.android.bedstead.nene.users.UserType;
70 private static final UserReference sUser = TestApis.users().instrumented();
71 private static final UserReference NON_EXISTENT_USER = TestApis.users().find(99999);
82 if (!sUser.equals(TestApis.users().system())) { in setupClass()
84 sTestApp.install(TestApis.users().system()); in setupClass()
97 UserReference profile = TestApis.users().createUser() in setProfileOwner_profileOwnerIsSet()
99 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in setProfileOwner_profileOwnerIsSet()
117 UserReference profile = TestApis.users().createUser() in setProfileOwner_profileOwnerIsAlreadySet_throwsException()
119 .type(TestApis.users().supportedType(UserType.MANAGED_PROFILE_TYPE_NAME)) in setProfileOwner_profileOwnerIsAlreadySet_throwsException()
[all …]
/cts/common/device-side/bedstead/nene/src/test/java/com/android/bedstead/nene/
DTestApisTest.java30 Truth.assertThat(TestApis.users()).isNotNull(); in users_returnsInstance()
35 Truth.assertThat(TestApis.users()).isEqualTo(TestApis.users()); in users_multipleCalls_returnsSameInstance()
/cts/common/device-side/bedstead/harrier/src/main/java/com/android/bedstead/harrier/
DDeviceState.java24 import static com.android.bedstead.nene.users.UserType.MANAGED_PROFILE_TYPE_NAME;
25 import static com.android.bedstead.nene.users.UserType.SECONDARY_USER_TYPE_NAME;
85 import com.android.bedstead.nene.users.UserBuilder;
86 import com.android.bedstead.nene.users.UserReference;
634 TestApis.users().setStopBgUsersOnSwitch(STOP_USER_ON_SWITCH_FALSE);
671 TestApis.users().setStopBgUsersOnSwitch(STOP_USER_ON_SWITCH_DEFAULT);
742 UserReference instrumentedUser = TestApis.users().instrumented();
756 UserReference instrumentedUser = TestApis.users().instrumented();
851 private com.android.bedstead.nene.users.UserType requireUserSupported(
853 com.android.bedstead.nene.users.UserType resolvedUserType =
[all …]
/cts/hostsidetests/appsecurity/src/android/appsecurity/cts/
DResumeOnRebootHostTest.java101 int[] users = Utils.prepareSingleUser(getDevice()); in resumeOnReboot_SingleUser_Success() local
102 int initialUser = users[0]; in resumeOnReboot_SingleUser_Success()
141 int[] users = Utils.prepareSingleUser(getDevice()); in resumeOnReboot_ManagedProfile_Success() local
142 int initialUser = users[0]; in resumeOnReboot_ManagedProfile_Success()
187 int[] users = Utils.prepareMultipleUsers(getDevice(), 2); in resumeOnReboot_TwoUsers_SingleUserUnlock_Success() local
188 int initialUser = users[0]; in resumeOnReboot_TwoUsers_SingleUserUnlock_Success()
189 int secondaryUser = users[1]; in resumeOnReboot_TwoUsers_SingleUserUnlock_Success()
244 int[] users = Utils.prepareMultipleUsers(getDevice(), 2); in resumeOnReboot_TwoUsers_BothUserUnlock_Success() local
245 int initialUser = users[0]; in resumeOnReboot_TwoUsers_BothUserUnlock_Success()
246 int secondaryUser = users[1]; in resumeOnReboot_TwoUsers_BothUserUnlock_Success()
[all …]
DUtils.java169 int[] users = new int[] { primary }; in getAllUsers() local
172 users = Arrays.copyOf(users, users.length + 1); in getAllUsers()
173 users[users.length - 1] = user; in getAllUsers()
176 return users; in getAllUsers()
/cts/common/device-side/bedstead/testapp/src/library/main/java/com/android/bedstead/testapp/
DTestApp.java30 import com.android.bedstead.nene.users.UserReference;
31 import com.android.bedstead.nene.users.Users;
71 return install(TestApis.users().instrumented()); in install()
91 install(TestApis.users().find(user)); in install()
101 uninstall(TestApis.users().instrumented()); in uninstall()
122 uninstall(TestApis.users().find(user)); in uninstall()
131 return instance(TestApis.users().find(user)); in instance()
/cts/common/device-side/bedstead/deviceadminapp/src/test/java/com/android/bedstead/deviceadminapp/
DDeviceAdminAppTest.java28 import com.android.bedstead.nene.users.UserReference;
29 import com.android.bedstead.nene.users.UserType;
72 try (UserReference profile = TestApis.users().createUser() in setAsProfileOwner_isEnabled()
73 .parent(TestApis.users().instrumented()) in setAsProfileOwner_isEnabled()
74 .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/
DUsers.java17 package com.android.bedstead.nene.users;
27 import static com.android.bedstead.nene.users.UserType.MANAGED_PROFILE_TYPE_NAME;
28 import static com.android.bedstead.nene.users.UserType.SECONDARY_USER_TYPE_NAME;
29 import static com.android.bedstead.nene.users.UserType.SYSTEM_USER_TYPE_NAME;
91 return users().map( in all()
114 List<UserReference> users = new ArrayList<>(all()); in initial() local
115 users.sort(Comparator.comparingInt(UserReference::id)); in initial()
117 for (UserReference user : users) { in initial()
203 Set<UserReference> users = findUsersOfType(userType); in findUserOfType() local
205 if (users.isEmpty()) { in findUserOfType()
[all …]
DUserReference.java17 package com.android.bedstead.nene.users;
25 import static com.android.bedstead.nene.users.Users.users;
187 if (TestApis.users().current().equals(this)) { in switchTo()
311 mUserType = TestApis.users().supportedType(userTypeName); in type()
354 mParent = TestApis.users().find(parentHandle); in parent()
369 return TestApis.users().all().stream().anyMatch(u -> u.equals(this)); in exists()
371 return users().anyMatch(ui -> ui.id == id()); in exists()
397 return TestApis.users().fetchUser(mId); in adbUserOrNull()
409 return users().filter(ui -> ui.id == id()).findFirst() in userInfo()
DAdbUserParser26.java17 package com.android.bedstead.nene.users;
104 Map<Integer, AdbUser> users = new HashMap<>(); in parseUsers() local
107 users.put(user.id(), user); in parseUsers()
109 return users; in parseUsers()
DUserBuilder.java17 package com.android.bedstead.nene.users;
19 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;
21 import static com.android.bedstead.nene.users.Users.SYSTEM_USER_ID;
/cts/common/device-side/bedstead/remotedpc/src/main/java/com/android/bedstead/remotedpc/
DRemoteDpc.java32 import com.android.bedstead.nene.users.UserReference;
72 return profileOwner(TestApis.users().instrumented()); in profileOwner()
86 return profileOwner(TestApis.users().find(profile)); in profileOwner()
116 return any(TestApis.users().instrumented()); in any()
131 return any(TestApis.users().find(user)); in any()
176 ensureInstalled(TestApis.users().system()); in setAsDeviceOwner()
189 return setAsProfileOwner(TestApis.users().find(user)); in setAsProfileOwner()
203 if (!user.equals(TestApis.users().instrumented())) { in setAsProfileOwner()
/cts/common/device-side/bedstead/nene/src/main/java/com/android/bedstead/nene/packages/
DPackage.java57 import com.android.bedstead.nene.users.UserReference;
202 } else if (user.equals(TestApis.users().instrumented())) { in uninstall()
279 return enable(TestApis.users().instrumented()); in enable()
303 return disable(TestApis.users().instrumented()); in disable()
348 return grantPermission(TestApis.users().instrumented(), permission); in grantPermission()
353 return denyPermission(TestApis.users().instrumented(), permission); in denyPermission()
369 && user.equals(TestApis.users().instrumented())) { in denyPermission()
441 TestApis.users().find(p.mUserId)))) in runningProcesses()
473 return runningProcess(TestApis.users().find(user)); in runningProcess()
480 return runningProcess(TestApis.users().instrumented()); in runningProcess()
[all …]
/cts/hostsidetests/classloaders/useslibrary/src/android/classloaders/cts/
DUtils.java150 int[] users = new int[] { primary }; in getAllUsers() local
153 users = Arrays.copyOf(users, users.length + 1); in getAllUsers()
154 users[users.length - 1] = user; in getAllUsers()
157 return users; in getAllUsers()
/cts/common/device-side/bedstead/nene/src/test/java/com/android/bedstead/nene/packages/
DPackagesTest.java34 import com.android.bedstead.nene.users.UserReference;
67 private final UserReference mUser = TestApis.users().instrumented();
74 private final UserReference mNonExistingUser = TestApis.users().find(99999);
131 try (UserReference otherUser = TestApis.users().createUser().create()) { in installedForUser_doesNotContainPackageNotInstalledForUser()
172 TestApis.packages().install(TestApis.users().instrumented(), TEST_APP_APK_FILE); in install_instrumentedUser_isInstalled()
177 pkg.uninstall(TestApis.users().instrumented()); in install_instrumentedUser_isInstalled()
184 TestApis.packages().install(TestApis.users().instrumented(), TEST_APP_BYTES); in install_byteArray_instrumentedUser_isInstalled()
189 pkg.uninstall(TestApis.users().instrumented()); in install_byteArray_instrumentedUser_isInstalled()
223 UserReference user = TestApis.users().createUser().createAndStart(); in install_byteArray_differentUser_isInstalled()
237 try (UserReference user = TestApis.users().createUser().create().stop()) { in install_userNotStarted_throwsException()
[all …]
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DPersonalAppsSuspensionTest.java87 final List<UserHandle> users = userManager.getUserProfiles(); in requestQuietModeEnabledForProfile() local
90 assertThat(users.size()).isEqualTo(2); in requestQuietModeEnabledForProfile()
92 users.get(0).equals(Process.myUserHandle()) ? users.get(1) : users.get(0); in requestQuietModeEnabledForProfile()
/cts/common/device-side/bedstead/nene/src/main/java/com/android/bedstead/nene/settings/
DGlobalSettings.java32 import com.android.bedstead.nene.users.UserReference;
67 if (user.equals(sTestApis.users().instrumented())) { in putInt()
109 if (user.equals(sTestApis.users().instrumented())) { in putString()
175 if (user.equals(sTestApis.users().instrumented())) { in getInt()
191 if (user.equals(sTestApis.users().instrumented())) { in getInt()
244 if (user.equals(sTestApis.users().instrumented())) { in getString()
285 if (user.equals(sTestApis.users().instrumented())) { in reset()
DSecureSettings.java32 import com.android.bedstead.nene.users.UserReference;
67 if (user.equals(sTestApis.users().instrumented())) { in putInt()
134 if (user.equals(sTestApis.users().instrumented())) { in getInt()
150 if (user.equals(sTestApis.users().instrumented())) { in getInt()
203 if (user.equals(sTestApis.users().instrumented())) { in reset()
/cts/common/device-side/bedstead/nene/src/main/java/com/android/bedstead/nene/devicepolicy/
DDevicePolicy.java44 import com.android.bedstead.nene.users.UserReference;
134 return getProfileOwner(TestApis.users().instrumented()); in getProfileOwner()
163 UserReference user = TestApis.users().system(); in setDeviceOwner()
193 setUserSetupComplete(TestApis.users().current(), currentUserSetupComplete); in setDeviceOwner()
292 UserReference user = TestApis.users().system(); in setDeviceOwnerPreS()
338 Collection<UserReference> users = TestApis.users().all(); in checkForTerminalDeviceOwnerFailures() local
340 if (users.size() > 1) { in checkForTerminalDeviceOwnerFailures()
342 + user + " as there are already additional users on the device: " + users); in checkForTerminalDeviceOwnerFailures()

1234