/cts/hostsidetests/devicepolicy/app/DeviceAdmin/src/com.android.cts.deviceadmin/ |
D | DeviceAdminWithEnterprisePoliciesBlockedTest.java | 27 boolean originalValue = dpm.getCameraDisabled(mAdminComponent); in testCameraDisabled() 28 assertSecurityException(() -> dpm.setCameraDisabled(mAdminComponent, true)); in testCameraDisabled() 29 assertEquals(originalValue, dpm.getCameraDisabled(mAdminComponent)); in testCameraDisabled() 33 int originalValue = dpm.getKeyguardDisabledFeatures(mAdminComponent); in testKeyguardDisabledFeatures() 34 assertSecurityException(() -> dpm.setKeyguardDisabledFeatures(mAdminComponent, in testKeyguardDisabledFeatures() 36 assertEquals(originalValue, dpm.getKeyguardDisabledFeatures(mAdminComponent)); in testKeyguardDisabledFeatures() 40 assertSecurityException(() -> dpm.isActivePasswordSufficient()); in testIsActivePasswordSufficient() 48 int originalValue = dpm.getPasswordHistoryLength(mAdminComponent); in testPasswordHistoryLength() 49 assertSecurityException(() -> dpm.setPasswordHistoryLength(mAdminComponent, 3)); in testPasswordHistoryLength() 50 assertEquals(originalValue, dpm.getPasswordHistoryLength(mAdminComponent)); in testPasswordHistoryLength() [all …]
|
D | DeviceOwnerPasswordTest.java | 47 dpm.setPasswordQuality(mAdminComponent, in testPasswordQuality_something() 50 dpm.getPasswordQuality(mAdminComponent)); in testPasswordQuality_something() 58 dpm.setPasswordMinimumLength(mAdminComponent, 10); in testPasswordQuality_something() 60 assertEquals(10, dpm.getPasswordMinimumLength(mAdminComponent)); in testPasswordQuality_something() 68 dpm.setPasswordMinimumLength(mAdminComponent, 4); in testPasswordQuality_something() 70 assertEquals(4, dpm.getPasswordMinimumLength( in testPasswordQuality_something() 80 dpm.setPasswordQuality(mAdminComponent, in testPasswordQuality_numeric() 83 dpm.getPasswordQuality(mAdminComponent)); in testPasswordQuality_numeric() 91 dpm.setPasswordMinimumLength(mAdminComponent, 10); in testPasswordQuality_numeric() 93 assertEquals(10, dpm.getPasswordMinimumLength(mAdminComponent)); in testPasswordQuality_numeric() [all …]
|
D | BaseDeviceAdminTest.java | 34 public DevicePolicyManager dpm; field in BaseDeviceAdminTest 40 dpm = mContext.getSystemService(DevicePolicyManager.class); in setUp() 59 return dpm.isDeviceOwnerApp(mAdminComponent.getPackageName()); in isDeviceOwner() 71 for (int i = 0; i < 1000 && dpm.isAdminActive(mAdminComponent); i++) { in assertNotActiveAdmin() 74 assertFalse("Still active admin", dpm.isAdminActive(mAdminComponent)); in assertNotActiveAdmin() 82 dpm.setPasswordMinimumLength(mAdminComponent, 0); in resetComplexPasswordRestrictions() 83 dpm.setPasswordMinimumUpperCase(mAdminComponent, 0); in resetComplexPasswordRestrictions() 84 dpm.setPasswordMinimumLowerCase(mAdminComponent, 0); in resetComplexPasswordRestrictions() 85 dpm.setPasswordMinimumLetters(mAdminComponent, 0); in resetComplexPasswordRestrictions() 86 dpm.setPasswordMinimumNumeric(mAdminComponent, 0); in resetComplexPasswordRestrictions() [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 | DeviceAdminPasswordTest.java | 39 assertTrue(dpm.resetPassword("1234", /* flags= */ 0)); in checkSetPassword_nycRestrictions_success() 44 assertFalse(dpm.resetPassword("1234", /* flags= */ 0)); in checkSetPassword_nycRestrictions_failure() 58 assertFalse(dpm.resetPassword("", /* flags= */ 0)); in checkClearPassword_nycRestrictions_failure() 71 final int currentQuality = dpm.getPasswordQuality(mAdminComponent); in waitUntilPasswordState() 72 dpm.setPasswordQuality(mAdminComponent, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING); in waitUntilPasswordState() 75 boolean result = dpm.isActivePasswordSufficient(); in waitUntilPasswordState() 79 result = dpm.isActivePasswordSufficient(); in waitUntilPasswordState() 82 dpm.setPasswordQuality(mAdminComponent, currentQuality); in waitUntilPasswordState()
|
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()
|
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/ |
D | CrossProfileUtils.java | 59 final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService( in testAddParentCanAccessManagedFilters() local 61 dpm.addCrossProfileIntentFilter(ADMIN_RECEIVER_COMPONENT, getIntentFilter(), in testAddParentCanAccessManagedFilters() 68 final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService( in testAddManagedCanAccessParentFilters() local 70 dpm.addCrossProfileIntentFilter(ADMIN_RECEIVER_COMPONENT, getIntentFilter(), in testAddManagedCanAccessParentFilters() 86 final DevicePolicyManager dpm = (DevicePolicyManager) getContext().getSystemService( in testRemoveAllFilters() local 88 dpm.clearCrossProfileIntentFilters(ADMIN_RECEIVER_COMPONENT); in testRemoveAllFilters() 92 DevicePolicyManager dpm = (DevicePolicyManager) in testDisallowCrossProfileCopyPaste() local 94 dpm.addUserRestriction(ADMIN_RECEIVER_COMPONENT, in testDisallowCrossProfileCopyPaste() 99 DevicePolicyManager dpm = (DevicePolicyManager) in testAllowCrossProfileCopyPaste() local 101 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 | 66 DevicePolicyManager dpm = (DevicePolicyManager) in handleIntent() local 73 dpm.addUserRestriction(BaseManagedProfileTest.ADMIN_RECEIVER_COMPONENT, restrictionKey); in handleIntent() 78 dpm.clearUserRestriction( in handleIntent() 84 dpm.addCrossProfileWidgetProvider(BaseManagedProfileTest.ADMIN_RECEIVER_COMPONENT, in handleIntent() 90 dpm.removeCrossProfileWidgetProvider(BaseManagedProfileTest.ADMIN_RECEIVER_COMPONENT, in handleIntent()
|
/cts/tests/security/src/android/keystore/cts/ |
D | KeyGenerationUtils.java | 46 private static void generateKeyWithIdFlagsExpectingSuccess(DevicePolicyManager dpm, in generateKeyWithIdFlagsExpectingSuccess() argument 49 AttestedKeyPair generated = dpm.generateKeyPair( in generateKeyWithIdFlagsExpectingSuccess() 54 assertThat(dpm.removeKeyPair(admin, ALIAS)).isTrue(); in generateKeyWithIdFlagsExpectingSuccess() 58 public static void generateKeyWithDeviceIdAttestationExpectingSuccess(DevicePolicyManager dpm, in generateKeyWithDeviceIdAttestationExpectingSuccess() argument 60 generateKeyWithIdFlagsExpectingSuccess(dpm, admin, ID_TYPE_SERIAL); in generateKeyWithDeviceIdAttestationExpectingSuccess() 63 public static void generateKeyWithDeviceIdAttestationExpectingFailure(DevicePolicyManager dpm, in generateKeyWithDeviceIdAttestationExpectingFailure() argument 66 () -> dpm.generateKeyPair(admin, "RSA", buildRsaKeySpecWithKeyAttestation(ALIAS), in generateKeyWithDeviceIdAttestationExpectingFailure()
|
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/ |
D | Utils.java | 29 final DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in removeActiveAdmin() local 30 if (dpm.isAdminActive(cn)) { in removeActiveAdmin() 31 dpm.removeActiveAdmin(cn); in removeActiveAdmin() 37 final DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in assertNotActiveAdmin() local 39 for (int i = 0; i < 1000 && dpm.isAdminActive(cn); i++) { in assertNotActiveAdmin() 42 Assert.assertFalse(dpm.isAdminActive(cn)); in assertNotActiveAdmin()
|
D | SetPolicyActivity.java | 73 DevicePolicyManager dpm = (DevicePolicyManager) in handleIntent() local 80 dpm.addUserRestriction(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, restrictionKey); in handleIntent() 85 dpm.clearUserRestriction( in handleIntent() 91 dpm.setAccountManagementDisabled(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, in handleIntent() 97 dpm.setAccountManagementDisabled(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, in handleIntent() 104 dpm.setApplicationRestrictionsManagingPackage( in handleIntent() 114 dpm.setDelegatedScopes(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, in handleIntent()
|
/cts/hostsidetests/devicepolicy/app/CertInstaller/src/com/android/cts/certinstaller/ |
D | CertInstallerReceiver.java | 74 DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService( in onReceive() local 83 if (dpm.hasCaCertInstalled(null, certBuffer)) { in onReceive() 86 if (!dpm.installCaCert(null, certBuffer)) { in onReceive() 89 if (!dpm.hasCaCertInstalled(null, certBuffer)) { in onReceive() 100 if (!dpm.hasCaCertInstalled(null, certBuffer)) { in onReceive() 103 dpm.uninstallCaCert(null, certBuffer); in onReceive() 104 sendResult(context, !dpm.hasCaCertInstalled(null, certBuffer), null); in onReceive() 112 sendResult(context, containsCertificate(dpm.getInstalledCaCerts(null), certBuffer), in onReceive() 138 sendResult(context, dpm.installKeyPair(null, privatekey, certificate, alias), in onReceive()
|
/cts/hostsidetests/devicepolicy/app/ProfileOwner/src/com/android/cts/profileowner/ |
D | BaseProfileOwnerTest.java | 42 static void assertProfileOwner(DevicePolicyManager dpm) { in assertProfileOwner() argument 43 assertNotNull(dpm); in assertProfileOwner() 44 assertTrue(dpm.isAdminActive(getWho())); in assertProfileOwner() 45 assertTrue(dpm.isProfileOwnerApp(PACKAGE_NAME)); in assertProfileOwner()
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ |
D | CompHelperActivity.java | 79 final DevicePolicyManager dpm = (DevicePolicyManager) getSystemService( in onCreate() local 85 dpm.setAlwaysOnVpnPackage(admin, getPackageName(), false /* lockdownEnabled */); in onCreate() 90 dpm.installCaCert(admin, TEST_CA.getBytes()); in onCreate() 92 dpm.setMaximumFailedPasswordsForWipe(admin, 100); in onCreate()
|
D | DeviceAdminTestReceiver.java | 113 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onEnabled() local 115 dpm.setAffiliationIds(admin, in onEnabled() 129 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onEnabled() local 131 dpm.setAffiliationIds(admin, in onEnabled() 133 dpm.logoutUser(admin); in onEnabled() 138 …DevicePolicyManager dpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SER… in setupProfile() local 139 dpm.setProfileEnabled(new ComponentName(context.getApplicationContext(), getClass())); in setupProfile() 184 dpm.addCrossProfileIntentFilter(getWho(context), filter, in setupProfile() 195 dpm.addCrossProfileIntentFilter(getWho(context), filter, in setupProfile()
|
D | CompDeviceAdminTestReceiver.java | 40 final DevicePolicyManager dpm = in onProfileProvisioningComplete() local 42 dpm.setProfileEnabled(new ComponentName(context.getApplicationContext(), getClass())); in onProfileProvisioningComplete() 50 dpm.addCrossProfileIntentFilter(getWho(context), filter, in onProfileProvisioningComplete()
|
D | ManagedUserPositiveTestActivity.java | 60 DevicePolicyManager dpm = getSystemService(DevicePolicyManager.class); in onCreate() local 61 if (dpm.isProfileOwnerApp(getPackageName()) && dpm.isAffiliatedUser()) { in onCreate() 99 DevicePolicyManager dpm = getSystemService(DevicePolicyManager.class); in finish() local 100 dpm.logoutUser(DeviceAdminTestReceiver.getReceiverComponentName()); in finish()
|
D | CrossProfileTestActivity.java | 72 … DevicePolicyManager dpm = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE); in isProfileOwner() local 73 … return dpm.isAdminActive(adminReceiver) && dpm.isProfileOwnerApp(adminReceiver.getPackageName()); in isProfileOwner()
|
/cts/hostsidetests/devicepolicy/app/TransferOwnerOutgoingApp/src/com/android/cts/transferowner/ |
D | DeviceAndProfileOwnerTransferOutgoingTest.java | 184 DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class); in setUserRestriction() local 186 dpm.addUserRestriction(mOutgoingComponentName, restriction); in setUserRestriction() 188 dpm.clearUserRestriction(mOutgoingComponentName, restriction); in setUserRestriction() 194 DevicePolicyManager dpm = (DevicePolicyManager) in setAffiliationId() local 197 dpm.setAffiliationIds(admin, ids); in setAffiliationId() 198 assertEquals(ids, dpm.getAffiliationIds(admin)); in setAffiliationId()
|
/cts/apps/EmptyDeviceOwner/src/com/android/cts/emptydeviceowner/ |
D | DeviceOwnerChangedReceiver.java | 33 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onReceive() local 34 if (!dpm.isDeviceOwnerApp(context.getPackageName())) { in onReceive() 38 dpm.transferOwnership( in onReceive()
|
/cts/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/provisioning/ |
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()
|
D | UserRestrictionTest.java | 53 DevicePolicyManager dpm = getContext().getSystemService(DevicePolicyManager.class); in setUserRestriction() local 56 dpm.addUserRestriction(admin, restriction); in setUserRestriction() 58 dpm.clearUserRestriction(admin, restriction); in setUserRestriction()
|
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/vpn/ |
D | VpnTestHelper.java | 109 final DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in waitForVpn() local 111 assertNotNull(dpm.getAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT)); in waitForVpn() 159 final DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in setAlwaysOnVpn() local 167 dpm.setAlwaysOnVpnPackage( in setAlwaysOnVpn() 169 assertEquals(packageName, dpm.getAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT)); in setAlwaysOnVpn() 170 assertEquals(lockdown, dpm.isAlwaysOnVpnLockdownEnabled(ADMIN_RECEIVER_COMPONENT)); in setAlwaysOnVpn() 172 dpm.getAlwaysOnVpnLockdownWhitelist(ADMIN_RECEIVER_COMPONENT)); in setAlwaysOnVpn()
|
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/ |
D | SetPolicyActivity.java | 62 DevicePolicyManager dpm = (DevicePolicyManager) in handleIntent() local 69 dpm.addUserRestriction(admin, restrictionKey); in handleIntent() 74 dpm.clearUserRestriction(admin, restrictionKey); in handleIntent()
|