Home
last modified time | relevance | path

Searched refs:userId (Results 1 – 25 of 28) sorted by relevance

12

/cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/
DBaseDevicePolicyTest.java153 protected void installAppAsUser(String appFileName, int userId) throws FileNotFoundException, in installAppAsUser() argument
155 installAppAsUser(appFileName, true, userId); in installAppAsUser()
158 protected void installAppAsUser(String appFileName, boolean grantPermissions, int userId) in installAppAsUser() argument
160 CLog.d("Installing app " + appFileName + " for user " + userId); in installAppAsUser()
163 buildHelper.getTestFile(appFileName), true, grantPermissions, userId, "-t"); in installAppAsUser()
164 assertNull("Failed to install " + appFileName + " for user " + userId + ": " + result, in installAppAsUser()
168 protected void forceStopPackageForUser(String packageName, int userId) throws Exception { in forceStopPackageForUser() argument
170 executeShellCommand("am force-stop --user " + userId + " " + packageName); in forceStopPackageForUser()
180 protected void startUser(int userId) throws Exception { in startUser() argument
181 getDevice().startUser(userId); in startUser()
[all …]
DEphemeralUserTest.java41 int userId = createUser(FLAG_EPHEMERAL); in testCreateEphemeralUser() local
42 int flags = getUserFlags(userId); in testCreateEphemeralUser()
51 int userId = createUser(); in testCreateLongLivedUser() local
52 int flags = getUserFlags(userId); in testCreateLongLivedUser()
65 int userId = createUser(FLAG_EPHEMERAL); in testProfileInheritsEphemeral() local
66 int profileId = createManagedProfile(userId); in testProfileInheritsEphemeral()
78 int userId = createUser(FLAG_EPHEMERAL); in testRemoveEphemeralOnStop() local
79 startUser(userId); in testRemoveEphemeralOnStop()
80 assertTrue("ephemeral user must exists after start", listUsers().contains(userId)); in testRemoveEphemeralOnStop()
81 stopUser(userId); in testRemoveEphemeralOnStop()
[all …]
DDeviceOwnerTest.java115 final int userId = createUser(); in testRemoteBugreportWithTwoUsers() local
120 removeUser(userId); in testRemoteBugreportWithTwoUsers()
154 int userId = createUser(); in testRemoveUsersOnSetForceEphemeralUsers() local
155 assertTrue("User must have been created", listUsers().contains(userId)); in testRemoveUsersOnSetForceEphemeralUsers()
161 assertFalse("User must have been removed", listUsers().contains(userId)); in testRemoveUsersOnSetForceEphemeralUsers()
177 int userId = createUser(); in testRemoveUsersOnSetForceEphemeralUsersWithUserSwitch() local
178 assertTrue("User must have been created", listUsers().contains(userId)); in testRemoveUsersOnSetForceEphemeralUsersWithUserSwitch()
181 switchUser(userId); in testRemoveUsersOnSetForceEphemeralUsersWithUserSwitch()
195 if (!listUsers().contains(userId)) { in testRemoveUsersOnSetForceEphemeralUsersWithUserSwitch()
214 int userId = createUser(); in testCreateUserAfterSetForceEphemeralUsers() local
[all …]
DUserRestrictionsTest.java70 @Nullable String method, int userId) throws DeviceNotAvailableException { in runTests() argument
71 runDeviceTestsAsUser(DEVICE_ADMIN_PKG, "." + className, method, userId); in runTests()
74 private void runTests(@Nonnull String className, int userId) in runTests() argument
76 runTests(className, null, userId); in runTests()
258 private void setPoAsUser(int userId) throws Exception { in setPoAsUser() argument
259 installAppAsUser(DEVICE_ADMIN_APK, userId); in setPoAsUser()
262 userId, /* expectFailure */ false)); in setPoAsUser()
264 if (userId == mDeviceOwnerUserId) { in setPoAsUser()
291 for (int userId : usersToCheck) { in setAndCheckProfileGlobalRestriction()
292 runGlobalRestrictionsTest(ENSURE_GLOBAL_RESTRICTIONS_TEST, userId); in setAndCheckProfileGlobalRestriction()
[all …]
DDeviceAndProfileOwnerTest.java651 final int userId = createUser(); in testCannotRemoveUserIfRestrictionSet() local
654 assertFalse(getDevice().removeUser(userId)); in testCannotRemoveUserIfRestrictionSet()
657 assertTrue(getDevice().removeUser(userId)); in testCannotRemoveUserIfRestrictionSet()
747 private void changeUserRestrictionOrFail(String key, boolean value, int userId) in changeUserRestrictionOrFail() argument
749 changeUserRestrictionOrFail(key, value, userId, DEVICE_ADMIN_PKG); in changeUserRestrictionOrFail()
752 private void changeAccountManagement(String command, String accountType, int userId) in changeAccountManagement() argument
754 changePolicyOrFail(command, "--es extra-account-type " + accountType, userId); in changeAccountManagement()
779 private void setInstallPackageAppOps(String packageName, boolean allowed, int userId) in setInstallPackageAppOps() argument
781 String command = "appops set --user " + userId + " " + packageName + " " + in setInstallPackageAppOps()
787 private void changePolicyOrFail(String command, String extras, int userId) in changePolicyOrFail() argument
[all …]
DManagedProfileTest.java380 private void testCrossProfileCopyPasteInternal(int userId, boolean shouldSucceed) in testCrossProfileCopyPasteInternal() argument
382 final String direction = (userId == mParentUserId) in testCrossProfileCopyPasteInternal()
391 "testCanReadAcrossProfiles", userId); in testCrossProfileCopyPasteInternal()
393 "testIsNotified", userId); in testCrossProfileCopyPasteInternal()
396 "testCannotReadAcrossProfiles", userId); in testCrossProfileCopyPasteInternal()
713 private void setDirectoryPrefix(String directoryName, int userId) in setDirectoryPrefix() argument
716 + " --user " + userId in setDirectoryPrefix()
801 private void givePackageWriteSettingsPermission(int userId, String pkg) throws Exception { in givePackageWriteSettingsPermission() argument
803 String command = "appops set --user " + userId + " " + pkg in givePackageWriteSettingsPermission()
898 private void disableActivityForUser(String activityName, int userId) in disableActivityForUser() argument
[all …]
DDeviceAndProfileOwnerTestApi25.java100 protected void startSimpleActivityAsUser(int userId) throws Exception { in startSimpleActivityAsUser() argument
101 installAppAsUser(TEST_APP_APK, userId); in startSimpleActivityAsUser()
102 String command = "am start -W --user " + userId + " " + TEST_APP_PKG + "/" in startSimpleActivityAsUser()
DCustomManagedProfileTest.java51 private void assertIsProvisioningAllowed(boolean expected, int userId) in assertIsProvisioningAllowed() argument
55 runDeviceTestsAsUser(MANAGED_PROFILE_PKG, ".PreManagedProfileTest", testName, userId); in assertIsProvisioningAllowed()
DCustomDeviceOwnerTest.java93 int userId = -1; in testCannotSetDeviceOwnerWhenSecondaryUserPresent() local
96 userId = createUser(); in testCannotSetDeviceOwnerWhenSecondaryUserPresent()
100 removeUser(userId); in testCannotSetDeviceOwnerWhenSecondaryUserPresent()
DDeviceOwnerPlusProfileOwnerTest.java519 final int userId = createManagedProfile(mPrimaryUserId); in setupManagedProfile() local
520 installAppAsUser(apkName, userId); in setupManagedProfile()
521 setProfileOwnerOrFail(adminReceiverClassName, userId); in setupManagedProfile()
522 startUser(userId); in setupManagedProfile()
527 userId); in setupManagedProfile()
528 return userId; in setupManagedProfile()
/cts/hostsidetests/appsecurity/src/android/appsecurity/cts/
DPackageVisibilityTest.java63 int userId = mUsers[1]; in testUninstalledPackageVisibility() local
64 assertTrue(userId > 0); in testUninstalledPackageVisibility()
65 getDevice().startUser(userId); in testUninstalledPackageVisibility()
66 installTestAppForUser(TEST_APK, userId); in testUninstalledPackageVisibility()
82 assertFalse(isAppVisibleForUser(TINY_PKG, userId, MATCH_NORMAL)); in testUninstalledPackageVisibility()
83 assertFalse(isAppVisibleForUser(TINY_PKG, userId, MATCH_UNINSTALLED)); in testUninstalledPackageVisibility()
87 ".PackageAccessTest", "testPackageAccess_notInOtherUser", userId); in testUninstalledPackageVisibility() local
89 ".PackageAccessTest", "testPackageAccess_notInOtherUserUninstalled", userId); in testUninstalledPackageVisibility() local
92 ".PackageAccessTest", "testPackageAccess_getPackagesCantSeeTiny", userId); in testUninstalledPackageVisibility() local
97 installTestAppForUser(TINY_APK, userId); in testUninstalledPackageVisibility()
[all …]
DBaseAppSecurityTest.java69 protected void installTestAppForUser(String apk, int userId) throws Exception { in installTestAppForUser() argument
70 if (userId < 0) { in installTestAppForUser()
71 userId = mPrimaryUserId; in installTestAppForUser()
75 buildHelper.getTestFile(apk), true, false, userId, "-t")); in installTestAppForUser() local
78 protected boolean isAppVisibleForUser(String packageName, int userId, in isAppVisibleForUser() argument
80 String command = "cmd package list packages --user " + userId; in isAppVisibleForUser()
DInstantAppUserTest.java188 String testMethodName, int userId) in runDeviceTestsAsUser() argument
190 Utils.runDeviceTests(getDevice(), packageName, testClassName, testMethodName, userId); in runDeviceTestsAsUser() local
203 private void installAppAsUser(String apk, int userId) throws Exception { in installAppAsUser() argument
208 private void replaceFullAppAsUser(String apk, int userId) throws Exception { in replaceFullAppAsUser() argument
211 buildHelper.getTestFile(apk), true, userId, "--full")); in replaceFullAppAsUser() local
214 private void installExistingInstantAppAsUser(String packageName, int userId) throws Exception { in installExistingInstantAppAsUser() argument
216 "Package " + packageName + " installed for user: " + userId + "\n"; in installExistingInstantAppAsUser()
220 + " --user " + Integer.toString(userId) in installExistingInstantAppAsUser()
224 private void installExistingFullAppAsUser(String packageName, int userId) throws Exception { in installExistingFullAppAsUser() argument
226 "Package " + packageName + " installed for user: " + userId + "\n"; in installExistingFullAppAsUser()
[all …]
DUtils.java39 public static void runDeviceTests(ITestDevice device, String packageName, int userId) in runDeviceTests() argument
41 runDeviceTests(device, packageName, null, null, userId, null); in runDeviceTests()
50 int userId) throws DeviceNotAvailableException { in runDeviceTests() argument
51 runDeviceTests(device, packageName, testClassName, null, userId, null); in runDeviceTests()
66 String testMethodName, int userId) throws DeviceNotAvailableException { in runDeviceTests() argument
67 runDeviceTests(device, packageName, testClassName, testMethodName, userId, null); in runDeviceTests()
71 String testMethodName, int userId, Map<String, String> testArgs) in runDeviceTests() argument
92 device.runInstrumentationTestsAsUser(testRunner, userId, listener); in runDeviceTests()
DExternalStorageHostTest.java304 private void enableWriteSettings(String packageName, int userId) in enableWriteSettings() argument
308 cmd.append(userId); in enableWriteSettings()
325 private void runDeviceTests(String packageName, String testClassName, int userId) in runDeviceTests() argument
327 Utils.runDeviceTests(getDevice(), packageName, testClassName, userId); in runDeviceTests() local
331 int userId) throws DeviceNotAvailableException { in runDeviceTests() argument
332 Utils.runDeviceTests(getDevice(), packageName, testClassName, testMethodName, userId); in runDeviceTests() local
DStorageHostTest.java236 int userId) throws DeviceNotAvailableException { in runDeviceTests() argument
237 Utils.runDeviceTests(getDevice(), packageName, testClassName, testMethodName, userId); in runDeviceTests() local
/cts/hostsidetests/media/src/android/media/cts/
DBaseMultiUserTest.java133 for (int userId : getDevice().listUsers()) { in tearDown()
134 if (!mExistingUsers.contains(userId)) { in tearDown()
135 removeUser(userId); in tearDown()
161 protected void installAppAsUser(String appFileName, int userId) in installAppAsUser() argument
163 CLog.d("Installing app " + appFileName + " for user " + userId); in installAppAsUser()
166 buildHelper.getTestFile(appFileName), true, true, userId, "-t"); in installAppAsUser()
167 assertNull("Failed to install " + appFileName + " for user " + userId + ": " + result, in installAppAsUser()
192 int userId = Integer.parseInt(tokens[tokens.length-1]); in createAndStartUser() local
195 getDevice().startUser(userId); in createAndStartUser()
196 return userId; in createAndStartUser()
[all …]
/cts/hostsidetests/media/src/android/media/session/cts/
DMediaSessionManagerHostTest.java78 for (int userId : mNotificationListeners.keySet()) { in tearDown()
79 String notificationListener = mNotificationListeners.get(userId); in tearDown()
81 SETTINGS_NOTIFICATION_LISTENER_NAME, notificationListener, userId); in tearDown()
144 private void runTestAsUser(String testMethodName, int userId) in runTestAsUser() argument
147 testMethodName, userId); in runTestAsUser()
161 private void allowGetActiveSessionForTest(int userId) throws Exception { in allowGetActiveSessionForTest() argument
163 if (mNotificationListeners.get(userId) != null) { in allowGetActiveSessionForTest()
168 SETTINGS_NOTIFICATION_LISTENER_NAME, userId); in allowGetActiveSessionForTest()
183 mNotificationListeners.put(userId, list); in allowGetActiveSessionForTest()
187 SETTINGS_NOTIFICATION_LISTENER_NAME, joiner.toString(), userId); in allowGetActiveSessionForTest()
[all …]
/cts/hostsidetests/numberblocking/src/com/android/cts/numberblocking/hostside/
DNumberBlockingTest.java150 private void installTestAppForUser(int userId) throws Exception { in installTestAppForUser() argument
151 LogUtil.CLog.logAndDisplay(Log.LogLevel.INFO, "Installing test app for user: " + userId); in installTestAppForUser()
155 testAppFile, true /*reinstall*/, userId); in installTestAppForUser()
169 private void runTestAsUser(String className, String methodName, int userId) throws Exception { in runTestAsUser() argument
171 className, methodName, userId); in runTestAsUser()
180 getDevice().runInstrumentationTestsAsUser(testRunner, userId, listener); in runTestAsUser()
199 private void setTestAppAsDefaultSmsAppForUser(boolean setToSmsApp, int userId) in setTestAppAsDefaultSmsAppForUser() argument
201 String command = String.format("appops set --user %d %s WRITE_SMS %s", userId, in setTestAppAsDefaultSmsAppForUser()
208 private int getUserSerialNumber(int userId) throws DeviceNotAvailableException { in getUserSerialNumber() argument
214 if (token.contains("UserInfo{" + userId + ":")) { in getUserSerialNumber()
[all …]
/cts/hostsidetests/shortcuts/hostside/src/android/content/pm/cts/shortcuthost/
DBaseShortcutManagerHostTest.java96 protected void clearShortcuts(String packageName, int userId) throws Exception { in clearShortcuts() argument
98 getDevice().executeShellCommand("cmd shortcut clear-shortcuts --user " + userId in clearShortcuts()
102 protected void installAppAsUser(String appFileName, int userId) throws FileNotFoundException, in installAppAsUser() argument
104 CLog.i("Installing app " + appFileName + " for user " + userId); in installAppAsUser()
107 buildHelper.getTestFile(appFileName), true, true, userId, "-t"); in installAppAsUser()
108 assertNull("Failed to install " + appFileName + " for user " + userId + ": " + result, in installAppAsUser()
118 String pkgName, @Nullable String testClassName, int userId) in runDeviceTestsAsUser() argument
120 runDeviceTestsAsUser(pkgName, testClassName, null /*testMethodName*/, userId); in runDeviceTestsAsUser()
125 String pkgName, @Nullable String testClassName, String testMethodName, int userId) in runDeviceTestsAsUser() argument
128 runDeviceTestsAsUser(pkgName, testClassName, testMethodName, userId, params); in runDeviceTestsAsUser()
[all …]
/cts/hostsidetests/multiuser/src/android/host/multiuser/
DCreateUsersNoAppCrashesTest.java44 int userId = getDevice().createUser( in testCanCreateGuestUser() local
49 assertTrue("Couldn't switch to user " + userId, getDevice().switchUser(userId)); in testCanCreateGuestUser()
52 waitForBootCompleted(appErrors, userId)); in testCanCreateGuestUser()
54 assertTrue("Couldn't switch to user " + userId, getDevice().switchUser(mInitialUserId)); in testCanCreateGuestUser()
DBaseMultiUserTest.java73 protected int createRestrictedProfile(int userId) in createRestrictedProfile() argument
75 final String command = "pm create-user --profileOf " + userId + " --restricted " in createRestrictedProfile()
117 for (int userId : getDevice().listUsers()) { in removeTestUsers()
118 if (!mFixedUsers.contains(userId)) { in removeTestUsers()
119 getDevice().removeUser(userId); in removeTestUsers()
/cts/hostsidetests/media/common/android/media/cts/
DMediaSessionTestHelperConstants.java86 public static String buildControlCommand(int userId, int flag) { in buildControlCommand() argument
87 return "am start-foreground-service --user " + userId + " -a " + ACTION_CONTROL + " --ei " in buildControlCommand()
/cts/hostsidetests/appsecurity/test-apps/ReadExternalStorageApp/src/com/android/cts/readexternalstorageapp/
DReadExternalStorageTest.java80 final String userId = Integer.toString(android.os.Process.myUid() / 100000); in testMountPointsNotWritable() local
87 final File userPath = new File(path, userId); in testMountPointsNotWritable()
/cts/tests/tests/packageinstaller/adminpackageinstaller/src/android/packageinstaller/admin/cts/
DSessionCommitBroadcastTest.java119 int userId = user.getIdentifier(); in testBroadcastReceivedForEnablingApp() local
120 assertTrue(TextUtils.join(" ", runShellCommand("am start-user " + userId)) in testBroadcastReceivedForEnablingApp()
125 "pm install -r --user " + userId + " " + TEST_APP_LOCATION)) in testBroadcastReceivedForEnablingApp()

12