Home
last modified time | relevance | path

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

12

/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DCommandReceiverActivity.java180 private DevicePolicyManager mDpm; field in CommandReceiverActivity
188 mDpm = (DevicePolicyManager) getSystemService( in onCreate()
199 mDpm.addUserRestriction(mAdmin, restrictionKey); in onCreate()
201 mDpm.clearUserRestriction(mAdmin, restrictionKey); in onCreate()
206 mDpm.setKeyguardDisabledFeatures(mAdmin, enforced in onCreate()
211 mDpm.setAutoTimeRequired(mAdmin, in onCreate()
216 mDpm.setDeviceOwnerLockScreenInfo(mAdmin, intent.getStringExtra(EXTRA_VALUE)); in onCreate()
221 mDpm.setMaximumTimeToLock(mAdmin, in onCreate()
226 mDpm.setPasswordQuality(mAdmin, quality); in onCreate()
235 mDpm.setKeyguardDisabled(mAdmin, enforced); in onCreate()
[all …]
DSetSupportMessageActivity.java40 private DevicePolicyManager mDpm; field in SetSupportMessageActivity
55 mDpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); in onCreate()
59 ? mDpm.getShortSupportMessage(mAdmin) in onCreate()
60 : mDpm.getLongSupportMessage(mAdmin)); in onCreate()
80 mDpm.setShortSupportMessage(mAdmin, message); in onClick()
82 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()
DKeyguardDisabledFeaturesActivity.java41 protected DevicePolicyManager mDpm; field in KeyguardDisabledFeaturesActivity
60 mDpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); in onCreate()
67 if (!mDpm.isAdminActive(getAdminComponent())) { in onCreate()
91 if (mDpm.isAdminActive(adminComponent)) { in finish()
92 mDpm.removeActiveAdmin(adminComponent); in finish()
DLockTaskUiTestActivity.java90 private DevicePolicyManager mDpm; field in LockTaskUiTestActivity
104 mDpm = getSystemService(DevicePolicyManager.class); in onCreate()
246 mDpm.setLockTaskPackages(ADMIN_RECEIVER, new String[] {TEST_PACKAGE_NAME}); in startLockTaskMode()
247 mDpm.setLockTaskFeatures(ADMIN_RECEIVER, LOCK_TASK_FEATURE_NONE); in startLockTaskMode()
294 mDpm.setLockTaskFeatures(ADMIN_RECEIVER, LOCK_TASK_FEATURE_NONE); in stopLockTaskMode()
295 mDpm.setLockTaskPackages(ADMIN_RECEIVER, new String[] {}); in stopLockTaskMode()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DDelegatedCertInstallerTest.java147 private DevicePolicyManager mDpm; field in DelegatedCertInstallerTest
169 mDpm = (DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE); in setUp()
181 mDpm.uninstallCaCert(ADMIN_RECEIVER_COMPONENT, TEST_CA.getBytes()); in tearDown()
184 mDpm.setCertInstallerPackage(ADMIN_RECEIVER_COMPONENT, null); in tearDown()
195 mDpm.setCertInstallerPackage(ADMIN_RECEIVER_COMPONENT, CERT_INSTALLER_PACKAGE); in testCaCertsOperations()
197 mDpm.getCertInstallerPackage(ADMIN_RECEIVER_COMPONENT)); in testCaCertsOperations()
205 assertTrue("Certificate is not installed properly", mDpm.hasCaCertInstalled( in testCaCertsOperations()
220 assertFalse("Certificate is not removed properly", mDpm.hasCaCertInstalled( in testCaCertsOperations()
229 mDpm.setCertInstallerPackage(ADMIN_RECEIVER_COMPONENT, null); in testCaCertsOperations()
239 mDpm.setCertInstallerPackage(ADMIN_RECEIVER_COMPONENT, null); in testInstallKeyPair()
[all …]
DDelegatedCertInstallerHelper.java35 private DevicePolicyManager mDpm; field in DelegatedCertInstallerHelper
40 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
49 mDpm.setDelegatedScopes(ADMIN_RECEIVER_COMPONENT, CERT_INSTALLER_PACKAGE, in testManualSetCertInstallerDelegate()
51 assertTrue(mDpm.getDelegatePackages(ADMIN_RECEIVER_COMPONENT, in testManualSetCertInstallerDelegate()
56 mDpm.setDelegatedScopes(ADMIN_RECEIVER_COMPONENT, CERT_INSTALLER_PACKAGE, Arrays.asList()); in testManualClearCertInstallerDelegate()
57 assertFalse(mDpm.getDelegatePackages(ADMIN_RECEIVER_COMPONENT, in testManualClearCertInstallerDelegate()
/cts/hostsidetests/devicepolicy/app/DelegateApp/src/com/android/cts/delegate/
DPackageAccessDelegateTest.java38 private DevicePolicyManager mDpm; field in PackageAccessDelegateTest
45 mDpm = context.getSystemService(DevicePolicyManager.class); in setUp()
55 mDpm.isApplicationHidden(null, TEST_APP_PKG); in testCannotAccessApis()
61 mDpm.setApplicationHidden(null, TEST_APP_PKG, true /* hide */); in testCannotAccessApis()
67 mDpm.isPackageSuspended(null, TEST_APP_PKG); in testCannotAccessApis()
73mDpm.setPackagesSuspended(null, new String[] {TEST_APP_PKG}, true /* suspend */); in testCannotAccessApis()
81 assertFalse("Package should not be hidden", mDpm.isApplicationHidden(null, TEST_APP_PKG)); in testCanAccessApis()
85 mDpm.setApplicationHidden(null, TEST_APP_PKG, true /* hide */)); in testCanAccessApis()
86 assertTrue("Package should be hidden", mDpm.isApplicationHidden(null, TEST_APP_PKG)); in testCanAccessApis()
89 assertFalse("Package should not be suspended", mDpm.isPackageSuspended(null, TEST_APP_PKG)); in testCanAccessApis()
[all …]
DPermissionGrantDelegateTest.java42 private DevicePolicyManager mDpm; field in PermissionGrantDelegateTest
49 mDpm = context.getSystemService(DevicePolicyManager.class); in setUp()
59 mDpm.setPermissionPolicy(null, PERMISSION_POLICY_AUTO_GRANT); in testCannotAccessApis()
62 PERMISSION_POLICY_AUTO_GRANT == mDpm.getPermissionPolicy(null)); in testCannotAccessApis()
67 mDpm.setPermissionGrantState(null, TEST_APP_PKG, TEST_PERMISSION, in testCannotAccessApis()
74 mDpm.getPermissionGrantState(null, TEST_APP_PKG, TEST_PERMISSION); in testCannotAccessApis()
83 mDpm.setPermissionPolicy(null, PERMISSION_POLICY_AUTO_DENY); in testCanAccessApis()
85 PERMISSION_POLICY_AUTO_DENY == mDpm.getPermissionPolicy(null)); in testCanAccessApis()
89 mDpm.setPermissionGrantState(null, TEST_APP_PKG, TEST_PERMISSION, in testCanAccessApis()
94 mDpm.getPermissionGrantState(null, TEST_APP_PKG, TEST_PERMISSION)); in testCanAccessApis()
[all …]
DCertInstallDelegateTest.java113 private DevicePolicyManager mDpm; field in CertInstallDelegateTest
120 mDpm = context.getSystemService(DevicePolicyManager.class); in setUp()
128 mDpm.installCaCert(null, null); in testCannotAccessApis()
133 mDpm.removeKeyPair(null, "alias"); in testCannotAccessApis()
143 assertTrue("Certificate installation failed", mDpm.installCaCert(null, cert)); in testCanAccessApis()
146 assertTrue("Certificate is not installed properly", mDpm.hasCaCertInstalled(null, cert)); in testCanAccessApis()
150 containsCertificate(mDpm.getInstalledCaCerts(null), cert)); in testCanAccessApis()
153 mDpm.uninstallCaCert(null, cert); in testCanAccessApis()
154 assertFalse("Certificate was not uninstalled", mDpm.hasCaCertInstalled(null, cert)); in testCanAccessApis()
168 mDpm.installKeyPair(null, privatekey, certificate, alias)); in testCanAccessApis()
[all …]
DBlockUninstallDelegateTest.java36 private DevicePolicyManager mDpm; field in BlockUninstallDelegateTest
43 mDpm = context.getSystemService(DevicePolicyManager.class); in setUp()
52 mDpm.setUninstallBlocked(null, TEST_APP_PKG, true); in testCannotAccessApis()
61 mDpm.setUninstallBlocked(null, TEST_APP_PKG, true); in testCanAccessApis()
62 assertTrue("App not uninstall blocked", mDpm.isUninstallBlocked(null, TEST_APP_PKG)); in testCanAccessApis()
64 mDpm.setUninstallBlocked(null, TEST_APP_PKG, false); in testCanAccessApis()
65 assertFalse("App still uninstall blocked", mDpm.isUninstallBlocked(null, TEST_APP_PKG)); in testCanAccessApis()
71 final List<String> scopes = mDpm.getDelegatedScopes(null, packageName); in amIBlockUninstallDelegate()
DAppRestrictionsDelegateTest.java67 private DevicePolicyManager mDpm; field in AppRestrictionsDelegateTest
76 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
93 mDpm.setApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG, null); in testCannotAccessApis()
98 mDpm.getApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG); in testCannotAccessApis()
105 mDpm.setApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG, BUNDLE_0); in testCanAccessApis()
106 assertBundle0(mDpm.getApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG)); in testCanAccessApis()
112 mDpm.setApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG, BUNDLE_1); in testCanAccessApis()
113 assertBundle1(mDpm.getApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG)); in testCanAccessApis()
116 mDpm.setApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG, new Bundle()); in testCanAccessApis()
118 mDpm.getApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG).isEmpty()); in testCanAccessApis()
[all …]
DNetworkLoggingDelegateTest.java50 private DevicePolicyManager mDpm; field in NetworkLoggingDelegateTest
94 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
100 assertThat(mDpm.getDelegatedScopes(null, mContext.getPackageName())).contains( in testCanAccessApis()
107 () -> mDpm.isNetworkLoggingEnabled(null)); in testCannotAccessApis()
110 () -> mDpm.setNetworkLoggingEnabled(null, true)); in testCannotAccessApis()
113 () -> mDpm.retrieveNetworkLogs(null, 0)); in testCannotAccessApis()
117 mDpm.setNetworkLoggingEnabled(null, true); in testNetworkLogging()
118 assertTrue(mDpm.isNetworkLoggingEnabled(null)); in testNetworkLogging()
133 mDpm.setNetworkLoggingEnabled(null, false); in testNetworkLogging()
134 assertFalse(mDpm.isNetworkLoggingEnabled(null)); in testNetworkLogging()
DEnableSystemAppDelegateTest.java39 private DevicePolicyManager mDpm; field in EnableSystemAppDelegateTest
45 mDpm = getInstrumentation().getContext().getSystemService(DevicePolicyManager.class); in setUp()
55 mDpm.enableSystemApp(null, TEST_APP_PKG); in testCannotAccessApis()
61 mDpm.enableSystemApp(null, new Intent().setPackage(TEST_APP_PKG)); in testCannotAccessApis()
72 mDpm.enableSystemApp(null, TEST_APP_PKG); in testCanAccessApis()
76 mDpm.enableSystemApp(null, new Intent()); in testCanAccessApis()
81 final List<String> scopes = mDpm.getDelegatedScopes(null, packageName); in amIEnableSystemAppDelegate()
DGeneralDelegateTest.java34 private DevicePolicyManager mDpm; field in GeneralDelegateTest
40 mDpm = getInstrumentation().getContext().getSystemService(DevicePolicyManager.class); in setUp()
46 List<String> delegatedScopes = mDpm.getDelegatedScopes(null, in testGetsExpectedDelegationScopes()
57 List<String> delegatedScopes = mDpm.getDelegatedScopes(null, otherPackage); in testDifferentPackageNameThrowsException()
71 mDpm.setUninstallBlocked(myComponentName, myPackageName, true); in testSettingAdminComponentNameThrowsException()
/cts/hostsidetests/devicepolicy/app/CertInstaller/src/com/android/cts/certinstaller/
DDirectDelegatedCertInstallerTest.java119 private DevicePolicyManager mDpm; field in DirectDelegatedCertInstallerTest
124 mDpm = getContext().getSystemService(DevicePolicyManager.class); in setUp()
129 mDpm.uninstallCaCert(null, TEST_CA.getBytes()); in tearDown()
144 + " beginning of the test").that(mDpm.hasCaCertInstalled(null, cert)).isFalse(); in testCaCertsOperations()
148 mDpm.installCaCert(null, cert)).isTrue(); in testCaCertsOperations()
150 mDpm.hasCaCertInstalled(null, cert)).isTrue(); in testCaCertsOperations()
154 containsCertificate(mDpm.getInstalledCaCerts(null), cert)).isTrue(); in testCaCertsOperations()
160 mDpm.uninstallCaCert(null, cert); in testCaCertsOperations()
162 mDpm.hasCaCertInstalled(null, cert)).isFalse(); in testCaCertsOperations()
177 assertThat(mDpm.installKeyPair(null, privatekey, new Certificate[]{certificate}, alias, in testInstallKeyPair()
[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.java63 private DevicePolicyManager mDpm; field in CertSelectionDelegateTest
83 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
98 assertThat(mDpm.getDelegatedScopes(null, mContext.getPackageName())).contains( in testCanSelectKeychainKeypairs()
105 assertThat(mDpm.installKeyPair(null, privKey, cert, alias)).isTrue(); in testCanSelectKeychainKeypairs()
113 assertThat(mDpm.removeKeyPair(null, alias)).isTrue(); in testCanSelectKeychainKeypairs()
/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 testSetEmptyWhitelist()
93 mDpm.setPermittedCrossProfileNotificationListeners( in testAddListenerToWhitelist()
100 mDpm.setPermittedCrossProfileNotificationListeners( in testSetNullWhitelist()
144 mDpm.setPermittedCrossProfileNotificationListeners( in testSetAndGetPermittedCrossProfileNotificationListeners()
146 List<String> actualPackageList = mDpm.getPermittedCrossProfileNotificationListeners( in testSetAndGetPermittedCrossProfileNotificationListeners()
/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()
DBindDeviceAdminServiceGoodSetupTest.java62 private DevicePolicyManager mDpm; field in BindDeviceAdminServiceGoodSetupTest
67 mDpm = (DevicePolicyManager) in setUp()
71 mTargetUsers = mDpm.getBindDeviceAdminTargetUsers(AdminReceiver.getComponentName(mContext)); in setUp()
76 if (!mDpm.isDeviceOwnerApp(AdminReceiver.getComponentName(mContext).getPackageName())) { in testOnlyDeviceOwnerCanHaveMoreThanOneTargetUser()
219 return mDpm.bindDeviceAdminServiceAsUser(AdminReceiver.getComponentName(mContext), in bind()
/cts/hostsidetests/devicepolicy/app/PasswordComplexity/src/com.android.cts.passwordcomplexity/
DGetPasswordComplexityTest.java27 private DevicePolicyManager mDpm; field in GetPasswordComplexityTest
39 mDpm = (DevicePolicyManager) InstrumentationRegistry in setUp()
172 while (retry < maxRetries && mDpm.getPasswordComplexity() != expectedComplexity) { in assertPasswordComplexity()
180 assertEquals(expectedComplexity, mDpm.getPasswordComplexity()); in assertPasswordComplexity()
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DDeviceOwnerProvisioningTest.java39 private DevicePolicyManager mDpm; field in DeviceOwnerProvisioningTest
46 mDpm = getContext().getSystemService(DevicePolicyManager.class); in setUp()
96 assertTrue(mDpm.isDeviceOwnerApp(getContext().getPackageName())); in deviceOwnerProvision()

12