Home
last modified time | relevance | path

Searched refs:dpm (Results 1 – 25 of 50) 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 …]
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.java36 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 …]
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()
/cts/hostsidetests/devicepolicy/app/common/src/com/android/cts/devicepolicy/
DDevicePolicySafetyCheckerIntegrationTester.java82 public final void testAllOperations(DevicePolicyManager dpm, ComponentName admin) { in testAllOperations() argument
83 Log.d(TAG, "testAllOperations: dpm=" + dpm + ", admin=" + admin); in testAllOperations()
84 Objects.requireNonNull(dpm); in testAllOperations()
88 safeOperationTest(dpm, admin, failures, operation, /* overloaded= */ false); in testAllOperations()
92 safeOperationTest(dpm, admin, failures, operation, /* overloaded= */ true); in testAllOperations()
96 safeOperationTest(dpm, admin, failures, operation, /* overloaded= */ false); in testAllOperations()
100 safeOperationTest(dpm, admin, failures, operation, /* overloaded= */ true); in testAllOperations()
111 public void testIsSafeOperation(DevicePolicyManager dpm) { in testIsSafeOperation() argument
114 Log.d(TAG, "testIsSafeOperation(): dpm=" + dpm + ", reason=" in testIsSafeOperation()
116 Objects.requireNonNull(dpm); in testIsSafeOperation()
[all …]
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DDevicePolicySafetyCheckerIntegrationTest.java140 protected void runOperation(DevicePolicyManager dpm, ComponentName admin, int operation,
144 dpm.createAndManageUser(admin, /* name= */ null, admin, /* adminExtras= */ null,
148 dpm.reboot(admin);
151 dpm.removeUser(admin, USER_HANDLE);
154 dpm.requestBugreport(admin);
157 dpm.setApplicationHidden(admin, TEST_PACKAGE, /* hidden= */true);
160 dpm.setApplicationRestrictions(admin, TEST_PACKAGE, new Bundle());
163 dpm.setCameraDisabled(admin, /* disabled= */ true);
166 dpm.setFactoryResetProtectionPolicy(admin,
173 dpm.setGlobalPrivateDnsModeOpportunistic(admin);
[all …]
DDefaultSmsApplicationTest.java34 DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class); in testSetDefaultSmsApplication() local
40 + ", isAffiliated=" + dpm.isAffiliatedUser()); in testSetDefaultSmsApplication()
42 dpm.setDefaultSmsApplication(getWho(), newSmsAppName); in testSetDefaultSmsApplication()
50 dpm.setDefaultSmsApplication(getWho(), previousSmsAppName); in testSetDefaultSmsApplication()
DSetPolicyActivity.java55 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/
DKeyGenerationUtils.java46 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/
DCrossProfileUtils.java66 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 …]
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.java56 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/
DUtils.java33 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()
DSetPolicyActivity.java68 DevicePolicyManager dpm = TestAppSystemServiceFactory.getDevicePolicyManager(this, in handleIntent() local
71 Log.i(TAG, "Command: " + command + " UID: " + Process.myUid() + " DPM: " + dpm); in handleIntent()
75 dpm.addUserRestriction(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, restrictionKey); in handleIntent()
80 dpm.clearUserRestriction( in handleIntent()
86 dpm.setAccountManagementDisabled(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, in handleIntent()
92 dpm.setAccountManagementDisabled(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, in handleIntent()
99 dpm.setApplicationRestrictionsManagingPackage( in handleIntent()
111 dpm.setDelegatedScopes(BaseDeviceAdminTest.ADMIN_RECEIVER_COMPONENT, in handleIntent()
DPasswordQualityAndComplexityTest.java67 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/
DDeviceAdminReceiverUtils.java61 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/
DCertInstallerReceiver.java77 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/tests/suspendapps/test-apps/TestDeviceAdmin/src/com/android/suspendapps/testdeviceadmin/
DTestCommsReceiver.java49 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/ProfileOwner/src/com/android/cts/profileowner/
DBaseProfileOwnerTest.java61 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/hostsidetests/devicepolicy/app/SeparateProfileChallenge/src/com/android/cts/separateprofilechallenge/
DSeparateProfileChallengePermissionsTest.java31 DevicePolicyManager dpm = (DevicePolicyManager) in testSeparateProfileChallengePermissions() local
33 assertNotNull(dpm); in testSeparateProfileChallengePermissions()
35 dpm.isSeparateProfileChallengeAllowed(0); /* Try to use USER_SYSTEM */ in testSeparateProfileChallengePermissions()
/cts/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/provisioning/
DUserRestrictionTest.java36 DevicePolicyManager dpm = getContext().getSystemService(DevicePolicyManager.class); in setUserRestriction() local
39 dpm.addUserRestriction(admin, restriction); in setUserRestriction()
41 dpm.clearUserRestriction(admin, restriction); in setUserRestriction()
DAffiliationTest.java42 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/TransferOwnerOutgoingApp/src/com/android/cts/transferowner/
DDeviceAndProfileOwnerTransferOutgoingTest.java174 DevicePolicyManager dpm = mContext.getSystemService(DevicePolicyManager.class); in setUserRestriction() local
176 dpm.addUserRestriction(mOutgoingComponentName, restriction); in setUserRestriction()
178 dpm.clearUserRestriction(mOutgoingComponentName, restriction); in setUserRestriction()
184 DevicePolicyManager dpm = (DevicePolicyManager) in setAffiliationId() local
187 dpm.setAffiliationIds(admin, ids); in setAffiliationId()
188 assertEquals(ids, dpm.getAffiliationIds(admin)); in setAffiliationId()
/cts/apps/EmptyDeviceOwner/src/com/android/cts/emptydeviceowner/
DDeviceOwnerChangedReceiver.java37 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onReceive() local
39 if (!dpm.isDeviceOwnerApp(packageName)) { in onReceive()
46 dpm.transferOwnership(EmptyDeviceAdmin.getComponentName(context), newAdmin, in onReceive()
DProfileOwnerChangedReceiver.java42 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onReceive() local
44 if (!dpm.isProfileOwnerApp(packageName)) { in onReceive()
51 dpm.transferOwnership(EmptyDeviceAdmin.getComponentName(context), newAdmin, in onReceive()

12