Home
last modified time | relevance | path

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

12

/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DCommandReceiverActivity.java200 private DevicePolicyManager mDpm; field in CommandReceiverActivity
214 mDpm = TestAppSystemServiceFactory.getDevicePolicyManager(this, in onCreate()
228 + " using " + mDpm + " for user " in onCreate()
231 mDpm.addUserRestriction(mAdmin, restrictionKey); in onCreate()
233 mDpm.clearUserRestriction(mAdmin, restrictionKey); in onCreate()
238 mDpm.setKeyguardDisabledFeatures(mAdmin, enforced in onCreate()
243 mDpm.setAutoTimeRequired(mAdmin, in onCreate()
248 mDpm.setDeviceOwnerLockScreenInfo(mAdmin, intent.getStringExtra(EXTRA_VALUE)); in onCreate()
253 mDpm.setMaximumTimeToLock(mAdmin, in onCreate()
263 mDpm.setKeyguardDisabled(mAdmin, enforced); in onCreate()
[all …]
DSetSupportMessageActivity.java42 private DevicePolicyManager mDpm; field in SetSupportMessageActivity
62 mDpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); in onCreate()
66 ? mDpm.getShortSupportMessage(mAdmin) in onCreate()
67 : mDpm.getLongSupportMessage(mAdmin)); in onCreate()
85 mDpm.setShortSupportMessage(mAdmin, message); in onClick()
87 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()
DCrossProfilePermissionControlActivity.java41 protected DevicePolicyManager mDpm; field in CrossProfilePermissionControlActivity
54 mDpm = getSystemService(DevicePolicyManager.class); in onCreate()
66 mDpm.setCrossProfilePackages(getAdminComponent(), Set.of(TEST_APP_PACKAGE_NAME)); in allowTestApp()
DLockTaskUiTestActivity.java91 private DevicePolicyManager mDpm; field in LockTaskUiTestActivity
105 mDpm = getSystemService(DevicePolicyManager.class); in onCreate()
260 mDpm.setLockTaskPackages(ADMIN_RECEIVER, new String[] {TEST_PACKAGE_NAME}); in startLockTaskMode()
261 mDpm.setLockTaskFeatures(ADMIN_RECEIVER, LOCK_TASK_FEATURE_NONE); in startLockTaskMode()
308 mDpm.setLockTaskFeatures(ADMIN_RECEIVER, LOCK_TASK_FEATURE_NONE); in stopLockTaskMode()
309 mDpm.setLockTaskPackages(ADMIN_RECEIVER, new String[] {}); in stopLockTaskMode()
DDisallowAppsControlActivity.java38 protected DevicePolicyManager mDpm; field in DisallowAppsControlActivity
51 mDpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); in onCreate()
/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.java66 private DevicePolicyManager mDpm; field in CertSelectionDelegateTest
86 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
101 assertThat(mDpm.getDelegatedScopes(null, mContext.getPackageName())).contains( in testCanSelectKeychainKeypairs()
108 assertThat(mDpm.installKeyPair(null, privKey, cert, alias)).isTrue(); in testCanSelectKeychainKeypairs()
116 assertThat(mDpm.removeKeyPair(null, alias)).isTrue(); in testCanSelectKeychainKeypairs()
125 assertThat(mDpm.getDelegatedScopes(null, mContext.getPackageName())).contains( in testNotChosenAnyAlias()
/cts/tests/devicepolicy/src/android/devicepolicy/cts/
DDefaultSmsApplicationTest.java81 private RemoteDevicePolicyManager mDpm; field in DefaultSmsApplicationTest
89 mDpm = dpc.devicePolicyManager(); in setUp()
104 if (mDpm.isOrganizationOwnedDeviceWithManagedProfile()) { in setDefaultSmsApplication_works()
105 mDpm.setManagedSubscriptionsPolicy(new ManagedSubscriptionsPolicy( in setDefaultSmsApplication_works()
111 mDpm.setDefaultSmsApplication(mAdmin, smsApp.packageName()); in setDefaultSmsApplication_works()
114 mDpm.setDefaultSmsApplication(mAdmin, previousSmsAppName); in setDefaultSmsApplication_works()
116 if (mDpm.isOrganizationOwnedDeviceWithManagedProfile()) { in setDefaultSmsApplication_works()
117 mDpm.setManagedSubscriptionsPolicy(new ManagedSubscriptionsPolicy( in setDefaultSmsApplication_works()
132 if (mDpm.isOrganizationOwnedDeviceWithManagedProfile()) { in setDefaultSmsApplication_unchanged()
133 mDpm.setManagedSubscriptionsPolicy(new ManagedSubscriptionsPolicy( in setDefaultSmsApplication_unchanged()
[all …]
DDefaultDialerApplicationTest.java75 private RemoteDevicePolicyManager mDpm; field in DefaultDialerApplicationTest
83 mDpm = dpc.devicePolicyManager(); in setUp()
97 setDefaultDialerApplication(mDpm, dialerApp.packageName()); in setDefaultDialerApplication_works()
101 setDefaultDialerApplication(mDpm, previousDialerAppName); in setDefaultDialerApplication_works()
115 setDefaultDialerApplication(mDpm, dialerApp.packageName()); in setDefaultDialerApplication_unchanged()
119 setDefaultDialerApplication(mDpm, previousDialerAppInDpc); in setDefaultDialerApplication_unchanged()
133 setDefaultDialerApplication(mDpm, FAKE_DIALER_APP_NAME)); in setDefaultDialerApplication_dialerPackageDoesNotExist_unchanged()
137 setDefaultDialerApplication(mDpm, previousDialerAppName); in setDefaultDialerApplication_dialerPackageDoesNotExist_unchanged()
151 setDefaultDialerApplication(mDpm, dialerApp.packageName()); in setDefaultDialerApplication_notVoiceCapable_unchanged()
155 setDefaultDialerApplication(mDpm, previousDialerAppName); in setDefaultDialerApplication_notVoiceCapable_unchanged()
DAffiliationIdsTest.java46 private RemoteDevicePolicyManager mDpm; field in AffiliationIdsTest
52 mDpm = dpc.devicePolicyManager(); in setUp()
61 () -> mDpm.setAffiliationIds(mAdmin, Set.of(badId))); in setAffiliationIds_idTooLong_throws()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DPersonalAppsSuspensionTest.java51 private final DevicePolicyManager mDpm = mContext.getSystemService(DevicePolicyManager.class); field in PersonalAppsSuspensionTest
56 mDpm.setPersonalAppsSuspended(ADMIN, true); in testSuspendPersonalApps()
57 assertThat(mDpm.getPersonalAppsSuspendedReasons(ADMIN)) in testSuspendPersonalApps()
63 mDpm.setPersonalAppsSuspended(ADMIN, false); in testUnsuspendPersonalApps()
64 assertThat(mDpm.getPersonalAppsSuspendedReasons(ADMIN)) in testUnsuspendPersonalApps()
70 mDpm.setManagedProfileMaximumTimeOff(ADMIN, 1000); in testSetManagedProfileMaximumTimeOff1Sec()
75 mDpm.setManagedProfileMaximumTimeOff(ADMIN, TimeUnit.DAYS.toMillis(365)); in testSetManagedProfileMaximumTimeOff1Year()
117 assertThat(mDpm.isComplianceAcknowledgementRequired()).isFalse(); in testComplianceAcknowledgementNotRequired()
122 assertThat(mDpm.isComplianceAcknowledgementRequired()).isTrue(); in testAcknowledgeCompliance()
123 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()
173 mDpm.setNetworkLoggingEnabled(ADMIN_RECEIVER_COMPONENT, false); in testSetNetworkLogsEnabled_false()
175 assertThat(mDpm.isNetworkLoggingEnabled(ADMIN_RECEIVER_COMPONENT)).isFalse(); in testSetNetworkLogsEnabled_false()
182 assertThat(mDpm.getDelegatedScopes(ADMIN_RECEIVER_COMPONENT, DELEGATE_APP_PKG)) in testSetDelegateScope_delegationNetworkLogging()
190 assertThat(mDpm.getDelegatedScopes(ADMIN_RECEIVER_COMPONENT, DELEGATE_APP_PKG)) in testSetDelegateScope_noDelegation()
213 + ", " + delegatePackage + ", " + scopes + ") using " + mDpm); in setDelegatedScopes()
214 mDpm.setDelegatedScopes(ADMIN_RECEIVER_COMPONENT, delegatePackage, scopes); in setDelegatedScopes()
[all …]
/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.java64 private DevicePolicyManager mDpm; field in NotificationListenerTest
71 mDpm = mContext.getSystemService(DevicePolicyManager.class); in setUp()
93 mDpm.setPermittedCrossProfileNotificationListeners( in testSetEmptyAllowlist()
100 mDpm.setPermittedCrossProfileNotificationListeners( in testAddListenerToAllowlist()
107 mDpm.setPermittedCrossProfileNotificationListeners( in testSetNullAllowlist()
151 mDpm.setPermittedCrossProfileNotificationListeners( in testSetAndGetPermittedCrossProfileNotificationListeners()
153 List<String> actualPackageList = mDpm.getPermittedCrossProfileNotificationListeners( in testSetAndGetPermittedCrossProfileNotificationListeners()
/cts/hostsidetests/devicepolicy/app/DelegateApp/src/com/android/cts/delegate/
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 …]
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()
DBaseTestCase.java39 protected DevicePolicyManager mDpm; field in BaseTestCase
45 mDpm = getDpm(mContext); in setBaseFixtures()
46 Log.d(TAG, getClass().getName() + ".setup(): dpm=" + mDpm); in setBaseFixtures()
/cts/hostsidetests/multiuser/dpc/src/com/android/cts/multiuser/dpc/
DDpcShellCommand.java31 private final DevicePolicyManager mDpm; field in DpcShellCommand
37 mDpm = context.getSystemService(DevicePolicyManager.class); in DpcShellCommand()
74 mDpm.addUserRestriction(mAdmin, restriction); in runAddUserRestriction()
80 mDpm.clearUserRestriction(mAdmin, restriction); in runClearUserRestriction()
/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()

12