Home
last modified time | relevance | path

Searched refs:mDevicePolicyManager (Results 1 – 25 of 145) sorted by relevance

123456

/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DPasswordRequirementsTest.java40 mDevicePolicyManager.setPasswordQuality( in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
43 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, TEST_VALUE); in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
44 mDevicePolicyManager.setPasswordMinimumNumeric(ADMIN_RECEIVER_COMPONENT, TEST_VALUE); in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
45 mDevicePolicyManager.setPasswordMinimumLetters(ADMIN_RECEIVER_COMPONENT, TEST_VALUE); in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
46 mDevicePolicyManager.setPasswordMinimumUpperCase(ADMIN_RECEIVER_COMPONENT, TEST_VALUE); in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
47 mDevicePolicyManager.setPasswordMinimumLowerCase(ADMIN_RECEIVER_COMPONENT, TEST_VALUE); in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
48 mDevicePolicyManager.setPasswordMinimumNonLetter(ADMIN_RECEIVER_COMPONENT, TEST_VALUE); in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
49 mDevicePolicyManager.setPasswordMinimumSymbols(ADMIN_RECEIVER_COMPONENT, TEST_VALUE); in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
52 mDevicePolicyManager.setPasswordQuality( in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
55 mDevicePolicyManager.getPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT)); in testPasswordConstraintsDoesntThrowAndPreservesValuesPreR()
[all …]
DDevicePolicyLoggingTest.java54 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in testPasswordMethodsLogged()
56 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, 13); in testPasswordMethodsLogged()
57 mDevicePolicyManager.setPasswordMinimumNumeric(ADMIN_RECEIVER_COMPONENT, 14); in testPasswordMethodsLogged()
58 mDevicePolicyManager.setPasswordMinimumNonLetter(ADMIN_RECEIVER_COMPONENT, 15); in testPasswordMethodsLogged()
59 mDevicePolicyManager.setPasswordMinimumLetters(ADMIN_RECEIVER_COMPONENT, 16); in testPasswordMethodsLogged()
60 mDevicePolicyManager.setPasswordMinimumLowerCase(ADMIN_RECEIVER_COMPONENT, 17); in testPasswordMethodsLogged()
61 mDevicePolicyManager.setPasswordMinimumUpperCase(ADMIN_RECEIVER_COMPONENT, 18); in testPasswordMethodsLogged()
62 mDevicePolicyManager.setPasswordMinimumSymbols(ADMIN_RECEIVER_COMPONENT, 19); in testPasswordMethodsLogged()
63 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in testPasswordMethodsLogged()
65 mDevicePolicyManager.setRequiredPasswordComplexity(PASSWORD_COMPLEXITY_HIGH); in testPasswordMethodsLogged()
[all …]
DResetPasswordWithTokenTest.java64 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in tearDown()
66 mDevicePolicyManager.setRequiredPasswordComplexity(PASSWORD_COMPLEXITY_NONE); in tearDown()
75 assertFalse(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, in testBadTokenShouldFail()
84 assertTrue(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, in testChangePasswordWithToken()
88 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, PASSWORD_QUALITY_NUMERIC); in testChangePasswordWithToken()
89 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, 6); in testChangePasswordWithToken()
93 assertTrue(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, in testChangePasswordWithToken()
102 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, PASSWORD_QUALITY_NUMERIC); in testResetPasswordFailIfQualityNotMet()
103 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, 6); in testResetPasswordFailIfQualityNotMet()
105 assertFalse(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, in testResetPasswordFailIfQualityNotMet()
[all …]
DRequiredStrongAuthTimeoutTest.java35 assertEquals(mDevicePolicyManager.getRequiredStrongAuthTimeout(null), in testSetRequiredStrongAuthTimeout()
39 assertEquals(mDevicePolicyManager.getRequiredStrongAuthTimeout(ADMIN), 0); in testSetRequiredStrongAuthTimeout()
42 mDevicePolicyManager.setRequiredStrongAuthTimeout(ADMIN, in testSetRequiredStrongAuthTimeout()
44 assertEquals(mDevicePolicyManager.getRequiredStrongAuthTimeout(ADMIN), in testSetRequiredStrongAuthTimeout()
46 assertEquals(mDevicePolicyManager.getRequiredStrongAuthTimeout(null), in testSetRequiredStrongAuthTimeout()
50 mDevicePolicyManager.setRequiredStrongAuthTimeout(ADMIN, 0); in testSetRequiredStrongAuthTimeout()
51 assertEquals(mDevicePolicyManager.getRequiredStrongAuthTimeout(ADMIN), 0); in testSetRequiredStrongAuthTimeout()
52 assertEquals(mDevicePolicyManager.getRequiredStrongAuthTimeout(null), in testSetRequiredStrongAuthTimeout()
56 mDevicePolicyManager.setRequiredStrongAuthTimeout(ADMIN, in testSetRequiredStrongAuthTimeout()
58 assertEquals(mDevicePolicyManager.getRequiredStrongAuthTimeout(ADMIN), in testSetRequiredStrongAuthTimeout()
[all …]
DTimeManagementTest.java43 mDevicePolicyManager.setAutoTimeZoneEnabled(ADMIN_RECEIVER_COMPONENT, true); in testSetAutoTimeZoneEnabled()
45 assertThat(mDevicePolicyManager.getAutoTimeZoneEnabled(ADMIN_RECEIVER_COMPONENT)).isTrue(); in testSetAutoTimeZoneEnabled()
47 mDevicePolicyManager.setAutoTimeZoneEnabled(ADMIN_RECEIVER_COMPONENT, false); in testSetAutoTimeZoneEnabled()
49 assertThat(mDevicePolicyManager.getAutoTimeZoneEnabled(ADMIN_RECEIVER_COMPONENT)).isFalse(); in testSetAutoTimeZoneEnabled()
53 mDevicePolicyManager.setAutoTimeEnabled(ADMIN_RECEIVER_COMPONENT, false); in testSetTime()
57 assertThat(mDevicePolicyManager.setTime(ADMIN_RECEIVER_COMPONENT, in testSetTime()
62 mDevicePolicyManager.setAutoTimeEnabled(ADMIN_RECEIVER_COMPONENT, true); in testSetTime_failWhenAutoTimeEnabled()
64 assertThat(mDevicePolicyManager.setTime(ADMIN_RECEIVER_COMPONENT, 0)).isFalse(); in testSetTime_failWhenAutoTimeEnabled()
68 mDevicePolicyManager.setAutoTimeZoneEnabled(ADMIN_RECEIVER_COMPONENT, false); in testSetTimeZone()
71 mDevicePolicyManager.setTimeZone(ADMIN_RECEIVER_COMPONENT, "Singapore")).isTrue(); in testSetTimeZone()
[all …]
DAffiliationTest.java44 private DevicePolicyManager mDevicePolicyManager; field in AffiliationTest
49 mDevicePolicyManager = (DevicePolicyManager) in setUp()
72 mDevicePolicyManager.setLockTaskPackages(ADMIN_RECEIVER_COMPONENT, packages); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
74 mDevicePolicyManager.getLockTaskPackages(ADMIN_RECEIVER_COMPONENT)); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
75 assertTrue(mDevicePolicyManager.isLockTaskPermitted("package1")); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
76 assertFalse(mDevicePolicyManager.isLockTaskPermitted("package3")); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
79 mDevicePolicyManager.getAffiliationIds(ADMIN_RECEIVER_COMPONENT); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
84 assertFalse(mDevicePolicyManager.isLockTaskPermitted("package1")); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
89 mDevicePolicyManager.getLockTaskPackages(ADMIN_RECEIVER_COMPONENT).length); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
90 assertFalse(mDevicePolicyManager.isLockTaskPermitted("package1")); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
[all …]
DApplicationRestrictionsTest.java98 mDevicePolicyManager.setApplicationRestrictions( in tearDown()
100 mDevicePolicyManager.setApplicationRestrictions( in tearDown()
102 mDevicePolicyManager.setApplicationRestrictions( in tearDown()
110 mDevicePolicyManager.setApplicationRestrictions( in testNullComponentThrowsException()
119 mDevicePolicyManager.getApplicationRestrictions(null, APP_RESTRICTIONS_TARGET_PKG); in testNullComponentThrowsException()
130 mDevicePolicyManager.setApplicationRestrictions( in testSetApplicationRestrictions()
132 mDevicePolicyManager.setApplicationRestrictions( in testSetApplicationRestrictions()
136 assertBundle0(mDevicePolicyManager.getApplicationRestrictions( in testSetApplicationRestrictions()
138 assertBundle1(mDevicePolicyManager.getApplicationRestrictions( in testSetApplicationRestrictions()
145 mDevicePolicyManager.setApplicationRestrictions( in testSetApplicationRestrictions()
[all …]
DPolicyTransparencyTest.java33 mDevicePolicyManager.setCameraDisabled(ADMIN_RECEIVER_COMPONENT, true); in testCameraDisabled()
35 Intent intent = mDevicePolicyManager.createAdminSupportIntent( in testCameraDisabled()
43 mDevicePolicyManager.setCameraDisabled(ADMIN_RECEIVER_COMPONENT, false); in testCameraDisabled()
44 intent = mDevicePolicyManager.createAdminSupportIntent( in testCameraDisabled()
50 mDevicePolicyManager.setScreenCaptureDisabled(ADMIN_RECEIVER_COMPONENT, true); in testScreenCaptureDisabled()
52 Intent intent = mDevicePolicyManager.createAdminSupportIntent( in testScreenCaptureDisabled()
60 mDevicePolicyManager.setScreenCaptureDisabled(ADMIN_RECEIVER_COMPONENT, false); in testScreenCaptureDisabled()
61 intent = mDevicePolicyManager.createAdminSupportIntent( in testScreenCaptureDisabled()
74 mDevicePolicyManager.addUserRestriction(ADMIN_RECEIVER_COMPONENT, restriction); in runTestForRestriction()
76 Intent intent = mDevicePolicyManager.createAdminSupportIntent(restriction); in runTestForRestriction()
[all …]
DAllowedAccountManagementTest.java54 mDevicePolicyManager.clearUserRestriction(ADMIN_RECEIVER_COMPONENT, in setUp()
61 mDevicePolicyManager.clearUserRestriction(ADMIN_RECEIVER_COMPONENT, in tearDown()
69 assertEquals(0, mDevicePolicyManager.getAccountTypesWithManagementDisabled().length); in testAccountManagementDisabled_setterAndGetter()
71 mDevicePolicyManager.setAccountManagementDisabled(ADMIN_RECEIVER_COMPONENT, ACCOUNT_TYPE_1, in testAccountManagementDisabled_setterAndGetter()
74 mDevicePolicyManager.setAccountManagementDisabled(ADMIN_RECEIVER_COMPONENT, ACCOUNT_TYPE_2, in testAccountManagementDisabled_setterAndGetter()
76 assertEquals(1, mDevicePolicyManager.getAccountTypesWithManagementDisabled().length); in testAccountManagementDisabled_setterAndGetter()
78 mDevicePolicyManager.getAccountTypesWithManagementDisabled()[0]); in testAccountManagementDisabled_setterAndGetter()
80 mDevicePolicyManager.setAccountManagementDisabled(ADMIN_RECEIVER_COMPONENT, ACCOUNT_TYPE_1, in testAccountManagementDisabled_setterAndGetter()
82 assertEquals(0, mDevicePolicyManager.getAccountTypesWithManagementDisabled().length); in testAccountManagementDisabled_setterAndGetter()
87 mDevicePolicyManager.setAccountManagementDisabled(ADMIN_RECEIVER_COMPONENT, ACCOUNT_TYPE_1, in testAccountManagementDisabled_profileAndDeviceOwnerCanAddAccount()
[all …]
DKeyManagementTest.java135 mDevicePolicyManager.removeKeyPair(getWho(), TEST_ALIAS); in tearDown()
143 assertThat(mDevicePolicyManager.installKeyPair(getWho(), mFakePrivKey, mFakeCert, alias)) in testCanInstallAndRemoveValidRsaKeypair()
155 assertThat(mDevicePolicyManager.removeKeyPair(getWho(), alias)).isTrue(); in testCanInstallAndRemoveValidRsaKeypair()
167 mDevicePolicyManager.installKeyPair( in testCanInstallWithAutomaticAccess()
171 mDevicePolicyManager.installKeyPair( in testCanInstallWithAutomaticAccess()
183 assertThat(mDevicePolicyManager.removeKeyPair(getWho(), grant)).isTrue(); in testCanInstallWithAutomaticAccess()
184 assertThat(mDevicePolicyManager.removeKeyPair(getWho(), withhold)).isTrue(); in testCanInstallWithAutomaticAccess()
210 assertThat(mDevicePolicyManager.installKeyPair(getWho(), privKey, certChain, alias, true)) in testCanInstallCertChain()
223 assertThat(mDevicePolicyManager.removeKeyPair(getWho(), alias)).isTrue(); in testCanInstallCertChain()
234 mDevicePolicyManager.installKeyPair( in testGrantsDoNotPersistBetweenInstallations()
[all …]
DInputMethodsTest.java35 mDevicePolicyManager.setPermittedInputMethods(ADMIN_RECEIVER_COMPONENT, null); in testPermittedInputMethods()
37 mDevicePolicyManager.getPermittedInputMethods(ADMIN_RECEIVER_COMPONENT)).isNull(); in testPermittedInputMethods()
40 mDevicePolicyManager.setPermittedInputMethods(ADMIN_RECEIVER_COMPONENT, new ArrayList<>()); in testPermittedInputMethods()
42 mDevicePolicyManager.getPermittedInputMethods(ADMIN_RECEIVER_COMPONENT)).isEmpty(); in testPermittedInputMethods()
46 mDevicePolicyManager.setPermittedInputMethods(ADMIN_RECEIVER_COMPONENT, packages); in testPermittedInputMethods()
48 mDevicePolicyManager.getPermittedInputMethods(ADMIN_RECEIVER_COMPONENT)) in testPermittedInputMethods()
54 mDevicePolicyManager.getParentProfileInstance(ADMIN_RECEIVER_COMPONENT); in testPermittedInputMethodsOnParent()
69 mDevicePolicyManager.getParentProfileInstance(ADMIN_RECEIVER_COMPONENT); in testPermittedInputMethodsOnParentThrowsIfPackageListIsNotEmptyOrNull()
79 mDevicePolicyManager.setPermittedInputMethods(badAdmin, null); in testPermittedInputMethodsThrowsIfWrongAdmin()
84 mDevicePolicyManager.getPermittedInputMethods(badAdmin); in testPermittedInputMethodsThrowsIfWrongAdmin()
/cts/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/
DDeviceWideLoggingFeaturesTest.java33 private DevicePolicyManager mDevicePolicyManager; field in DeviceWideLoggingFeaturesTest
39 mDevicePolicyManager = (DevicePolicyManager) in setUp()
50 mDevicePolicyManager.retrieveSecurityLogs(mAdminComponent); in testRetrievingLogsThrowsSecurityException()
56 mDevicePolicyManager.retrievePreRebootSecurityLogs(mAdminComponent); in testRetrievingLogsThrowsSecurityException()
62 mDevicePolicyManager.retrieveNetworkLogs(mAdminComponent, NETWORK_LOGGING_BATCH_TOKEN); in testRetrievingLogsThrowsSecurityException()
69 mDevicePolicyManager.retrieveSecurityLogs(mAdminComponent); in testRetrievingLogsDoesNotThrowException()
70 mDevicePolicyManager.retrievePreRebootSecurityLogs(mAdminComponent); in testRetrievingLogsDoesNotThrowException()
71 mDevicePolicyManager.retrieveNetworkLogs(mAdminComponent, NETWORK_LOGGING_BATCH_TOKEN); in testRetrievingLogsDoesNotThrowException()
76 mDevicePolicyManager.requestBugreport(mAdminComponent); in testRequestBugreportThrowsSecurityException()
83 mDevicePolicyManager.requestBugreport(mAdminComponent); in testRequestBugreportDoesNotThrowException()
[all …]
DManagementTest.java29 private DevicePolicyManager mDevicePolicyManager; field in ManagementTest
34 mDevicePolicyManager = (DevicePolicyManager) in setUp()
39 assertNotNull(mDevicePolicyManager); in testIsManagedProfile()
40 assertTrue(mDevicePolicyManager.isAdminActive( in testIsManagedProfile()
42 assertTrue(mDevicePolicyManager.isProfileOwnerApp(getContext().getPackageName())); in testIsManagedProfile()
43 assertTrue(mDevicePolicyManager.isManagedProfile( in testIsManagedProfile()
48 assertNotNull(mDevicePolicyManager); in testIsDeviceOwner()
49 assertTrue(mDevicePolicyManager.isAdminActive( in testIsDeviceOwner()
51 assertTrue(mDevicePolicyManager.isDeviceOwnerApp(getContext().getPackageName())); in testIsDeviceOwner()
52 assertFalse(mDevicePolicyManager.isManagedProfile( in testIsDeviceOwner()
[all …]
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DUserSessionTest.java26 mDevicePolicyManager.setLogoutEnabled(getWho(), true); in testSetLogoutEnabled()
27 assertTrue(mDevicePolicyManager.isLogoutEnabled()); in testSetLogoutEnabled()
31 mDevicePolicyManager.setLogoutEnabled(getWho(), false); in testSetLogoutDisabled()
32 assertFalse(mDevicePolicyManager.isLogoutEnabled()); in testSetLogoutDisabled()
36 mDevicePolicyManager.setStartUserSessionMessage(getWho(), START_SESSION_MESSAGE); in testSetStartUserSessionMessage()
38 mDevicePolicyManager.getStartUserSessionMessage(getWho())); in testSetStartUserSessionMessage()
42 mDevicePolicyManager.setEndUserSessionMessage(getWho(), END_SESSION_MESSAGE); in testSetEndUserSessionMessage()
43 assertEquals(END_SESSION_MESSAGE, mDevicePolicyManager.getEndUserSessionMessage(getWho())); in testSetEndUserSessionMessage()
47 mDevicePolicyManager.setStartUserSessionMessage(getWho(), START_SESSION_MESSAGE); in testClearStartUserSessionMessage()
48 mDevicePolicyManager.setStartUserSessionMessage(getWho(), null); in testClearStartUserSessionMessage()
[all …]
DAdminActionBookkeepingTest.java47 mDevicePolicyManager.setSecurityLoggingEnabled(getWho(), false); in tearDown()
48 mDevicePolicyManager.setNetworkLoggingEnabled(getWho(), false); in tearDown()
49 mDevicePolicyManager.uninstallCaCert(getWho(), TestCertificates.TEST_CA.getBytes()); in tearDown()
61 final long previousTimestamp = mDevicePolicyManager.getLastSecurityLogRetrievalTime(); in testRetrieveSecurityLogs()
63 mDevicePolicyManager.setSecurityLoggingEnabled(getWho(), true); in testRetrieveSecurityLogs()
66 mDevicePolicyManager.retrieveSecurityLogs(getWho()); in testRetrieveSecurityLogs()
69 final long firstTimestamp = mDevicePolicyManager.getLastSecurityLogRetrievalTime(); in testRetrieveSecurityLogs()
76 mDevicePolicyManager.retrievePreRebootSecurityLogs(getWho()) != null; in testRetrieveSecurityLogs()
79 final long secondTimestamp = mDevicePolicyManager.getLastSecurityLogRetrievalTime(); in testRetrieveSecurityLogs()
103 final long previousTimestamp = mDevicePolicyManager.getLastBugReportRequestTime(); in testRequestBugreport()
[all …]
DDevicePolicyLoggingTest.java33 mDevicePolicyManager.setKeyguardDisabled(getWho(), true); in testSetKeyguardDisabledLogged()
34 mDevicePolicyManager.setKeyguardDisabled(getWho(), false); in testSetKeyguardDisabledLogged()
38 mDevicePolicyManager.setStatusBarDisabled(getWho(), true); in testSetStatusBarDisabledLogged()
39 mDevicePolicyManager.setStatusBarDisabled(getWho(), false); in testSetStatusBarDisabledLogged()
53 mDevicePolicyManager.setGlobalSetting(getWho(), AUTO_TIME, "1"); in testSetGlobalSettingLogged()
54 mDevicePolicyManager.setGlobalSetting(getWho(), AUTO_TIME_ZONE, "1"); in testSetGlobalSettingLogged()
55 mDevicePolicyManager.setGlobalSetting(getWho(), DATA_ROAMING, "1"); in testSetGlobalSettingLogged()
56 mDevicePolicyManager.setGlobalSetting(getWho(), USB_MASS_STORAGE_ENABLED, "1"); in testSetGlobalSettingLogged()
58 mDevicePolicyManager.setGlobalSetting(getWho(), AUTO_TIME, autoTimeOriginalValue); in testSetGlobalSettingLogged()
59 mDevicePolicyManager.setGlobalSetting( in testSetGlobalSettingLogged()
[all …]
DPrivateDnsPolicyTest.java46 mDevicePolicyManager.setGlobalPrivateDnsModeOpportunistic(getWho()); in tearDown()
63 mDevicePolicyManager.addUserRestriction(getWho(), restriction); in setUserRestriction()
65 mDevicePolicyManager.clearUserRestriction(getWho(), restriction); in setUserRestriction()
74 int resultCode = mDevicePolicyManager.setGlobalPrivateDnsModeOpportunistic(getWho()); in callSetGlobalPrivateDnsOpportunisticModeExpectingResult()
90 int resultCode = mDevicePolicyManager.setGlobalPrivateDnsModeSpecifiedHost( in callSetGlobalPrivateDnsHostModeExpectingResult()
106 mDevicePolicyManager.getGlobalPrivateDnsMode(getWho())).isEqualTo( in testSetOpportunisticMode()
108 assertThat(mDevicePolicyManager.getGlobalPrivateDnsHost(getWho())).isNull(); in testSetOpportunisticMode()
117 mDevicePolicyManager.getGlobalPrivateDnsMode(getWho())).isEqualTo( in testSetSpecificHostMode()
120 mDevicePolicyManager.getGlobalPrivateDnsHost(getWho())).isEqualTo( in testSetSpecificHostMode()
127 () -> mDevicePolicyManager.setGlobalPrivateDnsModeSpecifiedHost(getWho(), null)); in testSetModeWithIncorrectHost()
[all …]
/cts/hostsidetests/devicepolicy/app/ManagedProfile/src/com/android/cts/managedprofile/
DOrganizationInfoTest.java27 int defaultColor = mDevicePolicyManager.getOrganizationColor(ADMIN_RECEIVER_COMPONENT); in testDefaultOrganizationColor()
33 int previousColor = mDevicePolicyManager.getOrganizationColor(ADMIN_RECEIVER_COMPONENT); in testSetOrganizationColor()
46 mDevicePolicyManager.setOrganizationColor(ADMIN_RECEIVER_COMPONENT, color); in testSetOrganizationColor()
48 mDevicePolicyManager.getOrganizationColor(ADMIN_RECEIVER_COMPONENT)); in testSetOrganizationColor()
52 mDevicePolicyManager.setOrganizationColor(ADMIN_RECEIVER_COMPONENT, previousColor); in testSetOrganizationColor()
58 mDevicePolicyManager.setOrganizationColor(null, Color.GRAY); in testSetOrGetOrganizationColorWithNullAdminFails()
64 int color = mDevicePolicyManager.getOrganizationColor(null); in testSetOrGetOrganizationColorWithNullAdminFails()
71 CharSequence organizationName = mDevicePolicyManager.getOrganizationName( in testDefaultOrganizationNameIsNull()
77 CharSequence previousOrganizationName = mDevicePolicyManager.getOrganizationName( in testSetOrganizationName()
82 mDevicePolicyManager.setOrganizationName(ADMIN_RECEIVER_COMPONENT, name); in testSetOrganizationName()
[all …]
DCrossProfileTest.java102 mDevicePolicyManager.setCrossProfilePackages( in testSetCrossProfilePackages_notProfileOwner_throwsSecurityException()
110 mDevicePolicyManager.getCrossProfilePackages(NON_ADMIN_RECEIVER); in testGetCrossProfilePackages_notProfileOwner_throwsSecurityException()
116 assertThat(mDevicePolicyManager.getCrossProfilePackages(ADMIN_RECEIVER_COMPONENT)) in testGetCrossProfilePackages_notSet_returnsEmpty()
121 mDevicePolicyManager.setCrossProfilePackages( in testGetCrossProfilePackages_whenSet_returnsEqual()
123 assertThat(mDevicePolicyManager.getCrossProfilePackages(ADMIN_RECEIVER_COMPONENT)) in testGetCrossProfilePackages_whenSet_returnsEqual()
131 mDevicePolicyManager.setCrossProfilePackages(ADMIN_RECEIVER_COMPONENT, packages1); in testGetCrossProfilePackages_whenSetTwice_returnsLatestNotConcatenated()
132 mDevicePolicyManager.setCrossProfilePackages(ADMIN_RECEIVER_COMPONENT, packages2); in testGetCrossProfilePackages_whenSetTwice_returnsLatestNotConcatenated()
134 assertThat(mDevicePolicyManager.getCrossProfilePackages(ADMIN_RECEIVER_COMPONENT)) in testGetCrossProfilePackages_whenSetTwice_returnsLatestNotConcatenated()
148 mDevicePolicyManager.setCrossProfilePackages( in testSetCrossProfilePackages_noAsserts()
154 mDevicePolicyManager.setCrossProfilePackages( in testSetCrossProfilePackages_firstTime_doesNotResetAnyAppOps()
[all …]
DResetPasswordWithTokenTest.java52 assertTrue(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, PASSWORD0, in testSetupWorkProfile()
59 assertTrue(mDevicePolicyManager.isResetPasswordTokenActive(ADMIN_RECEIVER_COMPONENT)); in testResetPasswordBeforeUnlock()
60 assertTrue(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, PASSWORD1, in testResetPasswordBeforeUnlock()
63 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in testResetPasswordBeforeUnlock()
65 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, 6); in testResetPasswordBeforeUnlock()
67 mDevicePolicyManager.isActivePasswordSufficient(); in testResetPasswordBeforeUnlock()
75 assertTrue(mDevicePolicyManager.isResetPasswordTokenActive(ADMIN_RECEIVER_COMPONENT)); in testClearPasswordBeforeUnlock()
76 assertTrue(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, null, in testClearPasswordBeforeUnlock()
90 assertTrue(mDevicePolicyManager.isActivePasswordSufficient()); in testClearPasswordBeforeUnlock()
94 assertTrue(mDevicePolicyManager.setResetPasswordToken(ADMIN_RECEIVER_COMPONENT, token)); in testSetResetPasswordToken()
[all …]
DActivePasswordSufficientForDeviceTest.java40 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in setUp()
42 mDevicePolicyManager.setRequiredPasswordComplexity(PASSWORD_COMPLEXITY_NONE); in setUp()
48 () -> mDevicePolicyManager.isActivePasswordSufficientForDeviceRequirement()); in testActivePsswordSufficientForDevice_notCallableOnProfileInstance()
61 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, PASSWORD_QUALITY_NUMERIC); in testActivePsswordSufficientForDevice_IrrelevantProfilePolicy()
62 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, 4); in testActivePsswordSufficientForDevice_IrrelevantProfilePolicy()
63 mDevicePolicyManager.setRequiredPasswordComplexity(PASSWORD_COMPLEXITY_MEDIUM); in testActivePsswordSufficientForDevice_IrrelevantProfilePolicy()
70 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in testActivePsswordSufficientForDevice_UnifiedPassword_BothPolicies()
72 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, 4); in testActivePsswordSufficientForDevice_UnifiedPassword_BothPolicies()
75 assertFalse(mDevicePolicyManager.isActivePasswordSufficient()); in testActivePsswordSufficientForDevice_UnifiedPassword_BothPolicies()
78 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in testActivePsswordSufficientForDevice_UnifiedPassword_BothPolicies()
[all …]
/cts/tests/admin/src/android/admin/cts/
DDevicePolicyManagerTest.java65 private DevicePolicyManager mDevicePolicyManager; field in DevicePolicyManagerTest
95 mDevicePolicyManager = (DevicePolicyManager) in setUp()
121 List<ComponentName> activeAdmins = mDevicePolicyManager.getActiveAdmins(); in testGetActiveAdmins()
124 assertTrue(mDevicePolicyManager.isAdminActive(mComponent)); in testGetActiveAdmins()
133 mDevicePolicyManager.clearProfileOwner(DeviceAdminInfoTest.getProfileOwnerComponent()); in testSetGetPreferentialNetworkServiceEnabled()
135 () -> mDevicePolicyManager.setPreferentialNetworkServiceEnabled(true)); in testSetGetPreferentialNetworkServiceEnabled()
137 () -> mDevicePolicyManager.isPreferentialNetworkServiceEnabled()); in testSetGetPreferentialNetworkServiceEnabled()
148 int originalValue = mDevicePolicyManager.getKeyguardDisabledFeatures(mComponent); in testKeyguardDisabledFeatures()
153 mDevicePolicyManager.setKeyguardDisabledFeatures(mComponent, which); in testKeyguardDisabledFeatures()
154 assertEquals(which, mDevicePolicyManager.getKeyguardDisabledFeatures(mComponent)); in testKeyguardDisabledFeatures()
[all …]
/cts/hostsidetests/devicepolicy/app/TransferOwnerOutgoingApp/src/com/android/cts/transferowner/
DTransferProfileOwnerOutgoingTest.java44 mDevicePolicyManager.getParentProfileInstance(mOutgoingComponentName); in testTransferWithPoliciesOutgoing()
45 mDevicePolicyManager.setCameraDisabled(mOutgoingComponentName, true); in testTransferWithPoliciesOutgoing()
46 mDevicePolicyManager.setPasswordQuality( in testTransferWithPoliciesOutgoing()
48 mDevicePolicyManager.setPasswordMinimumLength(mOutgoingComponentName, passwordLength); in testTransferWithPoliciesOutgoing()
49 mDevicePolicyManager.setCrossProfileCallerIdDisabled(mOutgoingComponentName, true); in testTransferWithPoliciesOutgoing()
54 mDevicePolicyManager.transferOwnership(mOutgoingComponentName, INCOMING_COMPONENT_NAME, b); in testTransferWithPoliciesOutgoing()
60 mDevicePolicyManager.transferOwnership(mOutgoingComponentName, INCOMING_COMPONENT_NAME, b); in testTransferOwnership()
61 assertTrue(mDevicePolicyManager.isAdminActive(INCOMING_COMPONENT_NAME)); in testTransferOwnership()
62 … assertTrue(mDevicePolicyManager.isProfileOwnerApp(INCOMING_COMPONENT_NAME.getPackageName())); in testTransferOwnership()
64 mDevicePolicyManager.isProfileOwnerApp(mOutgoingComponentName.getPackageName())); in testTransferOwnership()
[all …]
DTransferDeviceOwnerOutgoingTest.java45 mDevicePolicyManager.setCameraDisabled(mOutgoingComponentName, true); in testTransferWithPoliciesOutgoing()
46 mDevicePolicyManager.setPasswordQuality( in testTransferWithPoliciesOutgoing()
48 mDevicePolicyManager.setPasswordMinimumLength(mOutgoingComponentName, passwordLength); in testTransferWithPoliciesOutgoing()
49 mDevicePolicyManager.setKeepUninstalledPackages(mOutgoingComponentName, in testTransferWithPoliciesOutgoing()
51 mDevicePolicyManager.setSystemUpdatePolicy(mOutgoingComponentName, in testTransferWithPoliciesOutgoing()
54 mDevicePolicyManager.transferOwnership(mOutgoingComponentName, INCOMING_COMPONENT_NAME, b); in testTransferWithPoliciesOutgoing()
60 mDevicePolicyManager.transferOwnership(mOutgoingComponentName, INCOMING_COMPONENT_NAME, b); in testTransferOwnership()
61 assertTrue(mDevicePolicyManager.isAdminActive(INCOMING_COMPONENT_NAME)); in testTransferOwnership()
62 assertTrue(mDevicePolicyManager.isDeviceOwnerApp(INCOMING_COMPONENT_NAME.getPackageName())); in testTransferOwnership()
64 mDevicePolicyManager.isDeviceOwnerApp(mOutgoingComponentName.getPackageName())); in testTransferOwnership()
[all …]
/cts/hostsidetests/devicepolicy/app/PackageInstaller/src/com/android/cts/packageinstaller/
DClearDeviceOwnerTest.java39 private DevicePolicyManager mDevicePolicyManager; field in ClearDeviceOwnerTest
45 mDevicePolicyManager = (DevicePolicyManager) in setUp()
47 assertNotNull(mDevicePolicyManager); in setUp()
49 assertTrue(mDevicePolicyManager.isAdminActive(ADMIN_RECEIVER_COMPONENT)); in setUp()
50 assertTrue("App is not device owner", mDevicePolicyManager.isDeviceOwnerApp(PACKAGE_NAME)); in setUp()
55 mDevicePolicyManager.clearDeviceOwnerApp(PACKAGE_NAME); in tearDown()
56 assertFalse(mDevicePolicyManager.isDeviceOwnerApp(PACKAGE_NAME)); in tearDown()
68 for (int i = 0; i < 1000 && mDevicePolicyManager.isAdminActive(cn); i++) { in waitForActiveAdminRemoved()
71 assertFalse(mDevicePolicyManager.isAdminActive(cn)); in waitForActiveAdminRemoved()

123456