/cts/tests/tests/os/src/android/os/cts/ |
D | UserHandleTest.java | 24 import android.os.UserHandle; 34 assertSame(UserHandle.of(userId), UserHandle.of(userId)); in assertSameUserHandle() 41 assertSameUserHandle(UserHandle.USER_SYSTEM); in testOf() 42 assertSameUserHandle(UserHandle.USER_ALL); in testOf() 43 assertSameUserHandle(UserHandle.USER_NULL); in testOf() 46 assertEquals(userId, UserHandle.of(userId).getIdentifier()); in testOf() 55 p.writeParcelable(UserHandle.of(userId), 0); in assertParcel() 58 UserHandle read = p.readParcelable(UserHandleTest.class.getClassLoader()); in assertParcel() 75 UserHandle.getUid(UserHandle.USER_ALL, TEST_APP_ID), in testGetUid() 76 UserHandle.ALL.getUid(TEST_APP_ID)); in testGetUid() [all …]
|
/cts/hostsidetests/content/test-apps/ContextCrossProfileApps/ContextCrossProfileApp/src/com/android/cts/context/ |
D | ContextCrossProfileDeviceTest.java | 30 import android.os.UserHandle; 89 UserHandle otherProfileHandle = UserHandle.of(otherProfileId); in testBindServiceAsUser_differentUser_bindsServiceToCorrectUser() 109 UserHandle otherProfileHandle = UserHandle.of(otherProfileId); in testBindServiceAsUser_sameProfileGroup_samePackage_withAcrossUsersPermission_bindsService() 125 UserHandle otherProfileHandle = UserHandle.of(otherProfileId); in testBindServiceAsUser_sameProfileGroup_differentPackage_withAcrossUsersPermission_bindsService() 146 UserHandle otherProfileHandle = UserHandle.of(otherProfileId); in testBindServiceAsUser_sameProfileGroup_samePackage_withAcrossProfilesPermission_bindsService() 162 UserHandle otherProfileHandle = UserHandle.of(otherProfileId); in testBindServiceAsUser_sameProfileGroup_differentPackage_withAcrossProfilesPermission_throwsException() 188 UserHandle otherProfileHandle = UserHandle.of(otherProfileId); in testBindServiceAsUser_sameProfileGroup_samePackage_withAcrossProfilesAppOp_bindsService() 208 UserHandle otherProfileHandle = UserHandle.of(otherProfileId); in testBindServiceAsUser_sameProfileGroup_differentPackage_withAcrossProfilesAppOp_throwsException() 228 UserHandle otherUserHandle = UserHandle.of(otherUserId); in testBindServiceAsUser_differentProfileGroup_samePackage_withAcrossUsersPermission_bindsService() 244 UserHandle otherUserHandle = UserHandle.of(otherUserId); in testBindServiceAsUser_differentProfileGroup_differentPackage_withAcrossUsersPermission_throwsException() [all …]
|
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/ |
D | CreateAndManageUserTest.java | 38 import android.os.UserHandle; 78 UserHandle userHandle = createAndManageUser(); in testCreateAndManageUser() 108 UserHandle newUserHandle = createAndManageUser(); in testCreateAndManageUser_GetSecondaryUsers() 110 List<UserHandle> secondaryUsers = mDevicePolicyManager.getSecondaryUsers(getWho()); in testCreateAndManageUser_GetSecondaryUsers() 121 UserHandle userHandle = createAndManageUser(); in testCreateAndManageUser_SwitchUser() 123 List<UserHandle> usersOnBroadcasts = switchUserAndWaitForBroadcasts(userHandle); in testCreateAndManageUser_SwitchUser() 130 UserHandle userHandle = createAndManageUser(); in testCreateAndManageUser_CannotStopCurrentUser() 138 UserHandle userHandle = createAndManageUser(); in testCreateAndManageUser_StartInBackground() 140 List<UserHandle> usersOnBroadcasts = startUserInBackgroundAndWaitForBroadcasts(userHandle); in testCreateAndManageUser_StartInBackground() 146 UserHandle userHandle = createAndManageUser(); in testCreateAndManageUser_StartInBackground_MaxRunningUsers() [all …]
|
D | ListForegroundAffiliatedUsersTest.java | 22 import android.os.UserHandle; 33 List<UserHandle> users = mDevicePolicyManager.listForegroundAffiliatedUsers(); in testListForegroundAffiliatedUsers_onlyForegroundUser() 35 UserHandle currentUser = invokeStaticMethodWithShellPermissions(() -> getCurrentUser()); in testListForegroundAffiliatedUsers_onlyForegroundUser() 42 List<UserHandle> users = mDevicePolicyManager.listForegroundAffiliatedUsers(); in testListForegroundAffiliatedUsers_empty()
|
D | BasicAdminReceiver.java | 22 import android.os.UserHandle; 60 public void onUserAdded(Context context, Intent intent, UserHandle userHandle) { in onUserAdded() 65 public void onUserRemoved(Context context, Intent intent, UserHandle userHandle) { in onUserRemoved() 70 public void onUserStarted(Context context, Intent intent, UserHandle userHandle) { in onUserStarted() 75 public void onUserStopped(Context context, Intent intent, UserHandle userHandle) { in onUserStopped() 80 public void onUserSwitched(Context context, Intent intent, UserHandle userHandle) { in onUserSwitched() 107 private void sendUserBroadcast(Context context, String action, UserHandle userHandle) { in sendUserBroadcast()
|
/cts/hostsidetests/seccomp/app/src/android/seccomp/cts/app/ |
D | ZygotePreload.java | 21 import android.os.UserHandle; 98 for (int userId = UserHandle.myUserId(); userId <= UserHandle.myUserId() + 1; userId++) { in doPreload() 99 int appStart = UserHandle.getUid(userId, Process.FIRST_APPLICATION_UID); in doPreload() 101 int appEnd = UserHandle.getUid(userId, Process.LAST_APPLICATION_UID); in doPreload() 106 for (int userId = UserHandle.myUserId(); userId <= UserHandle.myUserId() + 1; userId++) { in doPreload() 107 int regularIsolatedStart = UserHandle.getUid(userId, Process.FIRST_ISOLATED_UID); in doPreload() 110 int regularIsolatedEnd = UserHandle.getUid(userId, Process.LAST_ISOLATED_UID); in doPreload() 119 int isolatedUserStart = UserHandle.getUid(UserHandle.myUserId(), in doPreload() 121 int isolatedUserEnd = UserHandle.getUid(UserHandle.myUserId(), in doPreload()
|
/cts/hostsidetests/packagemanager/installedloadingprogess/apps/src/com/android/tests/loadingprogress/registerapp/ |
D | MainActivity.java | 23 import android.os.UserHandle; 33 public void onPackageRemoved(String packageName, UserHandle user) { in onCreate() 37 public void onPackageAdded(String packageName, UserHandle user) { in onCreate() 41 public void onPackageChanged(String packageName, UserHandle user) { in onCreate() 45 public void onPackagesAvailable(String[] packageNames, UserHandle user, in onCreate() 50 public void onPackagesUnavailable(String[] packageNames, UserHandle user, in onCreate()
|
/cts/tests/tests/companion/core/src/android/companion/cts/core/ |
D | DeviceAssociatedForWifiConnectionTest.kt | 22 import android.os.UserHandle 48 targetPackageName, MAC_ADDRESS_A, UserHandle(targetUserId)) in test_isDeviceAssociatedForWifiConnection_requiresPermission() 58 targetPackageName, MAC_ADDRESS_A, UserHandle(targetUserId))) in test_isDeviceAssociatedForWifiConnection_no_association() 65 targetPackageName, MAC_ADDRESS_A, UserHandle(targetUserId))) in test_isDeviceAssociatedForWifiConnection_no_association() 76 targetPackageName, MAC_ADDRESS_A, UserHandle(targetUserId))) in test_isDeviceAssociatedForWifiConnection_no_wifi_permission()
|
/cts/common/device-side/bedstead/testapp/src/testapps/main/java/com/android/bedstead/testapp/ |
D | BaseTestAppDeviceAdminReceiver.java | 24 import android.os.UserHandle; 55 public void onPasswordChanged(Context context, Intent intent, UserHandle user) { in onPasswordChanged() 65 public void onPasswordFailed(Context context, Intent intent, UserHandle user) { in onPasswordFailed() 75 public void onPasswordSucceeded(Context context, Intent intent, UserHandle user) { in onPasswordSucceeded() 85 public void onPasswordExpiring(Context context, Intent intent, UserHandle user) { in onPasswordExpiring() 147 public void onUserAdded(Context context, Intent intent, UserHandle addedUser) { in onUserAdded() 152 public void onUserRemoved(Context context, Intent intent, UserHandle removedUser) { in onUserRemoved() 157 public void onUserStarted(Context context, Intent intent, UserHandle startedUser) { in onUserStarted() 162 public void onUserStopped(Context context, Intent intent, UserHandle stoppedUser) { in onUserStopped() 167 public void onUserSwitched(Context context, Intent intent, UserHandle switchedUser) { in onUserSwitched() [all …]
|
/cts/tests/framework/base/windowmanager/src/android/server/wm/window/ |
D | AddWindowAsUserTest.java | 25 import android.os.UserHandle; 39 testAddWindowWithUser(UserHandle.of(myUserId), false /* shouldCatchException */); in testAddWindowSecondaryUser() 43 testAddWindowWithUser(UserHandle.ALL, true); in testAddWindowSecondaryUser() 46 private void testAddWindowWithUser(UserHandle user, boolean shouldCatchException) { in testAddWindowWithUser() 68 private WindowManager getWindowManagerForUser(UserHandle user) { in getWindowManagerForUser()
|
/cts/hostsidetests/devicepolicy/app/LauncherTestsSupport/src/com/android/cts/launchertests/support/ |
D | LauncherCallbackTestsService.java | 31 import android.os.UserHandle; 64 private static BlockingQueue<Pair<String, UserHandle>> mPackagesAdded 66 private static BlockingQueue<Pair<String, UserHandle>> mPackagesRemoved 68 private static BlockingQueue<Pair<String, UserHandle>> mPackagesChanged 172 private boolean eventExists(Bundle params, BlockingQueue<Pair<String, UserHandle>> events) { in eventExists() 173 UserHandle user = params.getParcelable(USER_EXTRA); in eventExists() 177 Pair<String, UserHandle> event = events.poll(60, TimeUnit.SECONDS); in eventExists() 197 public void onPackageRemoved(String packageName, UserHandle user) { in onPackageRemoved() 206 public void onPackageAdded(String packageName, UserHandle user) { in onPackageAdded() 215 public void onPackageChanged(String packageName, UserHandle user) { in onPackageChanged() [all …]
|
/cts/tests/tests/car_builtin/src/android/car/cts/builtin/os/ |
D | UserManagerHelperHeavyTest.java | 30 import android.os.UserHandle; 64 private UserHandle mUserToRemove; 91 UserHandle guestUser = createGuestUser(); in testMultiplePropertiesForGuestUser() 117 UserHandle fullUser = createSecondaryUser(); in testMultiplePropertiesForSecondaryFullUser() 133 private void assertGetUserHandlesHasUser(UserHandle user) { in assertGetUserHandlesHasUser() 134 List<UserHandle> allUsersHandles = in assertGetUserHandlesHasUser() 139 private void waitForUserToInitialize(UserHandle preCreateUser) throws Exception { in waitForUserToInitialize() 150 private UserHandle createGuestUser() { in createGuestUser() 162 private UserHandle createSecondaryUser() { in createSecondaryUser() 174 private void assertPrecreatedUserExists(UserHandle user, String type) { in assertPrecreatedUserExists()
|
/cts/hostsidetests/shortcuts/deviceside/multiuser/src/android/content/pm/cts/shortcut/multiuser/ |
D | ShortcutManagerManagedUserTest.java | 27 import android.os.UserHandle; 37 final UserHandle userManaged = getOtherUser(); in test01_managedProfileNotStarted() 68 final UserHandle userCurrent = android.os.Process.myUserHandle(); in test04_getAndLaunch_primary() 69 final UserHandle userOther = getOtherUser(); in test04_getAndLaunch_primary() 103 final UserHandle userCurrent = android.os.Process.myUserHandle(); in test05_getAndLaunch_managed() 104 final UserHandle userOther = getOtherUser(); in test05_getAndLaunch_managed() 137 private UserHandle getOtherUser() { in getOtherUser() 138 for (UserHandle user : getContext().getSystemService(UserManager.class).getUserProfiles()) { in getOtherUser()
|
D | ShortcutManagerSecondaryUserTest.java | 28 import android.os.UserHandle; 39 final UserHandle user = android.os.Process.myUserHandle(); in testCreateAndStart() 78 final UserHandle user0 = getUser0Handle(); in testDifferentUserNotAccessible() 90 private static UserHandle getUser0Handle() throws Exception { in getUser0Handle() 91 Method of = UserHandle.class.getMethod("of", int.class); in getUser0Handle() 93 return (UserHandle) of.invoke(null, 0); in getUser0Handle()
|
/cts/common/device-side/bedstead/queryable/src/main/java/com/android/queryable/queries/ |
D | UserHandleQuery.java | 19 import android.os.UserHandle; 26 public interface UserHandleQuery<E extends Queryable> extends Query<UserHandle> { 34 E isEqualTo(UserHandle userHandle); in isEqualTo()
|
/cts/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/ |
D | BindDeviceAdminServiceGoodSetupTest.java | 35 import android.os.UserHandle; 63 private List<UserHandle> mTargetUsers; 86 for (UserHandle targetUser : mTargetUsers) { in testCannotBind_implicitIntent() 102 for (UserHandle targetUser : mTargetUsers) { in testCannotBind_notResolvableIntent() 113 for (UserHandle targetUser : mTargetUsers) { in testCannotBind_unprotectedCrossUserService() 130 for (UserHandle targetUser : mTargetUsers) { in testCheckCannotBind_nonManagingPackage() 158 for (UserHandle targetUser : mTargetUsers) { in testCrossProfileCall_echo() 167 for (UserHandle targetUser : mTargetUsers) { in testCrossProfileCall_getUserHandle() 180 T expected, CrossUserCallable<T> callable, UserHandle targetUserHandle) in assertCrossProfileCall() 218 UserHandle userHandle) { in bind()
|
D | BindDeviceAdminServiceFailsTest.java | 26 import android.os.UserHandle; 53 List<UserHandle> allowedTargetUsers = mDpm.getBindDeviceAdminTargetUsers( in testNoBindDeviceAdminTargetUsers() 59 UserHandle otherProfile = Utils.getOtherProfile(mContext); in testCannotBind() 66 private void checkCannotBind(String targetPackageName, UserHandle otherProfile) { in checkCannotBind() 79 UserHandle userHandle) { in bind()
|
D | Utils.java | 20 import android.os.UserHandle; 37 UserHandle getOtherProfile(Context context) { in getOtherProfile() 38 List<UserHandle> otherProfiles = context.getSystemService(UserManager.class) in getOtherProfile()
|
/cts/tests/tests/car/src/android/car/cts/ |
D | UserSwitchRequestTest.java | 23 import android.os.UserHandle; 29 private static final UserHandle USER_HANDLE = UserHandle.of(108);
|
/cts/common/device-side/bedstead/eventlib/src/main/java/com/android/eventlib/events/deviceadminreceivers/ |
D | DeviceAdminTransferAffiliatedProfileOwnershipCompleteEvent.java | 21 import android.os.UserHandle; 108 Context context, UserHandle user) { in logger() 121 Context context, UserHandle user) { in DeviceAdminTransferAffiliatedProfileOwnershipCompleteEventLogger() 153 UserHandle user) { in setUser() 160 protected SerializableParcelWrapper<UserHandle> mUser; 171 public UserHandle user() { in user()
|
/cts/tests/tests/wifi/src/android/net/wifi/cts/ |
D | WifiMigrationTest.java | 21 import android.os.UserHandle; 106 UserHandle.of(ActivityManager.getCurrentUser())); in testWifiMigrationConfigStore() 112 UserHandle.of(ActivityManager.getCurrentUser())); in testWifiMigrationConfigStore() 128 UserHandle.of(ActivityManager.getCurrentUser())); in testWifiMigrationConfigStore() 134 UserHandle.of(ActivityManager.getCurrentUser())); in testWifiMigrationConfigStore()
|
D | WifiJUnit3TestBase.java | 21 import android.os.UserHandle; 43 true, UserHandle.getUserHandleForUid(Process.myUid()))); in setUp() 54 false, UserHandle.getUserHandleForUid(Process.myUid()))); in tearDown()
|
/cts/tests/devicepolicy/src/android/devicepolicy/cts/utils/ |
D | PolicyEngineUtils.java | 32 import android.os.UserHandle; 51 public static PolicyState<Boolean> getBooleanPolicyState(PolicyKey policyKey, UserHandle user) { in getBooleanPolicyState() 60 return (PolicyState<Boolean>) state.getPoliciesForUser(UserHandle.ALL) in getBooleanPolicyState() 70 PolicyKey policyKey, UserHandle user) { in getStringSetPolicyState() 79 return (PolicyState<Set<String>>) state.getPoliciesForUser(UserHandle.ALL) in getStringSetPolicyState() 89 PolicyKey policyKey, UserHandle user) { in getLockTaskPolicyState() 103 PolicyKey policyKey, UserHandle user) { in getComponentNamePolicyState() 112 return (PolicyState<ComponentName>) state.getPoliciesForUser(UserHandle.ALL) in getComponentNamePolicyState()
|
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/ |
D | UserManagerTest.java | 23 import android.os.UserHandle; 51 List<UserHandle> profiles = mUserManager.getAllProfiles(); in testGetAllProfiles() 59 UserHandle newProfile = mUserManager.createProfile("testProfile1", in testCreateProfile_managedProfile() 63 List<UserHandle> profiles = mUserManager.getAllProfiles(); in testCreateProfile_managedProfile()
|
/cts/hostsidetests/accounts/test-apps/AccountManagerCrossUserApp/src/com/android/cts/accountmanager/ |
D | AccountManagerCrossUserTest.java | 30 import android.os.UserHandle; 90 UserHandle profileHandle = UserHandle.of(getTestUser()); in testAccountManager_addMockAccount() 128 UserHandle profileHandle = UserHandle.of(getTestUser()); in testAccountManager_getAccountsForTestUser() 184 UserHandle profileHandle = UserHandle.of(getTestUser()); in testAccountManager_failCreateContextAsUserRevokePermissions() 199 UserHandle profileHandle = UserHandle.of(getTestUser()); in testAccountManager_createContextAsUserForCurrentUserRevokePermissions()
|