Home
last modified time | relevance | path

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

123

/cts/hostsidetests/devicepolicy/app/DeviceAdmin/src/com.android.cts.deviceadmin/
DDeviceAdminWithEnterprisePoliciesBlockedTest.java31 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 …]
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/tests/devicepolicy/src/android/devicepolicy/cts/
DNoAdminLeakingTest.java70 (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 …]
DNearbyAppStreamingPolicyTest.java70 RemoteDevicePolicyManager dpm = sDeviceState.dpc().devicePolicyManager(); in getNearbyAppStreamingPolicy_defaultToSameManagedAccountOnly() local
72 assertThat(dpm.getNearbyAppStreamingPolicy()) in getNearbyAppStreamingPolicy_defaultToSameManagedAccountOnly()
83 RemoteDevicePolicyManager dpm = sDeviceState.dpc().devicePolicyManager(); in getNearbyAppStreamingPolicy_policyIsNotAllowedToBeSet_throwsException() local
85 assertThrows(SecurityException.class, () -> dpm.getNearbyAppStreamingPolicy()); in getNearbyAppStreamingPolicy_policyIsNotAllowedToBeSet_throwsException()
90 RemoteDevicePolicyManager dpm = sDeviceState.dpc().devicePolicyManager(); in setNearbyAppStreamingPolicy_policyApplied_works() local
91 int originalPolicy = dpm.getNearbyAppStreamingPolicy(); in setNearbyAppStreamingPolicy_policyApplied_works()
93 dpm.setNearbyAppStreamingPolicy(DevicePolicyManager.NEARBY_STREAMING_DISABLED); in setNearbyAppStreamingPolicy_policyApplied_works()
96 assertThat(dpm.getNearbyAppStreamingPolicy()) in setNearbyAppStreamingPolicy_policyApplied_works()
99 dpm.setNearbyAppStreamingPolicy(originalPolicy); in setNearbyAppStreamingPolicy_policyApplied_works()
106 RemoteDevicePolicyManager dpm = sDeviceState.dpc().devicePolicyManager(); in setNearbyAppStreamingPolicy_policyApplied_otherUsersUnaffected() local
[all …]
DNearbyNotificationStreamingPolicyTest.java88 RemoteDevicePolicyManager dpm = sDeviceState.dpc().devicePolicyManager(); in setNearbyNotificationStreamingPolicy_policyApplied_works() local
89 int originalPolicy = dpm.getNearbyNotificationStreamingPolicy(); in setNearbyNotificationStreamingPolicy_policyApplied_works()
91 dpm.setNearbyNotificationStreamingPolicy(DevicePolicyManager.NEARBY_STREAMING_DISABLED); in setNearbyNotificationStreamingPolicy_policyApplied_works()
94 assertThat(dpm.getNearbyNotificationStreamingPolicy()) in setNearbyNotificationStreamingPolicy_policyApplied_works()
97 dpm.setNearbyNotificationStreamingPolicy(originalPolicy); in setNearbyNotificationStreamingPolicy_policyApplied_works()
104 RemoteDevicePolicyManager dpm = sDeviceState.dpc().devicePolicyManager(); in setNearbyNotificationStreamingPolicy_policyApplied_otherUsersUnaffected() local
106 int originalPolicy = dpm.getNearbyNotificationStreamingPolicy(); in setNearbyNotificationStreamingPolicy_policyApplied_otherUsersUnaffected()
108 dpm.setNearbyNotificationStreamingPolicy(DevicePolicyManager.NEARBY_STREAMING_DISABLED); in setNearbyNotificationStreamingPolicy_policyApplied_otherUsersUnaffected()
114 dpm.setNearbyNotificationStreamingPolicy(originalPolicy); in setNearbyNotificationStreamingPolicy_policyApplied_otherUsersUnaffected()
120 RemoteDevicePolicyManager dpm = sDeviceState.dpc().devicePolicyManager(); in setNearbyNotificationStreamingPolicy_policyIsNotAllowedToBeSet_throwsException() local
[all …]
DManagedProfileContactsAccessTest.java209 DevicePolicyManager dpm = ctx.getSystemService(DevicePolicyManager.class); in hasManagedProfileContactsAccess_blocklistPackages_hasProperAccess() local
210 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_blocklistPackages_hasProperAccess()
212 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_blocklistPackages_hasProperAccess()
214 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_blocklistPackages_hasProperAccess()
230 DevicePolicyManager dpm = ctx.getSystemService(DevicePolicyManager.class); in hasManagedProfileContactsAccess_allowlistPackages_hasProperAccess() local
231 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistPackages_hasProperAccess()
233 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistPackages_hasProperAccess()
235 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistPackages_hasProperAccess()
253 DevicePolicyManager dpm = ctx.getSystemService(DevicePolicyManager.class); in hasManagedProfileContactsAccess_allowlistAndSystemPackages_hasProperAccess() local
254 assertThat(dpm.hasManagedProfileContactsAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileContactsAccess_allowlistAndSystemPackages_hasProperAccess()
[all …]
DManagedProfileCallerIdAccessTest.java209 DevicePolicyManager dpm = ctx.getSystemService(DevicePolicyManager.class); in hasManagedProfileCallerIdAccess_blocklistPackages_hasProperAccess() local
210 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_blocklistPackages_hasProperAccess()
212 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_blocklistPackages_hasProperAccess()
214 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_blocklistPackages_hasProperAccess()
230 DevicePolicyManager dpm = ctx.getSystemService(DevicePolicyManager.class); in hasManagedProfileCallerIdAccess_allowlistPackages_hasProperAccess() local
231 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistPackages_hasProperAccess()
233 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistPackages_hasProperAccess()
235 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistPackages_hasProperAccess()
253 DevicePolicyManager dpm = ctx.getSystemService(DevicePolicyManager.class); in hasManagedProfileCallerIdAccess_allowlistAndSystemPackages_hasProperAccess() local
254 assertThat(dpm.hasManagedProfileCallerIdAccess(sDeviceState.workProfile().userHandle(), in hasManagedProfileCallerIdAccess_allowlistAndSystemPackages_hasProperAccess()
[all …]
/cts/hostsidetests/devicepolicy/app/common/src/com/android/cts/devicepolicy/
DDevicePolicySafetyCheckerIntegrationTester.java88 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 testUnsafeStateException(DevicePolicyManager dpm, ComponentName admin) { in testUnsafeStateException() argument
118 Log.d(TAG, "testUnsafeStateException(): dpm=" + dpm + ", admin=" + admin); in testUnsafeStateException()
123 Log.d(TAG, "testUnsafeStateException(): dpm=" + dpm + ", admin=" + admin in testUnsafeStateException()
[all …]
/cts/hostsidetests/settings/app/DeviceOwnerApp/src/com/google/android/cts/deviceowner/
DClearDeviceOwnerTest.java62 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/
DDevicePolicySafetyCheckerIntegrationTest.java143 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 …]
/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.java69 DevicePolicyManager dpm = getSystemService(DevicePolicyManager.class); 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()
/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/common/device-side/bedstead/nene/src/main/java/com/android/bedstead/nene/utils/
DDeviceAdminReceiverUtils.java62 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in disableSelf() local
64 if (dpm.isDeviceOwnerApp(packageName)) { in disableSelf()
66 dpm.clearDeviceOwnerApp(packageName); in disableSelf()
68 } else if (dpm.isProfileOwnerApp(packageName)) { in disableSelf()
69 ComponentName admin = dpm.getProfileOwner(); in disableSelf()
72 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/hostsidetests/securitybulletin/test-apps/CVE-2023-20917/src/android/security/cts/CVE_2023_20917/
DWorkProfileActivity.java32 DevicePolicyManager dpm = getSystemService(DevicePolicyManager.class); in onCreate() local
36 dpm.addUserRestriction( in onCreate()
39 dpm.clearUserRestriction( in onCreate()
/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/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DDeviceAdminTestReceiver.java80 DevicePolicyManager dpm = getManager(context); in onReceive()
84 + ", dpm=" + dpm); in onReceive()
93 dpm.setAffiliationIds(admin, ids); in onReceive()
94 if (dpm.isProfileOwnerApp(context.getPackageName()) && !dpm.isEphemeralUser(admin)) { in onReceive()
104 Log.i(TAG, "Is affiliated: " + dpm.isAffiliatedUser()); in onReceive()
157 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onEnabled() local
159 dpm.setAffiliationIds(admin, in onEnabled()
175 DevicePolicyManager dpm = context.getSystemService(DevicePolicyManager.class); in onEnabled() local
177 dpm.setAffiliationIds(admin, in onEnabled()
179 dpm.logoutUser(admin); in onEnabled()
[all …]
/cts/tests/devicepolicy/src/android/devicepolicy/cts/utils/
DPolicyEngineUtils.java54 DevicePolicyManager dpm = TestApis.context().instrumentedContext().getSystemService( in getBooleanPolicyState() local
56 DevicePolicyState state = dpm.getDevicePolicyState(); in getBooleanPolicyState()
73 DevicePolicyManager dpm = TestApis.context().instrumentedContext().getSystemService( in getStringSetPolicyState() local
75 DevicePolicyState state = dpm.getDevicePolicyState(); in getStringSetPolicyState()
92 DevicePolicyManager dpm = TestApis.context().instrumentedContext().getSystemService( in getLockTaskPolicyState() local
94 DevicePolicyState state = dpm.getDevicePolicyState(); in getLockTaskPolicyState()
106 DevicePolicyManager dpm = TestApis.context().instrumentedContext().getSystemService( in getComponentNamePolicyState() local
108 DevicePolicyState state = dpm.getDevicePolicyState(); in getComponentNamePolicyState()

123