Home
last modified time | relevance | path

Searched refs:dpm (Results 1 – 25 of 41) sorted by relevance

12

/cts/hostsidetests/devicepolicy/app/DeviceAdmin/src/com.android.cts.deviceadmin/
DDeviceAdminWithEnterprisePoliciesBlockedTest.java27 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 …]
DDeviceOwnerPasswordTest.java47 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 …]
DDeviceAdminTest.java47 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 …]
DBaseDeviceAdminTest.java34 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 …]
DDeviceAdminPasswordTest.java39 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()
DClearDeviceAdminWithNoProtectionTest.java32 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()
DClearDeviceAdminTest.java27 if (dpm.isAdminActive(mAdminComponent)) { in testRemoveActiveAdmin()
28 dpm.removeActiveAdmin(mAdminComponent); in testRemoveActiveAdmin()
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/
DCrossProfileUtils.java59 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 …]
DWipeDataReceiver.java41 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()
DSetPolicyActivity.java66 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/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DUtils.java29 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()
DSetPolicyActivity.java73 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/tests/security/src/android/keystore/cts/
DKeyGenerationUtils.java46 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/CertInstaller/src/com/android/cts/certinstaller/
DCertInstallerReceiver.java74 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/
DBaseProfileOwnerTest.java42 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()
DManagementTest.java26 DevicePolicyManager dpm = (DevicePolicyManager) in testProvisionManagedProfileNotAllowed() local
28 assertFalse(dpm.isProvisioningAllowed( in testProvisionManagedProfileNotAllowed()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DCompHelperActivity.java79 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()
DCompDeviceAdminTestReceiver.java40 final DevicePolicyManager dpm = in onProfileProvisioningComplete() local
42 dpm.setProfileEnabled(new ComponentName(context.getApplicationContext(), getClass())); in onProfileProvisioningComplete()
50 dpm.addCrossProfileIntentFilter(getWho(context), filter, in onProfileProvisioningComplete()
DDeviceAdminTestReceiver.java113 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()
DCrossProfileTestActivity.java72 … DevicePolicyManager dpm = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE); in isProfileOwner() local
73 … return dpm.isAdminActive(adminReceiver) && dpm.isProfileOwnerApp(adminReceiver.getPackageName()); in isProfileOwner()
/cts/apps/EmptyDeviceOwner/src/com/android/cts/emptydeviceowner/
DDeviceOwnerChangedReceiver.java33 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/
DAffiliationTest.java42 DevicePolicyManager dpm = (DevicePolicyManager) in setAffiliationId() local
45 dpm.setAffiliationIds(admin, ids); in setAffiliationId()
46 assertEquals(ids, dpm.getAffiliationIds(admin)); in setAffiliationId()
DUserRestrictionTest.java53 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/TransferOwnerOutgoingApp/src/com/android/cts/transferowner/
DDeviceAndProfileOwnerTransferOutgoingTest.java184 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/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DSetPolicyActivity.java62 DevicePolicyManager dpm = (DevicePolicyManager) in handleIntent() local
69 dpm.addUserRestriction(admin, restrictionKey); in handleIntent()
74 dpm.clearUserRestriction(admin, restrictionKey); in handleIntent()

12