/cts/hostsidetests/devicepolicy/app/DeviceAdmin/src/com.android.cts.deviceadmin/ |
D | DeviceAdminWithEnterprisePoliciesBlockedTest.java | 31 boolean originalValue = dpm.getCameraDisabled(mAdminComponent); in testCameraDisabled() 32 assertSecurityException(() -> dpm.setCameraDisabled(mAdminComponent, true)); in testCameraDisabled() 33 assertEquals(originalValue, dpm.getCameraDisabled(mAdminComponent)); in testCameraDisabled() 37 int originalValue = dpm.getKeyguardDisabledFeatures(mAdminComponent); in testKeyguardDisabledFeatures() 38 assertSecurityException(() -> dpm.setKeyguardDisabledFeatures(mAdminComponent, in testKeyguardDisabledFeatures() 40 assertEquals(originalValue, dpm.getKeyguardDisabledFeatures(mAdminComponent)); in testKeyguardDisabledFeatures() 44 assertSecurityException(() -> dpm.isActivePasswordSufficient()); in testIsActivePasswordSufficient() 52 int originalValue = dpm.getPasswordHistoryLength(mAdminComponent); in testPasswordHistoryLength() 53 assertSecurityException(() -> dpm.setPasswordHistoryLength(mAdminComponent, 3)); in testPasswordHistoryLength() 54 assertEquals(originalValue, dpm.getPasswordHistoryLength(mAdminComponent)); in testPasswordHistoryLength() [all …]
|
D | DeviceAdminTest.java | 47 dpm.setMaximumFailedPasswordsForWipe(mAdminComponent, 3); in testGetMaximumFailedPasswordsForWipe() 48 assertEquals(3, dpm.getMaximumFailedPasswordsForWipe(mAdminComponent)); in testGetMaximumFailedPasswordsForWipe() 50 dpm.setMaximumFailedPasswordsForWipe(mAdminComponent, 5); in testGetMaximumFailedPasswordsForWipe() 51 assertEquals(5, dpm.getMaximumFailedPasswordsForWipe(mAdminComponent)); in testGetMaximumFailedPasswordsForWipe() 60 dpm.setPasswordQuality(mAdminComponent, in testPasswordHistoryLength() 62 int originalValue = dpm.getPasswordHistoryLength(mAdminComponent); in testPasswordHistoryLength() 64 dpm.setPasswordHistoryLength(mAdminComponent, 3); in testPasswordHistoryLength() 65 assertEquals(3, dpm.getPasswordHistoryLength(mAdminComponent)); in testPasswordHistoryLength() 70 dpm.setPasswordHistoryLength(mAdminComponent, originalValue); in testPasswordHistoryLength() 78 long originalValue = dpm.getPasswordExpirationTimeout(mAdminComponent); in testPasswordExpirationTimeout() [all …]
|
D | BaseDeviceAdminTest.java | 36 public DevicePolicyManager dpm; field in BaseDeviceAdminTest 42 dpm = getContext().getSystemService(DevicePolicyManager.class); in setUp() 49 + ", isDO=" + dpm.isDeviceOwnerApp(mContext.getPackageName()) in setUp() 50 + ", isPO=" + dpm.isProfileOwnerApp(mContext.getPackageName())); in setUp() 65 return dpm.isDeviceOwnerApp(mAdminComponent.getPackageName()); in isDeviceOwner() 77 for (int i = 0; i < 1000 && dpm.isAdminActive(mAdminComponent); i++) { in assertNotActiveAdmin() 80 assertFalse("Still active admin", dpm.isAdminActive(mAdminComponent)); in assertNotActiveAdmin() 88 dpm.setPasswordMinimumLength(mAdminComponent, 0); in resetComplexPasswordRestrictions() 89 dpm.setPasswordMinimumUpperCase(mAdminComponent, 0); in resetComplexPasswordRestrictions() 90 dpm.setPasswordMinimumLowerCase(mAdminComponent, 0); in resetComplexPasswordRestrictions() [all …]
|
D | ClearDeviceAdminWithNoProtectionTest.java | 32 final DevicePolicyManager dpm = getContext().getSystemService(DevicePolicyManager.class); in testRemoveActiveAdmin() local 34 if (dpm.isAdminActive(cn)) { in testRemoveActiveAdmin() 35 dpm.removeActiveAdmin(cn); in testRemoveActiveAdmin() 36 for (int i = 0; i < 6000 && dpm.isAdminActive(cn); i++) { in testRemoveActiveAdmin() 40 assertFalse("Still active admin", dpm.isAdminActive(cn)); in testRemoveActiveAdmin()
|
D | ClearDeviceAdminTest.java | 27 if (dpm.isAdminActive(mAdminComponent)) { in testRemoveActiveAdmin() 28 dpm.removeActiveAdmin(mAdminComponent); in testRemoveActiveAdmin()
|
/cts/hostsidetests/devicepolicy/app/common/src/com/android/cts/devicepolicy/ |
D | DevicePolicySafetyCheckerIntegrationTester.java | 88 public final void testAllOperations(DevicePolicyManager dpm, ComponentName admin) { in testAllOperations() argument 89 Log.d(TAG, "testAllOperations(): dpm=" + dpm + ", admin=" + admin); in testAllOperations() 90 Objects.requireNonNull(dpm); in testAllOperations() 94 safeOperationTest(dpm, admin, failures, operation, /* overloaded= */ false); in testAllOperations() 98 safeOperationTest(dpm, admin, failures, operation, /* overloaded= */ true); in testAllOperations() 102 safeOperationTest(dpm, admin, failures, operation, /* overloaded= */ false); in testAllOperations() 106 safeOperationTest(dpm, admin, failures, operation, /* overloaded= */ true); in testAllOperations() 117 public void testIsSafeOperation(DevicePolicyManager dpm) { in testIsSafeOperation() argument 118 Log.d(TAG, "testIsSafeOperation(): dpm=" + dpm); in testIsSafeOperation() 121 Log.d(TAG, "testIsSafeOperation(): dpm=" + dpm + ", reason=" in testIsSafeOperation() [all …]
|
/cts/tests/devicepolicy/src/android/devicepolicy/cts/ |
D | NoAdminLeakingTest.java | 70 (dpm, who) -> dpm.getPasswordQuality(who)); in testPasswordQuality_adminPolicyNotAvailableToNonAdmin() 78 (dpm, who) -> dpm.getPasswordMinimumLength(who)); in testPasswordMinimumLength_adminPolicyNotAvailableToNonAdmin() 86 (dpm, who) -> dpm.getPasswordMinimumLetters(who)); in testPasswordMinimumLetters_adminPolicyNotAvailableToNonAdmin() 94 (dpm, who) -> dpm.getPasswordMinimumNonLetter(who)); in testPasswordMinimumNonLetter_adminPolicyNotAvailableToNonAdmin() 102 (dpm, who) -> dpm.getPasswordMinimumLowerCase(who)); in testPasswordMinimumLowerCase_adminPolicyNotAvailableToNonAdmin() 110 (dpm, who) -> dpm.getPasswordMinimumUpperCase(who)); in testPasswordMinimumUpperCase_adminPolicyNotAvailableToNonAdmin() 118 (dpm, who) -> dpm.getPasswordMinimumNumeric(who)); in testPasswordMinimumNumeric_adminPolicyNotAvailableToNonAdmin() 126 (dpm, who) -> dpm.getPasswordMinimumSymbols(who)); in testPasswordMinimumSymbols_adminPolicyNotAvailableToNonAdmin() 134 (dpm, who) -> dpm.getPasswordHistoryLength(who)); in testPasswordHistoryLength_adminPolicyNotAvailableToNonAdmin() 142 (dpm, who) -> dpm.getPasswordExpiration(who)); in testPasswordExpiration_adminPolicyNotAvailableToNonAdmin() [all …]
|
/cts/hostsidetests/settings/app/DeviceOwnerApp/src/com/google/android/cts/deviceowner/ |
D | ClearDeviceOwnerTest.java | 62 DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class); in removeProfileOwnerIfNeeeded() 64 boolean isPoBefore = dpm.isProfileOwnerApp(DeviceOwnerTest.PACKAGE_NAME); in removeProfileOwnerIfNeeeded() 67 dpm.clearProfileOwner(DeviceOwnerTest.RECEIVER_COMPONENT); in removeProfileOwnerIfNeeeded() 69 boolean isPo = dpm.isDeviceOwnerApp(DeviceOwnerTest.PACKAGE_NAME); in removeProfileOwnerIfNeeeded() 70 boolean isActiveAdminBefore = dpm.isAdminActive(DeviceOwnerTest.RECEIVER_COMPONENT); in removeProfileOwnerIfNeeeded() 73 waitUntilActiveAdminIsRemoved(dpm, DeviceOwnerTest.RECEIVER_COMPONENT); in removeProfileOwnerIfNeeeded() 77 .that(dpm.isAdminActive(DeviceOwnerTest.RECEIVER_COMPONENT)).isFalse(); in removeProfileOwnerIfNeeeded() 81 DevicePolicyManager dpm = TestAppSystemServiceFactory.getDevicePolicyManager(mContext, in removeDeviceOwner() local 83 Log.d(TAG, "removeDeviceOwner(): dpm=" + dpm); in removeDeviceOwner() 85 assertWithMessage("dpm for user %s", UserHandle.myUserId()).that(dpm).isNotNull(); in removeDeviceOwner() [all …]
|
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/ |
D | DevicePolicySafetyCheckerIntegrationTest.java | 143 protected void runOperation(DevicePolicyManager dpm, ComponentName admin, int operation, 147 dpm.createAndManageUser(admin, /* name= */ null, admin, /* adminExtras= */ null, 151 dpm.reboot(admin); 154 dpm.removeUser(admin, USER_HANDLE); 157 dpm.requestBugreport(admin); 160 dpm.setApplicationHidden(admin, TEST_PACKAGE, /* hidden= */true); 163 dpm.setApplicationRestrictions(admin, TEST_PACKAGE, new Bundle()); 166 dpm.setCameraDisabled(admin, /* disabled= */ true); 169 dpm.setFactoryResetProtectionPolicy(admin, 176 dpm.setGlobalPrivateDnsModeOpportunistic(admin); [all …]
|
D | SetPolicyActivity.java | 55 DevicePolicyManager dpm = TestAppSystemServiceFactory.getDevicePolicyManager(this, in handleIntent() local 58 Log.i(TAG, "Command: \"" + command + " DPM: " + dpm); in handleIntent() 62 dpm.addUserRestriction(admin, restrictionKey); in handleIntent() 67 dpm.clearUserRestriction(admin, restrictionKey); in handleIntent()
|
/cts/tests/security/src/android/keystore/cts/ |
D | KeyGenerationUtils.java | 46 private static AttestedKeyPair generateRsaKeyPair(DevicePolicyManager dpm, ComponentName admin, in generateRsaKeyPair() argument 48 return dpm.generateKeyPair( in generateRsaKeyPair() 53 private static void generateKeyWithIdFlagsExpectingSuccess(DevicePolicyManager dpm, in generateKeyWithIdFlagsExpectingSuccess() argument 57 generateRsaKeyPair(dpm, admin, deviceIdAttestationFlags, ALIAS); in generateKeyWithIdFlagsExpectingSuccess() 60 assertThat(dpm.removeKeyPair(admin, ALIAS)).isTrue(); in generateKeyWithIdFlagsExpectingSuccess() 64 public static void generateRsaKey(DevicePolicyManager dpm, ComponentName admin, String alias) { in generateRsaKey() argument 65 assertThat(generateRsaKeyPair(dpm, admin, 0, alias)).isNotNull(); in generateRsaKey() 68 public static void generateKeyWithDeviceIdAttestationExpectingSuccess(DevicePolicyManager dpm, in generateKeyWithDeviceIdAttestationExpectingSuccess() argument 70 generateKeyWithIdFlagsExpectingSuccess(dpm, admin, ID_TYPE_SERIAL); in generateKeyWithDeviceIdAttestationExpectingSuccess() 73 public static void generateKeyWithDeviceIdAttestationExpectingFailure(DevicePolicyManager dpm, in generateKeyWithDeviceIdAttestationExpectingFailure() argument [all …]
|
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/ |
D | CrossProfileUtils.java | 66 final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService( in testAddParentCanAccessManagedFilters() local 68 dpm.addCrossProfileIntentFilter(ADMIN_RECEIVER_COMPONENT, getIntentFilter(), in testAddParentCanAccessManagedFilters() 75 final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService( in testAddManagedCanAccessParentFilters() local 77 dpm.addCrossProfileIntentFilter(ADMIN_RECEIVER_COMPONENT, getIntentFilter(), in testAddManagedCanAccessParentFilters() 93 final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService( in testRemoveAllFilters() local 95 dpm.clearCrossProfileIntentFilters(ADMIN_RECEIVER_COMPONENT); in testRemoveAllFilters() 99 DevicePolicyManager dpm = (DevicePolicyManager) in testDisallowCrossProfileCopyPaste() local 101 dpm.addUserRestriction(ADMIN_RECEIVER_COMPONENT, in testDisallowCrossProfileCopyPaste() 106 DevicePolicyManager dpm = (DevicePolicyManager) in testAllowCrossProfileCopyPaste() local 108 dpm.clearUserRestriction(ADMIN_RECEIVER_COMPONENT, in testAllowCrossProfileCopyPaste() [all …]
|
D | WipeDataReceiver.java | 41 final DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onReceive() local 43 dpm.wipeData(0); in onReceive() 45 dpm.wipeData(0, TEST_WIPE_DATA_REASON); in onReceive() 47 dpm.wipeData(DevicePolicyManager.WIPE_SILENTLY); in onReceive()
|
D | SetPolicyActivity.java | 56 DevicePolicyManager dpm = (DevicePolicyManager) in handleIntent() local 63 dpm.addUserRestriction(BaseManagedProfileTest.ADMIN_RECEIVER_COMPONENT, restrictionKey); in handleIntent() 68 dpm.clearUserRestriction( in handleIntent() 74 dpm.addCrossProfileWidgetProvider(BaseManagedProfileTest.ADMIN_RECEIVER_COMPONENT, in handleIntent() 80 dpm.removeCrossProfileWidgetProvider(BaseManagedProfileTest.ADMIN_RECEIVER_COMPONENT, in handleIntent()
|
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/ |
D | Utils.java | 33 final DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in removeActiveAdmin() local 34 if (dpm.isAdminActive(cn)) { in removeActiveAdmin() 35 dpm.removeActiveAdmin(cn); in removeActiveAdmin() 41 final DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in assertNotActiveAdmin() local 43 for (int i = 0; i < 1000 && dpm.isAdminActive(cn); i++) { in assertNotActiveAdmin() 46 Assert.assertFalse(dpm.isAdminActive(cn)); in assertNotActiveAdmin()
|
D | SetPolicyActivity.java | 70 DevicePolicyManager dpm = TestAppSystemServiceFactory.getDevicePolicyManager(this, in handleIntent() local 73 Log.i(TAG, "Command: " + command + " UID: " + Process.myUid() + " DPM: " + dpm); in handleIntent() 77 dpm.addUserRestriction(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, restrictionKey); in handleIntent() 82 dpm.clearUserRestriction( in handleIntent() 88 dpm.setAccountManagementDisabled(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, in handleIntent() 94 dpm.setAccountManagementDisabled(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, in handleIntent() 101 dpm.setApplicationRestrictionsManagingPackage( in handleIntent() 113 dpm.setDelegatedScopes(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, in handleIntent()
|
D | PasswordQualityAndComplexityTest.java | 67 private static void clearQualityAndComplexity(DevicePolicyManager dpm) { in clearQualityAndComplexity() argument 69 dpm.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, PASSWORD_QUALITY_UNSPECIFIED); in clearQualityAndComplexity() 71 dpm.setRequiredPasswordComplexity(PASSWORD_COMPLEXITY_NONE); in clearQualityAndComplexity()
|
/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/enterprise/ |
D | DeviceAdminReceiverUtils.java | 61 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in disableSelf() local 63 if (dpm.isDeviceOwnerApp(packageName)) { in disableSelf() 65 dpm.clearDeviceOwnerApp(packageName); in disableSelf() 67 } else if (dpm.isProfileOwnerApp(packageName)) { in disableSelf() 68 ComponentName admin = dpm.getProfileOwner(); in disableSelf() 71 dpm.clearProfileOwner(admin); in disableSelf()
|
/cts/hostsidetests/devicepolicy/app/CertInstaller/src/com/android/cts/certinstaller/ |
D | CertInstallerReceiver.java | 77 DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( in onReceive() local 86 if (dpm.hasCaCertInstalled(null, certBuffer)) { in onReceive() 89 if (!dpm.installCaCert(null, certBuffer)) { in onReceive() 92 if (!dpm.hasCaCertInstalled(null, certBuffer)) { in onReceive() 103 if (!dpm.hasCaCertInstalled(null, certBuffer)) { in onReceive() 106 dpm.uninstallCaCert(null, certBuffer); in onReceive() 107 sendResult(context, !dpm.hasCaCertInstalled(null, certBuffer), null); in onReceive() 115 sendResult(context, containsCertificate(dpm.getInstalledCaCerts(null), certBuffer), in onReceive() 141 sendResult(context, dpm.installKeyPair(null, privatekey, certificate, alias), in onReceive() 149 final String esid = dpm.getEnrollmentSpecificId(); in onReceive()
|
/cts/hostsidetests/devicepolicy/app/SeparateProfileChallenge/src/com/android/cts/separateprofilechallenge/ |
D | SeparateProfileChallengePermissionsTest.java | 31 DevicePolicyManager dpm = (DevicePolicyManager) in testSeparateProfileChallengePermissions() local 33 assertNotNull(dpm); in testSeparateProfileChallengePermissions() 35 dpm.isSeparateProfileChallengeAllowed(0); /* Try to use USER_SYSTEM */ in testSeparateProfileChallengePermissions()
|
/cts/tests/suspendapps/test-apps/TestDeviceAdmin/src/com/android/suspendapps/testdeviceadmin/ |
D | TestCommsReceiver.java | 49 final DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onReceive() local 65 final String[] errored = dpm.setPackagesSuspended(deviceAdmin, in onReceive() 82 dpm.setUninstallBlocked(deviceAdmin, packageName, block); in onReceive() 90 dpm.addUserRestriction(deviceAdmin, userRestriction); in onReceive() 98 dpm.clearUserRestriction(deviceAdmin, userRestriction); in onReceive()
|
/cts/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/provisioning/ |
D | UserRestrictionTest.java | 36 DevicePolicyManager dpm = getContext().getSystemService(DevicePolicyManager.class); in setUserRestriction() local 39 dpm.addUserRestriction(admin, restriction); in setUserRestriction() 41 dpm.clearUserRestriction(admin, restriction); in setUserRestriction()
|
D | AffiliationTest.java | 42 DevicePolicyManager dpm = (DevicePolicyManager) in setAffiliationId() local 45 dpm.setAffiliationIds(admin, ids); in setAffiliationId() 46 assertEquals(ids, dpm.getAffiliationIds(admin)); in setAffiliationId()
|
/cts/hostsidetests/devicepolicy/app/ProfileOwner/src/com/android/cts/profileowner/ |
D | BaseProfileOwnerTest.java | 61 static void assertProfileOwner(DevicePolicyManager dpm) { in assertProfileOwner() argument 62 assertNotNull(dpm); in assertProfileOwner() 63 assertTrue(dpm.isAdminActive(getWho())); in assertProfileOwner() 64 assertTrue(dpm.isProfileOwnerApp(PACKAGE_NAME)); in assertProfileOwner()
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ |
D | DeviceAdminTestReceiver.java | 78 DevicePolicyManager dpm = getManager(context); in onReceive() 82 + ", dpm=" + dpm); in onReceive() 90 dpm.setAffiliationIds(getWho(context), ids); in onReceive() 91 Log.i(TAG, "Is affiliated: " + dpm.isAffiliatedUser()); in onReceive() 144 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onEnabled() local 146 dpm.setAffiliationIds(admin, in onEnabled() 162 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onEnabled() local 164 dpm.setAffiliationIds(admin, in onEnabled() 166 dpm.logoutUser(admin); in onEnabled() 171 …DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SER… in setupProfile() local [all …]
|