Home
last modified time | relevance | path

Searched refs:mDevicePolicyManager (Results 1 – 25 of 137) 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 …]
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 …]
DPolicyTransparencyTest.java30 mDevicePolicyManager.setCameraDisabled(ADMIN_RECEIVER_COMPONENT, true); in testCameraDisabled()
32 Intent intent = mDevicePolicyManager.createAdminSupportIntent( in testCameraDisabled()
38 mDevicePolicyManager.setCameraDisabled(ADMIN_RECEIVER_COMPONENT, false); in testCameraDisabled()
39 intent = mDevicePolicyManager.createAdminSupportIntent( in testCameraDisabled()
45 mDevicePolicyManager.setScreenCaptureDisabled(ADMIN_RECEIVER_COMPONENT, true); in testScreenCaptureDisabled()
47 Intent intent = mDevicePolicyManager.createAdminSupportIntent( in testScreenCaptureDisabled()
53 mDevicePolicyManager.setScreenCaptureDisabled(ADMIN_RECEIVER_COMPONENT, false); in testScreenCaptureDisabled()
54 intent = mDevicePolicyManager.createAdminSupportIntent( in testScreenCaptureDisabled()
67 mDevicePolicyManager.addUserRestriction(ADMIN_RECEIVER_COMPONENT, restriction); in runTestForRestriction()
69 Intent intent = mDevicePolicyManager.createAdminSupportIntent(restriction); in runTestForRestriction()
[all …]
DAccessibilityServicesTest.java32 mDevicePolicyManager.setPermittedAccessibilityServices(ADMIN_RECEIVER_COMPONENT, null); in testPermittedAccessibilityServices()
33 assertThat(mDevicePolicyManager. in testPermittedAccessibilityServices()
38 mDevicePolicyManager.setPermittedAccessibilityServices(ADMIN_RECEIVER_COMPONENT, in testPermittedAccessibilityServices()
40 assertThat(mDevicePolicyManager. in testPermittedAccessibilityServices()
46 mDevicePolicyManager.setPermittedAccessibilityServices(ADMIN_RECEIVER_COMPONENT, packages); in testPermittedAccessibilityServices()
47 assertThat(mDevicePolicyManager. in testPermittedAccessibilityServices()
54 mDevicePolicyManager.setPermittedAccessibilityServices(badAdmin, null); in testPermittedAccessibilityServicesThrowsIfWrongAdmin()
59 mDevicePolicyManager.getPermittedAccessibilityServices(badAdmin); in testPermittedAccessibilityServicesThrowsIfWrongAdmin()
DCommonCriteriaModeTest.java23 assertFalse(mDevicePolicyManager.isCommonCriteriaModeEnabled(ADMIN_RECEIVER_COMPONENT)); in testSettingCommonCriteriaMode()
24 assertFalse(mDevicePolicyManager.isCommonCriteriaModeEnabled(null)); in testSettingCommonCriteriaMode()
26 mDevicePolicyManager.setCommonCriteriaModeEnabled(ADMIN_RECEIVER_COMPONENT, true); in testSettingCommonCriteriaMode()
27 assertTrue(mDevicePolicyManager.isCommonCriteriaModeEnabled(ADMIN_RECEIVER_COMPONENT)); in testSettingCommonCriteriaMode()
28 assertTrue(mDevicePolicyManager.isCommonCriteriaModeEnabled(null)); in testSettingCommonCriteriaMode()
30 mDevicePolicyManager.setCommonCriteriaModeEnabled(ADMIN_RECEIVER_COMPONENT, false); in testSettingCommonCriteriaMode()
DKeyguardDisabledFeaturesTest.java26 mDevicePolicyManager.setKeyguardDisabledFeatures(ADMIN_RECEIVER_COMPONENT, in testSetKeyguardDisabledFeatures()
30 assertThat(mDevicePolicyManager.getKeyguardDisabledFeatures( in testSetKeyguardDisabledFeatures()
34 removeKeyguardDisableFeatures(mDevicePolicyManager); in testSetKeyguardDisabledFeatures()
35 mDevicePolicyManager.setKeyguardDisabledFeatures(ADMIN_RECEIVER_COMPONENT, in testSetKeyguardDisabledFeatures()
39 assertThat(mDevicePolicyManager.getKeyguardDisabledFeatures( in testSetKeyguardDisabledFeatures()
42 removeKeyguardDisableFeatures(mDevicePolicyManager); in testSetKeyguardDisabledFeatures()
47 mDevicePolicyManager.getParentProfileInstance(ADMIN_RECEIVER_COMPONENT); in testSetKeyguardDisabledFeatures_onParentSilentIgnoreWhenCallerIsNotOrgOwnedPO()
52 assertThat(mDevicePolicyManager.getKeyguardDisabledFeatures( in testSetKeyguardDisabledFeatures_onParentSilentIgnoreWhenCallerIsNotOrgOwnedPO()
58 mDevicePolicyManager.getParentProfileInstance(ADMIN_RECEIVER_COMPONENT); in testSetKeyguardDisabledFeatures_onParent()
DTrustAgentInfoTest.java41 mDevicePolicyManager.setTrustAgentConfiguration(ADMIN_RECEIVER_COMPONENT, in tearDown()
43 assertNull(mDevicePolicyManager.getTrustAgentConfiguration( in tearDown()
45 mDevicePolicyManager.setKeyguardDisabledFeatures(ADMIN_RECEIVER_COMPONENT, in tearDown()
52 mDevicePolicyManager.setTrustAgentConfiguration(ADMIN_RECEIVER_COMPONENT, in testSetAndGetTrustAgentConfiguration()
56 mDevicePolicyManager.getTrustAgentConfiguration( in testSetAndGetTrustAgentConfiguration()
60 configs = mDevicePolicyManager in testSetAndGetTrustAgentConfiguration()
64 configs = mDevicePolicyManager in testSetAndGetTrustAgentConfiguration()
68 mDevicePolicyManager.setKeyguardDisabledFeatures(ADMIN_RECEIVER_COMPONENT, in testSetAndGetTrustAgentConfiguration()
71 configs = mDevicePolicyManager in testSetAndGetTrustAgentConfiguration()
74 configs = mDevicePolicyManager in testSetAndGetTrustAgentConfiguration()
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()
DAlwaysOnVpnUnsupportedTest.java36 mDevicePolicyManager.getAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT)); in testAssertNoAlwaysOnVpn()
40 mDevicePolicyManager.setAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT, null, false); in testClearAlwaysOnVpn()
42 mDevicePolicyManager.getAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT)); in testClearAlwaysOnVpn()
47 mDevicePolicyManager.setAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT, VPN_PACKAGE, true); in testSetSupportedVpnAlwaysOn()
49 VPN_PACKAGE, mDevicePolicyManager.getAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT)); in testSetSupportedVpnAlwaysOn()
55 mDevicePolicyManager.setAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT, VPN_PACKAGE, true); in testSetUnsupportedVpnAlwaysOn()
60 assertNull(mDevicePolicyManager.getAlwaysOnVpnPackage(ADMIN_RECEIVER_COMPONENT)); in testSetUnsupportedVpnAlwaysOn()
/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 …]
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 …]
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 …]
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 …]
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 …]
/cts/tests/devicepolicy/src/android/devicepolicy/cts/
DSupportMessageTest.java65 private RemoteDevicePolicyManager mDevicePolicyManager; field in SupportMessageTest
72 mDevicePolicyManager = dpc.devicePolicyManager(); in setUp()
77 mDevicePolicyManager.setShortSupportMessage(mAdmin, /* charSequence= */ null); in tearDown()
78 mDevicePolicyManager.setLongSupportMessage(mAdmin, /* charSequence= */ null); in tearDown()
85 mDevicePolicyManager.setShortSupportMessage(mAdmin, VALID_SUPPORT_MESSAGE); in setShortSupportMessage_validText_works()
87 assertThat(mDevicePolicyManager.getShortSupportMessage(mAdmin)) in setShortSupportMessage_validText_works()
95 mDevicePolicyManager.setLongSupportMessage(mAdmin, VALID_SUPPORT_MESSAGE); in setLongSupportMessage_validText_works()
97 assertThat(mDevicePolicyManager.getLongSupportMessage(mAdmin)) in setLongSupportMessage_validText_works()
105 mDevicePolicyManager.setShortSupportMessage(mAdmin, EMPTY_SUPPORT_MESSAGE); in setShortSupportMessage_emptyText_works()
107 assertThat(mDevicePolicyManager.getShortSupportMessage(mAdmin)) in setShortSupportMessage_emptyText_works()
[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/tests/admin/src/android/admin/cts/
DDevicePolicyManagerTest.java72 private DevicePolicyManager mDevicePolicyManager; field in DevicePolicyManagerTest
100 mDevicePolicyManager = (DevicePolicyManager) in setUp()
118 List<ComponentName> activeAdmins = mDevicePolicyManager.getActiveAdmins(); in testGetActiveAdmins()
121 assertTrue(mDevicePolicyManager.isAdminActive(mComponent)); in testGetActiveAdmins()
130 mDevicePolicyManager.clearProfileOwner(DeviceAdminInfoTest.getProfileOwnerComponent()); in testSetGetPreferentialNetworkServiceEnabled()
132 () -> mDevicePolicyManager.setPreferentialNetworkServiceEnabled(true)); in testSetGetPreferentialNetworkServiceEnabled()
134 () -> mDevicePolicyManager.isPreferentialNetworkServiceEnabled()); in testSetGetPreferentialNetworkServiceEnabled()
149 int originalValue = mDevicePolicyManager.getKeyguardDisabledFeatures(mComponent); in testKeyguardDisabledFeatures()
154 mDevicePolicyManager.setKeyguardDisabledFeatures(mComponent, which); in testKeyguardDisabledFeatures()
155 assertEquals(which, mDevicePolicyManager.getKeyguardDisabledFeatures(mComponent)); in testKeyguardDisabledFeatures()
[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