/cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/ |
D | BaseDevicePolicyTest.java | 173 protected void installAppAsUser(String appFileName, int userId) throws FileNotFoundException, in installAppAsUser() argument 175 installAppAsUser(appFileName, true, userId); in installAppAsUser() 178 protected void installAppAsUser(String appFileName, boolean grantPermissions, int userId) in installAppAsUser() argument 180 CLog.d("Installing app " + appFileName + " for user " + userId); in installAppAsUser() 183 buildHelper.getTestFile(appFileName), true, grantPermissions, userId, "-t"); in installAppAsUser() 184 assertNull("Failed to install " + appFileName + " for user " + userId + ": " + result, in installAppAsUser() 188 protected void forceStopPackageForUser(String packageName, int userId) throws Exception { in forceStopPackageForUser() argument 190 executeShellCommand("am force-stop --user " + userId + " " + packageName); in forceStopPackageForUser() 200 protected void startUser(int userId) throws Exception { in startUser() argument 201 getDevice().startUser(userId); in startUser() [all …]
|
D | EphemeralUserTest.java | 41 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() 66 int userId = createUser(FLAG_EPHEMERAL); in testProfileInheritsEphemeral() local 67 int profileId = createManagedProfile(userId); in testProfileInheritsEphemeral() 79 int userId = createUser(FLAG_EPHEMERAL); in testRemoveEphemeralOnStop() local 80 startUser(userId); in testRemoveEphemeralOnStop() 81 assertTrue("ephemeral user must exists after start", listUsers().contains(userId)); in testRemoveEphemeralOnStop() 82 stopUser(userId); in testRemoveEphemeralOnStop() [all …]
|
D | UserRestrictionsTest.java | 70 @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 …]
|
D | DeviceOwnerTest.java | 125 final int userId = createUser(); in testRemoteBugreportWithTwoUsers() local 130 removeUser(userId); in testRemoteBugreportWithTwoUsers() 392 final int userId = createUser(); in testSecurityLoggingWithTwoUsers() local 402 removeUser(userId); in testSecurityLoggingWithTwoUsers() 453 final int userId = createUser(); in testNetworkLoggingWithTwoUsers() local 460 removeUser(userId); in testNetworkLoggingWithTwoUsers() 556 final int userId = createUser(); in testLockTask_unaffiliatedUser() local 557 installAppAsUser(DEVICE_OWNER_APK, userId); in testLockTask_unaffiliatedUser() 558 setProfileOwnerOrFail(DEVICE_OWNER_COMPONENT, userId); in testLockTask_unaffiliatedUser() 564 userId); in testLockTask_unaffiliatedUser() [all …]
|
D | DeviceAndProfileOwnerHostSideTransferTest.java | 86 protected void setupTestParameters(int userId, String outgoingTestClassName, in setupTestParameters() argument 88 mUserId = userId; in setupTestParameters() 160 final int userId = createManagedProfile(mPrimaryUserId); in setupManagedProfile() local 161 installAppAsUser(apkName, userId); in setupManagedProfile() 162 if (!setProfileOwner(adminReceiverClassName, userId, false)) { in setupManagedProfile() 163 removeAdmin(TRANSFER_OWNER_OUTGOING_TEST_RECEIVER, userId); in setupManagedProfile() 168 startUser(userId); in setupManagedProfile() 169 return userId; in setupManagedProfile()
|
D | DeviceAndProfileOwnerTest.java | 777 final int userId = createUser(); in testCannotRemoveUserIfRestrictionSet() local 780 assertFalse(getDevice().removeUser(userId)); in testCannotRemoveUserIfRestrictionSet() 783 assertTrue(getDevice().removeUser(userId)); in testCannotRemoveUserIfRestrictionSet() 970 private void changeUserRestrictionOrFail(String key, boolean value, int userId) in changeUserRestrictionOrFail() argument 972 changeUserRestrictionOrFail(key, value, userId, DEVICE_ADMIN_PKG); in changeUserRestrictionOrFail() 975 private void changeAccountManagement(String command, String accountType, int userId) in changeAccountManagement() argument 977 changePolicyOrFail(command, "--es extra-account-type " + accountType, userId); in changeAccountManagement() 1002 private void setInstallPackageAppOps(String packageName, boolean allowed, int userId) in setInstallPackageAppOps() argument 1004 String command = "appops set --user " + userId + " " + packageName + " " + in setInstallPackageAppOps() 1010 private void changePolicyOrFail(String command, String extras, int userId) in changePolicyOrFail() argument [all …]
|
D | CustomManagedProfileTest.java | 51 private void assertIsProvisioningAllowed(boolean expected, int userId) in assertIsProvisioningAllowed() argument 55 runDeviceTestsAsUser(MANAGED_PROFILE_PKG, ".PreManagedProfileTest", testName, userId); in assertIsProvisioningAllowed()
|
D | DeviceAndProfileOwnerTestApi25.java | 100 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()
|
D | CustomDeviceOwnerTest.java | 93 int userId = -1; in testCannotSetDeviceOwnerWhenSecondaryUserPresent() local 96 userId = createUser(); in testCannotSetDeviceOwnerWhenSecondaryUserPresent() 100 removeUser(userId); in testCannotSetDeviceOwnerWhenSecondaryUserPresent()
|
D | CrossProfileAppsHostSideTest.java | 43 private void installRequiredApps(int userId) in installRequiredApps() argument 45 installAppAsUser(EXTRA_TEST_APK, userId); in installRequiredApps() 46 installAppAsUser(SIMPLE_APP_APK, userId); in installRequiredApps()
|
D | ManagedProfileTest.java | 307 private void runProfileTimeoutTest(String method, int userId) in runProfileTimeoutTest() argument 310 method, userId); in runProfileTimeoutTest() 625 private void testCrossProfileCopyPasteInternal(int userId, boolean shouldSucceed) in testCrossProfileCopyPasteInternal() argument 627 final String direction = (userId == mParentUserId) in testCrossProfileCopyPasteInternal() 636 "testCanReadAcrossProfiles", userId); in testCrossProfileCopyPasteInternal() 638 "testIsNotified", userId); in testCrossProfileCopyPasteInternal() 641 "testCannotReadAcrossProfiles", userId); in testCrossProfileCopyPasteInternal() 958 private void setDirectoryPrefix(String directoryName, int userId) in setDirectoryPrefix() argument 961 + " --user " + userId in setDirectoryPrefix() 1059 private void givePackageWriteSettingsPermission(int userId, String pkg) throws Exception { in givePackageWriteSettingsPermission() argument [all …]
|
D | DeviceOwnerPlusProfileOwnerTest.java | 559 final int userId = createManagedProfile(mPrimaryUserId); in setupManagedProfile() local 560 installAppAsUser(apkName, userId); in setupManagedProfile() 561 setProfileOwnerOrFail(adminReceiverClassName, userId); in setupManagedProfile() 562 startUser(userId); in setupManagedProfile() 567 userId); in setupManagedProfile() 568 return userId; in setupManagedProfile()
|
/cts/hostsidetests/appsecurity/src/android/appsecurity/cts/ |
D | PackageVisibilityTest.java | 76 int userId = mUsers[1]; in testUninstalledPackageVisibility() local 77 assertTrue(userId > 0); in testUninstalledPackageVisibility() 78 getDevice().startUser(userId); in testUninstalledPackageVisibility() 79 installTestAppForUser(TEST_APK, userId); in testUninstalledPackageVisibility() 95 assertFalse(isAppVisibleForUser(TINY_PKG, userId, MATCH_NORMAL)); in testUninstalledPackageVisibility() 96 assertFalse(isAppVisibleForUser(TINY_PKG, userId, MATCH_UNINSTALLED)); in testUninstalledPackageVisibility() 100 ".PackageAccessTest", "testPackageAccess_notInOtherUser", userId); in testUninstalledPackageVisibility() local 102 ".PackageAccessTest", "testPackageAccess_notInOtherUserUninstalled", userId); in testUninstalledPackageVisibility() local 105 ".PackageAccessTest", "testPackageAccess_getPackagesCantSeeTiny", userId); in testUninstalledPackageVisibility() local 110 installTestAppForUser(TINY_APK, userId); in testUninstalledPackageVisibility() [all …]
|
D | BaseAppSecurityTest.java | 63 protected void installTestAppForUser(String apk, int userId) throws Exception { in installTestAppForUser() argument 64 if (userId < 0) { in installTestAppForUser() 65 userId = mPrimaryUserId; in installTestAppForUser() 69 buildHelper.getTestFile(apk), true, false, userId, "-t")); in installTestAppForUser() local 72 protected boolean isAppVisibleForUser(String packageName, int userId, in isAppVisibleForUser() argument 74 String command = "cmd package list packages --user " + userId; in isAppVisibleForUser()
|
D | InstantAppUserTest.java | 190 String testMethodName, int userId) in runDeviceTestsAsUser() argument 192 Utils.runDeviceTests(getDevice(), packageName, testClassName, testMethodName, userId); in runDeviceTestsAsUser() local 205 private void installAppAsUser(String apk, int userId) throws Exception { in installAppAsUser() argument 210 private void replaceFullAppAsUser(String apk, int userId) throws Exception { in replaceFullAppAsUser() argument 213 buildHelper.getTestFile(apk), true, userId, "--full")); in replaceFullAppAsUser() local 216 private void installExistingInstantAppAsUser(String packageName, int userId) throws Exception { in installExistingInstantAppAsUser() argument 218 "Package " + packageName + " installed for user: " + userId + "\n"; in installExistingInstantAppAsUser() 222 + " --user " + Integer.toString(userId) in installExistingInstantAppAsUser() 226 private void installExistingFullAppAsUser(String packageName, int userId) throws Exception { in installExistingFullAppAsUser() argument 228 "Package " + packageName + " installed for user: " + userId + "\n"; in installExistingFullAppAsUser() [all …]
|
D | Utils.java | 47 String testMethodName, int userId) throws DeviceNotAvailableException { in runDeviceTests() argument 48 runDeviceTests(device, packageName, testClassName, testMethodName, userId, null); in runDeviceTests() 52 String testMethodName, int userId, Map<String, String> testArgs) in runDeviceTests() argument 55 runDeviceTests(device, packageName, testClassName, testMethodName, userId, testArgs, in runDeviceTests() 60 String testMethodName, int userId, Map<String, String> testArgs, long timeout, in runDeviceTests() argument 83 device.runInstrumentationTestsAsUser(testRunner, userId, listener); in runDeviceTests()
|
D | ExternalStorageHostTest.java | 350 private void enableWriteSettings(String packageName, int userId) in enableWriteSettings() argument 354 cmd.append(userId); in enableWriteSettings() 371 private void runDeviceTests(String packageName, String testClassName, int userId) in runDeviceTests() argument 373 runDeviceTests(getDevice(), packageName, testClassName, null, userId, null); in runDeviceTests() local 377 int userId) throws DeviceNotAvailableException { in runDeviceTests() argument 378 runDeviceTests(getDevice(), packageName, testClassName, testMethodName, userId, null); in runDeviceTests() local
|
/cts/hostsidetests/media/src/android/media/cts/ |
D | BaseMultiUserTest.java | 126 for (int userId : getDevice().listUsers()) { in tearDown() 127 if (!mExistingUsers.contains(userId)) { in tearDown() 128 removeUser(userId); in tearDown() 153 protected void installAppAsUser(String appFileName, int userId, boolean asInstantApp) in installAppAsUser() argument 155 CLog.d("Installing app " + appFileName + " for user " + userId); in installAppAsUser() 161 userId, in installAppAsUser() 164 assertNull("Failed to install " + appFileName + " for user " + userId + ": " + result, in installAppAsUser() 189 int userId = Integer.parseInt(tokens[tokens.length-1]); in createAndStartUser() local 192 getDevice().startUser(userId); in createAndStartUser() 193 return userId; in createAndStartUser() [all …]
|
/cts/hostsidetests/numberblocking/src/com/android/cts/numberblocking/hostside/ |
D | NumberBlockingTest.java | 150 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/ |
D | BaseShortcutManagerHostTest.java | 98 protected void clearShortcuts(String packageName, int userId) throws Exception { in clearShortcuts() argument 100 getDevice().executeShellCommand("cmd shortcut clear-shortcuts --user " + userId in clearShortcuts() 104 protected void installAppAsUser(String appFileName, int userId) throws FileNotFoundException, in installAppAsUser() argument 106 CLog.i("Installing app " + appFileName + " for user " + userId); in installAppAsUser() 109 buildHelper.getTestFile(appFileName), true, true, userId, "-t"); in installAppAsUser() 110 assertNull("Failed to install " + appFileName + " for user " + userId + ": " + result, in installAppAsUser() 120 String pkgName, @Nullable String testClassName, int userId) in runDeviceTestsAsUser() argument 122 runDeviceTestsAsUser(pkgName, testClassName, null /*testMethodName*/, userId); in runDeviceTestsAsUser() 127 String pkgName, @Nullable String testClassName, String testMethodName, int userId) in runDeviceTestsAsUser() argument 130 runDeviceTestsAsUser(pkgName, testClassName, testMethodName, userId, params); in runDeviceTestsAsUser() [all …]
|
/cts/hostsidetests/media/src/android/media/session/cts/ |
D | MediaSessionManagerHostTest.java | 77 for (int userId : mNotificationListeners) { in tearDown() 78 setAllowGetActiveSessionForTest(false, userId); in tearDown() 243 private void runTestAsUser(String testMethodName, int userId) in runTestAsUser() argument 246 testMethodName, userId); in runTestAsUser() 259 private void setAllowGetActiveSessionForTest(boolean allow, int userId) throws Exception { in setAllowGetActiveSessionForTest() argument 263 + notificationListener + " " + userId; in setAllowGetActiveSessionForTest() 266 mNotificationListeners.add(userId); in setAllowGetActiveSessionForTest() 270 private void sendControlCommand(int userId, int flag) throws Exception { in sendControlCommand() argument 271 executeShellCommand(MediaSessionTestHelperConstants.buildControlCommand(userId, flag)); in sendControlCommand()
|
/cts/hostsidetests/multiuser/src/android/host/multiuser/ |
D | BaseMultiUserTest.java | 76 protected int createRestrictedProfile(int userId) in createRestrictedProfile() argument 78 final String command = "pm create-user --profileOf " + userId + " --restricted " in createRestrictedProfile() 120 for (int userId : getDevice().listUsers()) { in removeTestUsers() 121 if (!mFixedUsers.contains(userId)) { in removeTestUsers() 122 getDevice().removeUser(userId); in removeTestUsers()
|
D | CreateUsersNoAppCrashesTest.java | 67 int userId = getDevice().createUser( in testCanCreateGuestUser() local 71 assertSwitchToNewUser(userId); in testCanCreateGuestUser() 72 assertSwitchToUser(userId, mInitialUserId); in testCanCreateGuestUser() 82 int userId = getDevice().createUser( in testCanCreateSecondaryUser() local 86 assertSwitchToNewUser(userId); in testCanCreateSecondaryUser() 87 assertSwitchToUser(userId, mInitialUserId); in testCanCreateSecondaryUser()
|
/cts/hostsidetests/media/common/android/media/cts/ |
D | MediaSessionTestHelperConstants.java | 86 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/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/ |
D | SecurityLoggingTest.java | 566 final int userId = Process.myUserHandle().getIdentifier(); in verifyPasswordComplexityEventsPresent() local 570 userId, // admin user in verifyPasswordComplexityEventsPresent() 571 userId, // target user in verifyPasswordComplexityEventsPresent() 612 final int userId = Process.myUserHandle().getIdentifier(); in verifyLockingPolicyEventsPresent() local 617 getInt(e, ADMIN_USER_INDEX) == userId && in verifyLockingPolicyEventsPresent() 618 getInt(e, TARGET_USER_INDEX) == userId && in verifyLockingPolicyEventsPresent() 624 getInt(e, ADMIN_USER_INDEX) == userId && in verifyLockingPolicyEventsPresent() 625 getInt(e, TARGET_USER_INDEX) == userId && in verifyLockingPolicyEventsPresent() 631 getInt(e, ADMIN_USER_INDEX) == userId && in verifyLockingPolicyEventsPresent() 632 getInt(e, TARGET_USER_INDEX) == userId && in verifyLockingPolicyEventsPresent() [all …]
|