Home
last modified time | relevance | path

Searched refs:mDpm (Results 1 – 25 of 34) sorted by relevance

12

/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DCommandReceiverActivity.java187 private DevicePolicyManager mDpm; field in CommandReceiverActivity
201 mDpm = useCurrentUserDpm in onCreate()
214 Log.i(TAG, "Setting '" + restrictionKey + "'=" + enforced + " using " + mDpm in onCreate()
217 mDpm.addUserRestriction(mAdmin, restrictionKey); in onCreate()
219 mDpm.clearUserRestriction(mAdmin, restrictionKey); in onCreate()
224 mDpm.setKeyguardDisabledFeatures(mAdmin, enforced in onCreate()
229 mDpm.setAutoTimeRequired(mAdmin, in onCreate()
234 mDpm.setDeviceOwnerLockScreenInfo(mAdmin, intent.getStringExtra(EXTRA_VALUE)); in onCreate()
239 mDpm.setMaximumTimeToLock(mAdmin, in onCreate()
249 mDpm.setKeyguardDisabled(mAdmin, enforced); in onCreate()
[all …]
DSetSupportMessageActivity.java41 private DevicePolicyManager mDpm; field in SetSupportMessageActivity
61 mDpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); in onCreate()
65 ? mDpm.getShortSupportMessage(mAdmin) in onCreate()
66 : mDpm.getLongSupportMessage(mAdmin)); in onCreate()
86 mDpm.setShortSupportMessage(mAdmin, message); in onClick()
88 mDpm.setLongSupportMessage(mAdmin, message); in onClick()
DWorkProfileWidgetActivity.java34 private DevicePolicyManager mDpm; field in WorkProfileWidgetActivity
48 mDpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); in onCreate()
65 mDpm.addCrossProfileWidgetProvider(getAdminComponent(), getPackageName()); in allowToAddCtsVerifierWidget()
69 mDpm.removeCrossProfileWidgetProvider(getAdminComponent(), getPackageName()); in disallowToAddCtsVerifierWidget()
/cts/hostsidetests/devicepolicy/app/CertInstaller/src/com/android/cts/certinstaller/
DDirectDelegatedCertInstallerTest.java71 private DevicePolicyManager mDpm; field in DirectDelegatedCertInstallerTest
82 mDpm = getContext().getSystemService(DevicePolicyManager.class); in setUp()
93 mDpm.uninstallCaCert(null, TEST_CA.getBytes()); in tearDown()
94 mDpm.removeKeyPair(null, TEST_ALIAS); in tearDown()
109 + " beginning of the test").that(mDpm.hasCaCertInstalled(null, cert)).isFalse(); in testCaCertsOperations()
113 mDpm.installCaCert(null, cert)).isTrue(); in testCaCertsOperations()
115 mDpm.hasCaCertInstalled(null, cert)).isTrue(); in testCaCertsOperations()
119 containsCertificate(mDpm.getInstalledCaCerts(null), cert)).isTrue(); in testCaCertsOperations()
125 mDpm.uninstallCaCert(null, cert); in testCaCertsOperations()
127 mDpm.hasCaCertInstalled(null, cert)).isFalse(); in testCaCertsOperations()
[all …]
DDelegatedDeviceIdAttestationTest.java24 private DevicePolicyManager mDpm; field in DelegatedDeviceIdAttestationTest
29 mDpm = getInstrumentation().getContext().getSystemService(DevicePolicyManager.class); in setUp()
34 if (mDpm.isDeviceIdAttestationSupported()) { in testGenerateKeyPairWithDeviceIdAttestationExpectingSuccess()
35 KeyGenerationUtils.generateKeyWithDeviceIdAttestationExpectingSuccess(mDpm, null); in testGenerateKeyPairWithDeviceIdAttestationExpectingSuccess()
41 KeyGenerationUtils.generateKeyWithDeviceIdAttestationExpectingFailure(mDpm, null); in testGenerateKeyPairWithDeviceIdAttestationExpectingFailure()
DCertSelectionDelegateTest.java65 private DevicePolicyManager mDpm; field in CertSelectionDelegateTest
85 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
100 assertThat(mDpm.getDelegatedScopes(null, mContext.getPackageName())).contains( in testCanSelectKeychainKeypairs()
107 assertThat(mDpm.installKeyPair(null, privKey, cert, alias)).isTrue(); in testCanSelectKeychainKeypairs()
115 assertThat(mDpm.removeKeyPair(null, alias)).isTrue(); in testCanSelectKeychainKeypairs()
124 assertThat(mDpm.getDelegatedScopes(null, mContext.getPackageName())).contains( in testNotChosenAnyAlias()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DDelegatedCertInstallerHelper.java41 private DevicePolicyManager mDpm; field in DelegatedCertInstallerHelper
46 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
55 mDpm.setDelegatedScopes(ADMIN_RECEIVER_COMPONENT, CERT_INSTALLER_PACKAGE, in testManualSetCertInstallerDelegate()
57 assertTrue(mDpm.getDelegatePackages(ADMIN_RECEIVER_COMPONENT, in testManualSetCertInstallerDelegate()
59 assertTrue(mDpm.getDelegatePackages(ADMIN_RECEIVER_COMPONENT, in testManualSetCertInstallerDelegate()
64 mDpm.setDelegatedScopes(ADMIN_RECEIVER_COMPONENT, CERT_INSTALLER_PACKAGE, Arrays.asList()); in testManualClearCertInstallerDelegate()
65 assertFalse(mDpm.getDelegatePackages(ADMIN_RECEIVER_COMPONENT, in testManualClearCertInstallerDelegate()
67 assertFalse(mDpm.getDelegatePackages(ADMIN_RECEIVER_COMPONENT, in testManualClearCertInstallerDelegate()
72 KeyGenerationUtils.generateRsaKey(mDpm, ADMIN_RECEIVER_COMPONENT, PRE_SELECTED_ALIAS); in testManualGenerateKeyAndGrantAccess()
73 assertTrue(mDpm.grantKeyPairToApp(ADMIN_RECEIVER_COMPONENT, PRE_SELECTED_ALIAS, in testManualGenerateKeyAndGrantAccess()
[all …]
DDelegatedCertInstallerTest.java80 private DevicePolicyManager mDpm; field in DelegatedCertInstallerTest
102 mDpm = (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); in setUp()
114 mDpm.uninstallCaCert(ADMIN_RECEIVER_COMPONENT, TestCertificates.TEST_CA.getBytes()); in tearDown()
117 mDpm.setCertInstallerPackage(ADMIN_RECEIVER_COMPONENT, null); in tearDown()
128 mDpm.setCertInstallerPackage(ADMIN_RECEIVER_COMPONENT, CERT_INSTALLER_PACKAGE); in testCaCertsOperations()
130 mDpm.getCertInstallerPackage(ADMIN_RECEIVER_COMPONENT)); in testCaCertsOperations()
138 assertTrue("Certificate is not installed properly", mDpm.hasCaCertInstalled( in testCaCertsOperations()
153 assertFalse("Certificate is not removed properly", mDpm.hasCaCertInstalled( in testCaCertsOperations()
162 mDpm.setCertInstallerPackage(ADMIN_RECEIVER_COMPONENT, null); in testCaCertsOperations()
172 mDpm.setCertInstallerPackage(ADMIN_RECEIVER_COMPONENT, null); in testInstallKeyPair()
[all …]
DPersonalAppsSuspensionTest.java49 private final DevicePolicyManager mDpm = mContext.getSystemService(DevicePolicyManager.class); field in PersonalAppsSuspensionTest
53 mDpm.setPersonalAppsSuspended(ADMIN, true); in testSuspendPersonalApps()
54 assertThat(mDpm.getPersonalAppsSuspendedReasons(ADMIN)) in testSuspendPersonalApps()
60 mDpm.setPersonalAppsSuspended(ADMIN, false); in testUnsuspendPersonalApps()
61 assertThat(mDpm.getPersonalAppsSuspendedReasons(ADMIN)) in testUnsuspendPersonalApps()
67 mDpm.setManagedProfileMaximumTimeOff(ADMIN, 1000); in testSetManagedProfileMaximumTimeOff1Sec()
72 mDpm.setManagedProfileMaximumTimeOff(ADMIN, TimeUnit.DAYS.toMillis(365)); in testSetManagedProfileMaximumTimeOff1Year()
113 assertThat(mDpm.isComplianceAcknowledgementRequired()).isFalse(); in testComplianceAcknowledgementNotRequired()
118 assertThat(mDpm.isComplianceAcknowledgementRequired()).isTrue(); in testAcknowledgeCompliance()
119 mDpm.acknowledgeDeviceCompliant(); in testAcknowledgeCompliance()
[all …]
DNetworkLoggingTest.java93 private DevicePolicyManager mDpm; field in NetworkLoggingTest
99 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
105 mDpm.setNetworkLoggingEnabled(ADMIN_RECEIVER_COMPONENT, true); in testSetNetworkLogsEnabled_true()
107 assertThat(mDpm.isNetworkLoggingEnabled(ADMIN_RECEIVER_COMPONENT)).isTrue(); in testSetNetworkLogsEnabled_true()
172 mDpm.setNetworkLoggingEnabled(ADMIN_RECEIVER_COMPONENT, false); in testSetNetworkLogsEnabled_false()
174 assertThat(mDpm.isNetworkLoggingEnabled(ADMIN_RECEIVER_COMPONENT)).isFalse(); in testSetNetworkLogsEnabled_false()
179 mDpm.setDelegatedScopes(ADMIN_RECEIVER_COMPONENT, DELEGATE_APP_PKG, in testSetDelegateScope_delegationNetworkLogging()
182 assertThat(mDpm.getDelegatedScopes(ADMIN_RECEIVER_COMPONENT, DELEGATE_APP_PKG)) in testSetDelegateScope_delegationNetworkLogging()
188 mDpm.setDelegatedScopes(ADMIN_RECEIVER_COMPONENT, DELEGATE_APP_PKG, in testSetDelegateScope_noDelegation()
191 assertThat(mDpm.getDelegatedScopes(ADMIN_RECEIVER_COMPONENT, DELEGATE_APP_PKG)) in testSetDelegateScope_noDelegation()
[all …]
/cts/hostsidetests/devicepolicy/app/DelegateApp/src/com/android/cts/delegate/
DPackageAccessDelegateTest.java42 mDpm.isApplicationHidden(null, TEST_APP_PKG); in testCannotAccessApis()
48 mDpm.setApplicationHidden(null, TEST_APP_PKG, true /* hide */); in testCannotAccessApis()
54 mDpm.isPackageSuspended(null, TEST_APP_PKG); in testCannotAccessApis()
60mDpm.setPackagesSuspended(null, new String[] {TEST_APP_PKG}, true /* suspend */); in testCannotAccessApis()
68 assertFalse("Package should not be hidden", mDpm.isApplicationHidden(null, TEST_APP_PKG)); in testCanAccessApis()
72 mDpm.setApplicationHidden(null, TEST_APP_PKG, true /* hide */)); in testCanAccessApis()
73 assertTrue("Package should be hidden", mDpm.isApplicationHidden(null, TEST_APP_PKG)); in testCanAccessApis()
76 assertFalse("Package should not be suspended", mDpm.isPackageSuspended(null, TEST_APP_PKG)); in testCanAccessApis()
79 String[] suspended = mDpm.setPackagesSuspended(null, new String[] {TEST_APP_PKG}, in testCanAccessApis()
82 assertTrue("Package should be suspended", mDpm.isPackageSuspended(null, TEST_APP_PKG)); in testCanAccessApis()
[all …]
DPermissionGrantDelegateTest.java47 mDpm.setPermissionPolicy(null, PERMISSION_POLICY_AUTO_GRANT); in testCannotAccessApis()
50 PERMISSION_POLICY_AUTO_GRANT == mDpm.getPermissionPolicy(null)); in testCannotAccessApis()
55 mDpm.setPermissionGrantState(null, TEST_APP_PKG, TEST_PERMISSION, in testCannotAccessApis()
62 mDpm.getPermissionGrantState(null, TEST_APP_PKG, TEST_PERMISSION); in testCannotAccessApis()
71 mDpm.setPermissionPolicy(null, PERMISSION_POLICY_AUTO_DENY); in testCanAccessApis()
73 PERMISSION_POLICY_AUTO_DENY == mDpm.getPermissionPolicy(null)); in testCanAccessApis()
77 mDpm.setPermissionGrantState(null, TEST_APP_PKG, TEST_PERMISSION, in testCanAccessApis()
82 mDpm.getPermissionGrantState(null, TEST_APP_PKG, TEST_PERMISSION)); in testCanAccessApis()
87 final List<String> scopes = mDpm.getDelegatedScopes(null, packageName); in amIPermissionGrantDelegate()
DCertInstallDelegateTest.java50 mDpm.installCaCert(null, null); in testCannotAccessApis()
55 mDpm.removeKeyPair(null, "alias"); in testCannotAccessApis()
65 assertTrue("Certificate installation failed", mDpm.installCaCert(null, cert)); in testCanAccessApis()
68 assertTrue("Certificate is not installed properly", mDpm.hasCaCertInstalled(null, cert)); in testCanAccessApis()
72 containsCertificate(mDpm.getInstalledCaCerts(null), cert)); in testCanAccessApis()
75 mDpm.uninstallCaCert(null, cert); in testCanAccessApis()
76 assertFalse("Certificate was not uninstalled", mDpm.hasCaCertInstalled(null, cert)); in testCanAccessApis()
88 mDpm.installKeyPair(null, privatekey, certificate, alias)); in testCanAccessApis()
91 assertTrue("Key pair not removed successfully", mDpm.removeKeyPair(null, alias)); in testCanAccessApis()
113 final List<String> scopes = mDpm.getDelegatedScopes(null, packageName); in amICertInstallDelegate()
DSecurityLoggingDelegateTest.java62 () -> mDpm.isSecurityLoggingEnabled(null)); in testCannotAccessApis()
65 () -> mDpm.setSecurityLoggingEnabled(null, true)); in testCannotAccessApis()
68 () -> mDpm.retrieveSecurityLogs(null)); in testCannotAccessApis()
77 mDpm.setSecurityLoggingEnabled(null, true); in testEnablingSecurityLogging()
79 assertThat(mDpm.isSecurityLoggingEnabled(null)).isTrue(); in testEnablingSecurityLogging()
88 mDpm.retrieveSecurityLogs(null); in testGenerateLogs()
150 final List<SecurityEvent> logs = mDpm.retrieveSecurityLogs(null); in testSecurityLoggingRetrievalRateLimited()
153 assertThat(mDpm.retrieveSecurityLogs(null)).isNull(); in testSecurityLoggingRetrievalRateLimited()
154 assertThat(mDpm.retrieveSecurityLogs(null)).isNull(); in testSecurityLoggingRetrievalRateLimited()
164 mDpm.setSecurityLoggingEnabled(null, false); in testDisablingSecurityLogging()
[all …]
DBlockUninstallDelegateTest.java40 mDpm.setUninstallBlocked(null, TEST_APP_PKG, true); in testCannotAccessApis()
49 mDpm.setUninstallBlocked(null, TEST_APP_PKG, true); in testCanAccessApis()
50 assertTrue("App not uninstall blocked", mDpm.isUninstallBlocked(null, TEST_APP_PKG)); in testCanAccessApis()
52 mDpm.setUninstallBlocked(null, TEST_APP_PKG, false); in testCanAccessApis()
53 assertFalse("App still uninstall blocked", mDpm.isUninstallBlocked(null, TEST_APP_PKG)); in testCanAccessApis()
59 final List<String> scopes = mDpm.getDelegatedScopes(null, packageName); in amIBlockUninstallDelegate()
DNetworkLoggingDelegateTest.java84 assertThat(mDpm.getDelegatedScopes(null, mContext.getPackageName())).contains( in testCanAccessApis()
91 () -> mDpm.isNetworkLoggingEnabled(null)); in testCannotAccessApis()
94 () -> mDpm.setNetworkLoggingEnabled(null, true)); in testCannotAccessApis()
97 () -> mDpm.retrieveNetworkLogs(null, 0)); in testCannotAccessApis()
101 mDpm.setNetworkLoggingEnabled(null, true); in testNetworkLogging()
102 assertTrue(mDpm.isNetworkLoggingEnabled(null)); in testNetworkLogging()
112 mDpm.setNetworkLoggingEnabled(null, false); in testNetworkLogging()
113 assertFalse(mDpm.isNetworkLoggingEnabled(null)); in testNetworkLogging()
DAppRestrictionsDelegateTest.java90 mDpm.setApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG, null); in testCannotAccessApis()
95 mDpm.getApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG); in testCannotAccessApis()
102 mDpm.setApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG, BUNDLE_0); in testCanAccessApis()
103 assertBundle0(mDpm.getApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG)); in testCanAccessApis()
109 mDpm.setApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG, BUNDLE_1); in testCanAccessApis()
110 assertBundle1(mDpm.getApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG)); in testCanAccessApis()
113 mDpm.setApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG, new Bundle()); in testCanAccessApis()
115 mDpm.getApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG).isEmpty()); in testCanAccessApis()
163 final List<String> scopes = mDpm.getDelegatedScopes(null, mContext.getPackageName()); in amIAppRestrictionsDelegate()
DEnableSystemAppDelegateTest.java43 mDpm.enableSystemApp(null, TEST_APP_PKG); in testCannotAccessApis()
49 mDpm.enableSystemApp(null, new Intent().setPackage(TEST_APP_PKG)); in testCannotAccessApis()
60 mDpm.enableSystemApp(null, TEST_APP_PKG); in testCanAccessApis()
64 mDpm.enableSystemApp(null, new Intent()); in testCanAccessApis()
69 final List<String> scopes = mDpm.getDelegatedScopes(null, packageName); in amIEnableSystemAppDelegate()
DWorkProfileNetworkLoggingDelegateTest.java80 () -> mDpm.isNetworkLoggingEnabled(null)); in testCannotAccessApis()
83 () -> mDpm.setNetworkLoggingEnabled(null, true)); in testCannotAccessApis()
86 () -> mDpm.retrieveNetworkLogs(null, 0)); in testCannotAccessApis()
91 mDpm.setNetworkLoggingEnabled(null, true); in testSetNetworkLogsEnabled_true()
93 assertThat(mDpm.isNetworkLoggingEnabled(null)).isTrue(); in testSetNetworkLogsEnabled_true()
155 mDpm.setNetworkLoggingEnabled(null, false); in testSetNetworkLogsEnabled_false()
157 assertThat(mDpm.isNetworkLoggingEnabled(null)).isFalse(); in testSetNetworkLogsEnabled_false()
DBaseJUnit3TestCase.java35 protected DevicePolicyManager mDpm; field in BaseJUnit3TestCase
44 mDpm = BaseTestCase.getDpm(mContext); in setUp()
45 Log.d(TAG, getClass().getName() + ".setup(): dpm=" + mDpm); in setUp()
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/
DPrimaryUserAdminHelper.java28 private DevicePolicyManager mDpm; field in PrimaryUserAdminHelper
33 mDpm = (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); in setUp()
42 if (mDpm.isAdminActive(cn)) { in testClearDeviceAdmin()
43 mDpm.removeActiveAdmin(cn); in testClearDeviceAdmin()
45 for (int i = 0; i < 2 * 60 && mDpm.isAdminActive(cn); i++) { in testClearDeviceAdmin()
49 assertFalse("Clear device admin failed", mDpm.isAdminActive(cn)); in testClearDeviceAdmin()
DProfileTimeoutTestHelper.java38 private DevicePolicyManager mDpm; field in ProfileTimeoutTestHelper
44 mDpm = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); in setUp()
50 mDpm.setMaximumTimeToLock(ADMIN_COMPONENT, TIMEOUT_MS); in testSetWorkProfileTimeout()
52 TIMEOUT_MS, mDpm.getMaximumTimeToLock(ADMIN_COMPONENT)); in testSetWorkProfileTimeout()
64 assertTrue(mDpm.isProfileOwnerApp(ADMIN_COMPONENT.getPackageName())); in assertProfileOwner()
65 assertTrue(mDpm.isManagedProfile(ADMIN_COMPONENT)); in assertProfileOwner()
DNotificationListenerTest.java61 private DevicePolicyManager mDpm; field in NotificationListenerTest
68 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
86 mDpm.setPermittedCrossProfileNotificationListeners( in testSetEmptyAllowlist()
93 mDpm.setPermittedCrossProfileNotificationListeners( in testAddListenerToAllowlist()
100 mDpm.setPermittedCrossProfileNotificationListeners( in testSetNullAllowlist()
144 mDpm.setPermittedCrossProfileNotificationListeners( in testSetAndGetPermittedCrossProfileNotificationListeners()
146 List<String> actualPackageList = mDpm.getPermittedCrossProfileNotificationListeners( in testSetAndGetPermittedCrossProfileNotificationListeners()
/cts/tests/devicepolicy/src/android/devicepolicy/cts/
DCredentialManagementAppTest.java95 private final DevicePolicyManager mDpm = CONTEXT.getSystemService(DevicePolicyManager.class); field in CredentialManagementAppTest
103 () -> mDpm.installKeyPair(/* admin = */ null, PRIVATE_KEY, CERTIFICATES, in installKeyPair_withoutManageCredentialAppOp_throwsException()
112 () -> mDpm.removeKeyPair(/* admin = */ null, ALIAS)); in removeKeyPair_withoutManageCredentialAppOp_throwsException()
120 () -> mDpm.generateKeyPair(/* admin = */ null, "RSA", in generateKeyPair_withoutManageCredentialAppOp_throwsException()
131 () -> mDpm.setKeyPairCertificate(/* admin = */ null, ALIAS, in setKeyPairCertificate_withoutManageCredentialAppOp_throwsException()
140 () -> mDpm.installKeyPair(/* admin = */ null, PRIVATE_KEY, CERTIFICATES, in installKeyPair_isUserSelectableFlagSet_throwsException()
149 () -> mDpm.installKeyPair(/* admin = */ null, PRIVATE_KEY, CERTIFICATES, in installKeyPair_aliasIsNotInAuthenticationPolicy_throwsException()
159 assertThat(mDpm.installKeyPair(/* admin = */ null, PRIVATE_KEY, CERTIFICATES, in installKeyPair_isCredentialManagementApp_success()
163 mDpm.removeKeyPair(/* admin = */ null, ALIAS); in installKeyPair_isCredentialManagementApp_success()
174 assertThrows(SecurityException.class, () -> mDpm.hasKeyPair(NOT_IN_USER_POLICY_ALIAS)); in hasKeyPair_aliasIsNotInAuthenticationPolicy_throwsException()
[all …]
/cts/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/
DBindDeviceAdminServiceFailsTest.java36 private DevicePolicyManager mDpm; field in BindDeviceAdminServiceFailsTest
48 mDpm = (DevicePolicyManager) in setUp()
53 List<UserHandle> allowedTargetUsers = mDpm.getBindDeviceAdminTargetUsers( in testNoBindDeviceAdminTargetUsers()
80 return mDpm.bindDeviceAdminServiceAsUser(AdminReceiver.getComponentName(mContext), in bind()

12