/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ |
D | CommandReceiverActivity.java | 188 private DevicePolicyManager mDpm; field in CommandReceiverActivity 202 mDpm = TestAppSystemServiceFactory.getDevicePolicyManager(this, in onCreate() 215 + " using " + mDpm + " for user " in onCreate() 218 mDpm.addUserRestriction(mAdmin, restrictionKey); in onCreate() 220 mDpm.clearUserRestriction(mAdmin, restrictionKey); in onCreate() 225 mDpm.setKeyguardDisabledFeatures(mAdmin, enforced in onCreate() 230 mDpm.setAutoTimeRequired(mAdmin, in onCreate() 235 mDpm.setDeviceOwnerLockScreenInfo(mAdmin, intent.getStringExtra(EXTRA_VALUE)); in onCreate() 240 mDpm.setMaximumTimeToLock(mAdmin, in onCreate() 250 mDpm.setKeyguardDisabled(mAdmin, enforced); in onCreate() [all …]
|
D | SetSupportMessageActivity.java | 41 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()
|
D | WorkProfileWidgetActivity.java | 34 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()
|
D | KeyguardDisabledFeaturesActivity.java | 41 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()
|
/cts/hostsidetests/devicepolicy/app/CertInstaller/src/com/android/cts/certinstaller/ |
D | DirectDelegatedCertInstallerTest.java | 71 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 …]
|
D | DelegatedDeviceIdAttestationTest.java | 24 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()
|
D | CertSelectionDelegateTest.java | 65 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/DelegateApp/src/com/android/cts/delegate/ |
D | PackageAccessDelegateTest.java | 42 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() 60 … mDpm.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 …]
|
D | PermissionGrantDelegateTest.java | 47 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()
|
D | BlockUninstallDelegateTest.java | 40 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()
|
D | CertInstallDelegateTest.java | 50 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() 87 mDpm.installKeyPair(null, privateKey, certificate, alias)); in testCanAccessApis() 90 assertTrue("Key pair not removed successfully", mDpm.removeKeyPair(null, alias)); in testCanAccessApis() 112 final List<String> scopes = mDpm.getDelegatedScopes(null, packageName); in amICertInstallDelegate()
|
D | SecurityLoggingDelegateTest.java | 62 () -> 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 …]
|
D | NetworkLoggingDelegateTest.java | 84 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()
|
D | EnableSystemAppDelegateTest.java | 43 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()
|
D | WorkProfileNetworkLoggingDelegateTest.java | 80 () -> 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()
|
D | BaseJUnit3TestCase.java | 35 protected DevicePolicyManager mDpm; field in BaseJUnit3TestCase 44 mDpm = BaseTestCase.getDpm(mContext); in setUp() 45 Log.d(TAG, getClass().getName() + ".setup(): dpm=" + mDpm); in setUp()
|
D | BaseTestCase.java | 39 protected DevicePolicyManager mDpm; field in BaseTestCase 45 mDpm = getDpm(mContext); in setBaseFixtures() 46 Log.d(TAG, getClass().getName() + ".setup(): dpm=" + mDpm); in setBaseFixtures()
|
/cts/tests/devicepolicy/src/android/devicepolicy/cts/ |
D | AccountManagementTest.java | 83 private RemoteDevicePolicyManager mDpm; field in AccountManagementTest 90 mDpm = dpc.devicePolicyManager(); in setUp() 98 assertThat(mDpm.getAccountTypesWithManagementDisabled()).isEmpty(); in getAccountTypesWithManagementDisabled_emptyByDefault() 107 mDpm.setAccountManagementDisabled( in setAccountTypesWithManagementDisabled_invalidAdmin_throwsException() 116 mDpm.setAccountManagementDisabled( in setAccountTypesWithManagementDisabled_nullAdmin_throwsException() 125 mDpm.setAccountManagementDisabled(mAdmin, FAKE_ACCOUNT_TYPE, /* disabled= */ true); in setAccountManagementDisabled_disableAccountType_works() 127 assertThat(mDpm.getAccountTypesWithManagementDisabled().length).isEqualTo(1); in setAccountManagementDisabled_disableAccountType_works() 128 assertThat(mDpm.getAccountTypesWithManagementDisabled()[0]) in setAccountManagementDisabled_disableAccountType_works() 131 mDpm.setAccountManagementDisabled(mAdmin, FAKE_ACCOUNT_TYPE, /* disabled= */ false); in setAccountManagementDisabled_disableAccountType_works() 140 mDpm.setAccountManagementDisabled(mAdmin, FAKE_ACCOUNT_TYPE, /* disabled= */ true); in setAccountManagementDisabled_addSameAccountTypeTwice_presentOnlyOnce() [all …]
|
D | DefaultSmsApplicationTest.java | 69 private RemoteDevicePolicyManager mDpm; field in DefaultSmsApplicationTest 76 mDpm = dpc.devicePolicyManager(); in setUp() 88 mDpm.setDefaultSmsApplication(mAdmin, smsApp.packageName()); in setDefaultSmsApplication_works() 92 mDpm.setDefaultSmsApplication(mAdmin, previousSmsAppName); in setDefaultSmsApplication_works() 104 mDpm.setDefaultSmsApplication(mAdmin, smsApp.packageName()); in setDefaultSmsApplication_unchanged() 108 mDpm.setDefaultSmsApplication(mAdmin, previousSmsAppName); in setDefaultSmsApplication_unchanged() 120 mDpm.setDefaultSmsApplication(mAdmin, FAKE_SMS_APP_NAME); in setDefaultSmsApplication_smsPackageDoesNotExist_unchanged() 125 mDpm.setDefaultSmsApplication(mAdmin, previousSmsAppName); in setDefaultSmsApplication_smsPackageDoesNotExist_unchanged() 136 mDpm.setDefaultSmsApplication( in setDefaultSmsApplication_nullAdmin_throwsException() 149 mDpm.setDefaultSmsApplication(mAdmin, smsApp.packageName()); in setDefaultSmsApplication_notSmsCapable_unchanged() [all …]
|
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/ |
D | PersonalAppsSuspensionTest.java | 49 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 …]
|
D | NetworkLoggingTest.java | 93 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() 181 assertThat(mDpm.getDelegatedScopes(ADMIN_RECEIVER_COMPONENT, DELEGATE_APP_PKG)) in testSetDelegateScope_delegationNetworkLogging() 189 assertThat(mDpm.getDelegatedScopes(ADMIN_RECEIVER_COMPONENT, DELEGATE_APP_PKG)) in testSetDelegateScope_noDelegation() 212 + ", " + delegatePackage + ", " + scopes + ") using " + mDpm); in setDelegatedScopes() 213 mDpm.setDelegatedScopes(ADMIN_RECEIVER_COMPONENT, delegatePackage, scopes); in setDelegatedScopes() [all …]
|
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/ |
D | PrimaryUserAdminHelper.java | 28 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()
|
D | ProfileTimeoutTestHelper.java | 38 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()
|
D | NotificationListenerTest.java | 61 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/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/ |
D | BindDeviceAdminServiceFailsTest.java | 36 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()
|