Home
last modified time | relevance | path

Searched refs:userHandle (Results 1 – 25 of 96) sorted by relevance

1234

/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DCreateAndManageUserTest.java78 UserHandle userHandle = createAndManageUser(); in testCreateAndManageUser() local
80 assertWithMessage("New user").that(userHandle).isNotNull(); in testCreateAndManageUser()
121 UserHandle userHandle = createAndManageUser(); in testCreateAndManageUser_SwitchUser() local
123 List<UserHandle> usersOnBroadcasts = switchUserAndWaitForBroadcasts(userHandle); in testCreateAndManageUser_SwitchUser()
125 assertWithMessage("user on broadcasts").that(usersOnBroadcasts).containsExactly(userHandle, in testCreateAndManageUser_SwitchUser()
126 userHandle); in testCreateAndManageUser_SwitchUser()
130 UserHandle userHandle = createAndManageUser(); in testCreateAndManageUser_CannotStopCurrentUser() local
132 switchUserAndWaitForBroadcasts(userHandle); in testCreateAndManageUser_CannotStopCurrentUser()
134 stopUserAndCheckResult(userHandle, UserManager.USER_OPERATION_ERROR_CURRENT_USER); in testCreateAndManageUser_CannotStopCurrentUser()
138 UserHandle userHandle = createAndManageUser(); in testCreateAndManageUser_StartInBackground() local
[all …]
DBasicAdminReceiver.java60 public void onUserAdded(Context context, Intent intent, UserHandle userHandle) { in onUserAdded() argument
61 sendUserBroadcast(context, ACTION_USER_ADDED, userHandle); in onUserAdded()
65 public void onUserRemoved(Context context, Intent intent, UserHandle userHandle) { in onUserRemoved() argument
66 sendUserBroadcast(context, ACTION_USER_REMOVED, userHandle); in onUserRemoved()
70 public void onUserStarted(Context context, Intent intent, UserHandle userHandle) { in onUserStarted() argument
71 sendUserBroadcast(context, ACTION_USER_STARTED, userHandle); in onUserStarted()
75 public void onUserStopped(Context context, Intent intent, UserHandle userHandle) { in onUserStopped() argument
76 sendUserBroadcast(context, ACTION_USER_STOPPED, userHandle); in onUserStopped()
80 public void onUserSwitched(Context context, Intent intent, UserHandle userHandle) { in onUserSwitched() argument
81 sendUserBroadcast(context, ACTION_USER_SWITCHED, userHandle); in onUserSwitched()
[all …]
/cts/tests/devicepolicy/src/android/devicepolicy/cts/
DStartProfilesTest.java71 return (intent) -> user.userHandle().equals(intent.getParcelableExtra(Intent.EXTRA_USER)); in userIsEqual()
82 assertThat(sActivityManager.startProfile(sDeviceState.workProfile().userHandle())).isTrue(); in startProfile_returnsTrue()
100 sActivityManager.startProfile(sDeviceState.workProfile().userHandle()); in startProfile_broadcastIsReceived_profileIsStarted()
104 assertThat(sUserManager.isUserRunning(sDeviceState.workProfile().userHandle())).isTrue(); in startProfile_broadcastIsReceived_profileIsStarted()
114 assertThat(sActivityManager.stopProfile(sDeviceState.workProfile().userHandle())).isTrue(); in stopProfile_returnsTrue()
127 sActivityManager.stopProfile(sDeviceState.workProfile().userHandle()); in stopProfile_profileIsStopped()
131 sUserManager.isUserRunning(sDeviceState.workProfile().userHandle())).isFalse(); in stopProfile_profileIsStopped()
143 sActivityManager.stopProfile(sDeviceState.workProfile().userHandle()); in startUser_immediatelyAfterStopped_profileIsStarted()
150 sActivityManager.startProfile(sDeviceState.workProfile().userHandle()); in startUser_immediatelyAfterStopped_profileIsStarted()
156 sUserManager.isUserRunning(sDeviceState.workProfile().userHandle())).isTrue(); in startUser_immediatelyAfterStopped_profileIsStarted()
[all …]
DCrossProfileAppsTest.java158 assertThat(targetProfiles).doesNotContain(sDeviceState.otherUser().userHandle()); in getTargetUserProfiles_doesNotContainOtherUser()
170 assertThat(targetProfiles).contains(sDeviceState.otherUser().userHandle()); in getTargetUserProfiles_containsOtherUser()
183 assertThat(targetProfiles).doesNotContain(sDeviceState.otherUser().userHandle()); in getTargetUserProfiles_appNotInstalledInOtherUser_doesNotContainOtherUser()
215 sCrossProfileApps.isProfile(sDeviceState.otherUser().userHandle()); in isProfile_targetIsInvalid_throwsSecurityException()
232 assertThat(sCrossProfileApps.isProfile(sDeviceState.otherUser().userHandle())).isTrue(); in isProfile_profile_returnsTrue()
246 assertThat(sCrossProfileApps.isProfile(sDeviceState.otherUser().userHandle())).isFalse(); in isProfile_notProfile_returnsFalse()
264 sCrossProfileApps.isManagedProfile(sDeviceState.otherUser().userHandle()); in isManagedProfile_targetIsInvalid_throwsSecurityException()
279 assertThat(sCrossProfileApps.isManagedProfile(sDeviceState.otherUser().userHandle())) in isManagedProfile_managedProfile_returnsTrue()
296 assertThat(sCrossProfileApps.isManagedProfile(sDeviceState.otherUser().userHandle())) in isManagedProfile_notManagedProfile_returnsFalse()
308 sCrossProfileApps.startMainActivity(MAIN_ACTIVITY, sDeviceState.otherUser().userHandle()); in startMainActivity_launches()
[all …]
DManagedProfileContactsAccessTest.java210 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_blocklistPackages_hasProperAccess()
212 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_blocklistPackages_hasProperAccess()
214 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_blocklistPackages_hasProperAccess()
231 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistPackages_hasProperAccess()
233 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistPackages_hasProperAccess()
235 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistPackages_hasProperAccess()
254 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistAndSystemPackages_hasProperAccess()
256 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistAndSystemPackages_hasProperAccess()
258 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistAndSystemPackages_hasProperAccess()
DManagedProfileCallerIdAccessTest.java210 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_blocklistPackages_hasProperAccess()
212 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_blocklistPackages_hasProperAccess()
214 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_blocklistPackages_hasProperAccess()
231 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistPackages_hasProperAccess()
233 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistPackages_hasProperAccess()
235 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistPackages_hasProperAccess()
254 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistAndSystemPackages_hasProperAccess()
256 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistAndSystemPackages_hasProperAccess()
258 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistAndSystemPackages_hasProperAccess()
DDeviceManagementCoexistenceTest.java204 sDeviceState.dpc().user().userHandle()); in getDevicePolicyState_permissionGrantStateSet_returnsPolicy()
237 sDeviceState.dpc().user().userHandle()); in getDevicePolicyState_appRestrictionsSet_returnsPolicy()
244 sDeviceState.dpc().user().userHandle())); in getDevicePolicyState_appRestrictionsSet_returnsPolicy()
270 sDeviceState.dpc().user().userHandle()); in getDevicePolicyState_resetPasswordTokenSet_returnsPolicy()
278 sDeviceState.dpc().user().userHandle())); in getDevicePolicyState_resetPasswordTokenSet_returnsPolicy()
302 sDeviceState.dpc().user().userHandle()); in getDevicePolicyState_addUserRestriction_returnsPolicy()
354 sDeviceState.dpc().user().userHandle()); in getDevicePolicyState_setKeyguardDisabledFeatures_returnsPolicy()
375 sDeviceState.dpc().user().parent().userHandle()); in getDevicePolicyState_setPersonalAppsSuspended_returnsPolicy()
429 sDeviceState.dpc().user().userHandle()); in getDevicePolicyState_permissionGrantState_returnsCorrectResolutionMechanism()
459 sDeviceState.dpc().user().userHandle()); in getDevicePolicyState_addUserRestriction_returnsCorrectResolutionMechanism()
[all …]
DActivityTest.java80 sDeviceState.workProfile().userHandle()); in startActivityForResultAsUser_differentUser_startedSuccessfully()
106 sDeviceState.workProfile().userHandle()); in startActivityForResultAsUser_requestCodeAndResultPassedSuccessfully()
138 sDeviceState.workProfile().userHandle()); in startActivityForResultAsUser_noPermissions_throwsSecurityException()
160 sDeviceState.workProfile().userHandle()); in startActivityAsUser_differentUser_startedSuccessfully()
185 sDeviceState.workProfile().userHandle()); in startActivityAsUser_noPermissions_throwsSecurityException()
/cts/tests/tests/multiuser/src/android/multiuser/cts/
DUserManagerTest.java138 private void removeUser(UserHandle userHandle) { in removeUser() argument
139 if (userHandle == null) { in removeUser()
143 assertThat(mUserManager.removeUser(userHandle)).isTrue(); in removeUser()
357 Context context = getContextForUser(profile.userHandle().getIdentifier()); in testIsUserRunning_stoppedProfileOfCurrentUser()
361 profile.id()).that(um.isUserRunning(profile.userHandle())) in testIsUserRunning_stoppedProfileOfCurrentUser()
379 .that(um.isUserRunning(sDeviceState.additionalUser().userHandle())).isFalse(); in testIsUserRunning_stoppedSecondaryUser()
389 UserHandle userHandle = null; in testCloneProfile() local
394 userHandle = mUserManager.createProfile( in testCloneProfile()
401 assertThat(userHandle).isNotNull(); in testCloneProfile()
404 userHandle); in testCloneProfile()
[all …]
DUserVisibilityTest.java119 Context context = getContextForUser(profile.userHandle().getIdentifier()); in testIsUserVisible_stoppedProfileOfCurrentUser()
144 .contains(TestApis.users().current().userHandle()); in testGetVisibleUsers_currentUser()
155 .contains(TestApis.users().current().userHandle()); in testGetVisibleUsers_backgroundUser()
168 .containsAtLeast(myUser.userHandle(), myUser.parent().userHandle()); in testGetVisibleUsers_startedProfileOfCurrentUser()
183 Context context = getContextForUser(profile.userHandle().getIdentifier()); in testGetVisibleUsers_stoppedProfileOfCurrentUser()
189 .contains(TestApis.users().current().userHandle()); in testGetVisibleUsers_stoppedProfileOfCurrentUser()
191 .doesNotContain(profile.userHandle()); in testGetVisibleUsers_stoppedProfileOfCurrentUser()
DNewUserResponseTest.java35 UserHandle userHandle = UserHandle.of(100); in testNewUserResponseSuccessful() local
38 new NewUserResponse(userHandle, UserManager.USER_OPERATION_SUCCESS); in testNewUserResponseSuccessful()
41 assertThat(response.getUser()).isEqualTo(userHandle); in testNewUserResponseSuccessful()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/userrestrictions/
DDeviceOwnerUserRestrictionsTest.java96 final UserHandle userHandle = Process.myUserHandle(); in testHasBaseUserRestrictions() local
98 if(!hasBaseUserRestriction(r, userHandle)) { in testHasBaseUserRestrictions()
101 mUserManager.hasUserRestriction(r, userHandle)); in testHasBaseUserRestrictions()
103 hasBaseUserRestriction(r, userHandle)); in testHasBaseUserRestrictions()
107 mUserManager.hasUserRestriction(r, userHandle)); in testHasBaseUserRestrictions()
109 hasBaseUserRestriction(r, userHandle)); in testHasBaseUserRestrictions()
/cts/tests/tests/instantapp/src/android/cts/instantapp/resolver/
DInstantAppRequestInfoTest.kt30 private val userHandle = android.os.Process.myUserHandle() constant
34 private val info = InstantAppRequestInfo(intent, hostDigestPrefix, userHandle,
57 assertThat(info.userHandle).isEqualTo(userHandle) in assertValues()
/cts/common/device-side/bedstead/eventlib/src/test/java/com/android/eventlib/premade/
DEventLibDeviceAdminReceiverTest.java169 receiver.onPasswordChanged(sContext, sIntent, sUser.userHandle()); in changePasswordWithUserHandle_logsPasswordChangedEvent()
175 assertThat(event.userHandle()).isEqualTo(sUser.userHandle()); in changePasswordWithUserHandle_logsPasswordChangedEvent()
193 receiver.onPasswordFailed(sContext, sIntent, sUser.userHandle()); in failPasswordWithUserHandle_logsPasswordFailedEvent()
199 assertThat(event.userHandle()).isEqualTo(sUser.userHandle()); in failPasswordWithUserHandle_logsPasswordFailedEvent()
217 receiver.onPasswordSucceeded(sContext, sIntent, sUser.userHandle()); in succeedPasswordWithUserHandle_logsPasswordSucceededEvent()
223 assertThat(event.userHandle()).isEqualTo(sUser.userHandle()); in succeedPasswordWithUserHandle_logsPasswordSucceededEvent()
241 receiver.onPasswordExpiring(sContext, sIntent, sUser.userHandle()); in passwordExpiringWithUserHandle_logsPasswordExpiringEvent()
247 assertThat(event.user()).isEqualTo(sUser.userHandle()); in passwordExpiringWithUserHandle_logsPasswordExpiringEvent()
376 receiver.onUserAdded(sContext, sIntent, sUser.userHandle()); in userAdded_logsUserAddedEvent()
387 receiver.onUserRemoved(sContext, sIntent, sUser.userHandle()); in userRemoved_logsUserRemovedEvent()
[all …]
/cts/common/device-side/bedstead/nene/src/main/java/com/android/bedstead/nene/context/
DContext.java55 return sInstrumentedContext.createContextAsUser(user.userHandle(), /* flags= */ 0); in instrumentedContextAsUser()
70 return sInstrumentationContext.createContextAsUser(user.userHandle(), /* flags= */ 0); in instrumentationContextAsUser()
81 ANDROID_PACKAGE, /* flags= */ 0, user.userHandle()); in androidContextAsUser()
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/
DCrossProfileTest.java265 String packageName, int mode, UserHandle userHandle) throws Exception { in explicitlySetInteractAcrossProfilesAppOp() argument
272 getUidForPackageName(packageName, userHandle), in explicitlySetInteractAcrossProfilesAppOp()
277 private int getUidForPackageName(String packageName, UserHandle userHandle) throws Exception { in getUidForPackageName() argument
278 return mContext.createContextAsUser(userHandle, /* flags= */ 0) in getUidForPackageName()
284 Set<String> packageNames, int mode, UserHandle userHandle) in assertThatPackagesHaveAppOpMode() argument
287 assertThat(getCrossProfileAppOp(unsetCrossProfilePackage, userHandle)).isEqualTo(mode); in assertThatPackagesHaveAppOpMode()
296 private int getCrossProfileAppOp(String packageName, UserHandle userHandle) throws Exception { in getCrossProfileAppOp() argument
303 getUidForPackageName(packageName, userHandle), in getCrossProfileAppOp()
/cts/common/device-side/bedstead/queryable/src/main/java/com/android/queryable/queries/
DUserHandleQuery.java29 static UserHandleQueryHelper.UserHandleQueryBase userHandle() { in userHandle() method
34 E isEqualTo(UserHandle userHandle); in isEqualTo() argument
/cts/tests/tests/car_permission_tests/src/android/car/cts/permissiontest/watchdog/
DCarWatchdogManagerPermissionTest.java132 UserHandle userHandle = UserHandle.getUserHandleForUid(Process.myUid()); in testGetResourceOveruseStatsForUserPackage() local
136 packageName, userHandle, in testGetResourceOveruseStatsForUserPackage()
171 UserHandle userHandle = UserHandle.getUserHandleForUid(Process.myUid()); in testSetKillablePackageAsUser() local
174 () -> mCarWatchdogManager.setKillablePackageAsUser(packageName, userHandle, true)); in testSetKillablePackageAsUser()
179 UserHandle userHandle = UserHandle.getUserHandleForUid(Process.myUid()); in testGetPackageKillableStatesAsUser() local
182 () -> mCarWatchdogManager.getPackageKillableStatesAsUser(userHandle)); in testGetPackageKillableStatesAsUser()
/cts/common/device-side/bedstead/eventlib/src/main/java/com/android/eventlib/
DEventLogsQuery.java91 public F onUser(UserHandle userHandle) { in onUser() argument
92 if (userHandle == null) { in onUser()
95 mUserHandle = userHandle; in onUser()
101 return onUser(userReference.userHandle()); in onUser()
/cts/common/device-side/bedstead/eventlib/src/main/java/com/android/eventlib/events/deviceadminreceivers/
DDeviceAdminPasswordSucceededEvent.java165 public DeviceAdminPasswordSucceededEventLogger setUserHandle(UserHandle userHandle) { in setUserHandle() argument
166 mEvent.mUserHandle = new SerializableParcelWrapper<>(userHandle); in setUserHandle()
190 public UserHandle userHandle() { in userHandle() method in DeviceAdminPasswordSucceededEvent
206 + ", userHandle=" + userHandle() in toString()
DDeviceAdminPasswordChangedEvent.java165 public DeviceAdminPasswordChangedEventLogger setUserHandle(UserHandle userHandle) { in setUserHandle() argument
166 mEvent.mUserHandle = new SerializableParcelWrapper<>(userHandle); in setUserHandle()
190 public UserHandle userHandle() { in userHandle() method in DeviceAdminPasswordChangedEvent
206 + ", userHandle=" + userHandle() in toString()
DDeviceAdminPasswordFailedEvent.java165 public DeviceAdminPasswordFailedEventLogger setUserHandle(UserHandle userHandle) { in setUserHandle() argument
166 mEvent.mUserHandle = new SerializableParcelWrapper<>(userHandle); in setUserHandle()
190 public UserHandle userHandle() { in userHandle() method in DeviceAdminPasswordFailedEvent
206 + ", userHandle=" + userHandle() in toString()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DByodIconSamplerActivity.java61 UserHandle userHandle = Process.myUserHandle(); in sampleImage() local
62 Log.d(TAG, "Sampling image for: " + userHandle); in sampleImage()
63 Drawable drawable = getPackageManager().getUserBadgedIcon(getAppIcon(), userHandle); in sampleImage()
/cts/libs/install/testapp/src/com/android/cts/install/lib/testapp/
DProcessBroadcast.java106 String userHandle = Process.myUserHandle().toString(); in processUserData() local
138 if (!readUserHandle.equals(userHandle)) { in processUserData()
139 throw new UserDataException("User handle expected to be: " + userHandle in processUserData()
162 pw.println(userHandle); in processUserData()
/cts/tests/tests/os/src/android/os/cts/
DEnvironmentTest.java150 (uuid, userHandle) -> Environment.getDataCePackageDirectoryForUser( in testDataCePackageDirectoryForUser()
151 uuid, userHandle, sContext.getPackageName()), in testDataCePackageDirectoryForUser()
159 (uuid, userHandle) -> Environment.getDataDePackageDirectoryForUser( in testDataDePackageDirectoryForUser()
160 uuid, userHandle, sContext.getPackageName()), in testDataDePackageDirectoryForUser()

1234