Home
last modified time | relevance | path

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

12345

/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DResetPasswordWithTokenTest.java56 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in tearDown()
66 assertFalse(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, in testBadTokenShouldFail()
75 assertTrue(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, in testChangePasswordWithToken()
79 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, PASSWORD_QUALITY_NUMERIC); in testChangePasswordWithToken()
80 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, 6); in testChangePasswordWithToken()
84 assertTrue(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, in testChangePasswordWithToken()
93 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, PASSWORD_QUALITY_NUMERIC); in testResetPasswordFailIfQualityNotMet()
94 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, 6); in testResetPasswordFailIfQualityNotMet()
96 assertFalse(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, in testResetPasswordFailIfQualityNotMet()
99 assertTrue(mDevicePolicyManager.resetPasswordWithToken(ADMIN_RECEIVER_COMPONENT, in testResetPasswordFailIfQualityNotMet()
[all …]
DDevicePolicyLoggingTest.java52 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in testPasswordMethodsLogged()
54 mDevicePolicyManager.setPasswordMinimumLength(ADMIN_RECEIVER_COMPONENT, 13); in testPasswordMethodsLogged()
55 mDevicePolicyManager.setPasswordMinimumNumeric(ADMIN_RECEIVER_COMPONENT, 14); in testPasswordMethodsLogged()
56 mDevicePolicyManager.setPasswordMinimumNonLetter(ADMIN_RECEIVER_COMPONENT, 15); in testPasswordMethodsLogged()
57 mDevicePolicyManager.setPasswordMinimumLetters(ADMIN_RECEIVER_COMPONENT, 16); in testPasswordMethodsLogged()
58 mDevicePolicyManager.setPasswordMinimumLowerCase(ADMIN_RECEIVER_COMPONENT, 17); in testPasswordMethodsLogged()
59 mDevicePolicyManager.setPasswordMinimumUpperCase(ADMIN_RECEIVER_COMPONENT, 18); in testPasswordMethodsLogged()
60 mDevicePolicyManager.setPasswordMinimumSymbols(ADMIN_RECEIVER_COMPONENT, 19); in testPasswordMethodsLogged()
61 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in testPasswordMethodsLogged()
66 mDevicePolicyManager.lockNow(0); in testLockNowLogged()
[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 …]
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 …]
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 …]
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 …]
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 …]
DLockTaskTest.java138 private DevicePolicyManager mDevicePolicyManager; field in LockTaskTest
143 mDevicePolicyManager = mContext.getSystemService(DevicePolicyManager.class); in setUp()
144 mDevicePolicyManager.setLockTaskPackages(ADMIN_COMPONENT, new String[0]); in setUp()
158 mDevicePolicyManager.setLockTaskPackages(ADMIN_COMPONENT, new String[0]); in tearDown()
165 mDevicePolicyManager.setLockTaskPackages(ADMIN_COMPONENT, packages); in testSetLockTaskPackages()
166 assertArrayEquals(packages, mDevicePolicyManager.getLockTaskPackages(ADMIN_COMPONENT)); in testSetLockTaskPackages()
167 assertTrue(mDevicePolicyManager.isLockTaskPermitted(TEST_PACKAGE)); in testSetLockTaskPackages()
169 mDevicePolicyManager.setLockTaskPackages(ADMIN_COMPONENT, new String[0]); in testSetLockTaskPackages()
170 assertEquals(0, mDevicePolicyManager.getLockTaskPackages(ADMIN_COMPONENT).length); in testSetLockTaskPackages()
171 assertFalse(mDevicePolicyManager.isLockTaskPermitted(TEST_PACKAGE)); in testSetLockTaskPackages()
[all …]
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()
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()
DInputMethodsTest.java32 mDevicePolicyManager.setPermittedInputMethods(ADMIN_RECEIVER_COMPONENT, null); in testPermittedInputMethods()
34 mDevicePolicyManager.getPermittedInputMethods(ADMIN_RECEIVER_COMPONENT)).isNull(); in testPermittedInputMethods()
37 mDevicePolicyManager.setPermittedInputMethods(ADMIN_RECEIVER_COMPONENT, new ArrayList<>()); in testPermittedInputMethods()
39 mDevicePolicyManager.getPermittedInputMethods(ADMIN_RECEIVER_COMPONENT)).isEmpty(); in testPermittedInputMethods()
43 mDevicePolicyManager.setPermittedInputMethods(ADMIN_RECEIVER_COMPONENT, packages); in testPermittedInputMethods()
45 mDevicePolicyManager.getPermittedInputMethods(ADMIN_RECEIVER_COMPONENT)) in testPermittedInputMethods()
51 mDevicePolicyManager.setPermittedInputMethods(badAdmin, null); in testPermittedInputMethodsThrowsIfWrongAdmin()
56 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/
DAdminActionBookkeepingTest.java61 mDevicePolicyManager.setSecurityLoggingEnabled(getWho(), false); in tearDown()
62 mDevicePolicyManager.setNetworkLoggingEnabled(getWho(), false); in tearDown()
63 mDevicePolicyManager.uninstallCaCert(getWho(), TEST_CA.getBytes()); in tearDown()
73 final long previousTimestamp = mDevicePolicyManager.getLastSecurityLogRetrievalTime(); in testRetrieveSecurityLogs()
75 mDevicePolicyManager.setSecurityLoggingEnabled(getWho(), true); in testRetrieveSecurityLogs()
78 mDevicePolicyManager.retrieveSecurityLogs(getWho()); in testRetrieveSecurityLogs()
81 final long firstTimestamp = mDevicePolicyManager.getLastSecurityLogRetrievalTime(); in testRetrieveSecurityLogs()
89 mDevicePolicyManager.retrievePreRebootSecurityLogs(getWho()) != null; in testRetrieveSecurityLogs()
92 final long secondTimestamp = mDevicePolicyManager.getLastSecurityLogRetrievalTime(); in testRetrieveSecurityLogs()
115 final long previousTimestamp = mDevicePolicyManager.getLastBugReportRequestTime(); in testRequestBugreport()
[all …]
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 …]
DOverrideApnTest.java85 List <ApnSetting> apnList = mDevicePolicyManager.getOverrideApns(getWho()); in tearDown()
87 boolean deleted = mDevicePolicyManager.removeOverrideApn(getWho(), apn.getId()); in tearDown()
90 mDevicePolicyManager.setOverrideApnsEnabled(getWho(), false); in tearDown()
94 int insertedId = mDevicePolicyManager.addOverrideApn(getWho(), testApnFull); in testAddGetRemoveOverrideApn()
96 List <ApnSetting> apnList = mDevicePolicyManager.getOverrideApns(getWho()); in testAddGetRemoveOverrideApn()
120 assertTrue(mDevicePolicyManager.removeOverrideApn(getWho(), insertedId)); in testAddGetRemoveOverrideApn()
121 apnList = mDevicePolicyManager.getOverrideApns(getWho()); in testAddGetRemoveOverrideApn()
126 assertFalse(mDevicePolicyManager.removeOverrideApn(getWho(), -1)); in testRemoveOverrideApnFailsForIncorrectId()
130 mDevicePolicyManager.addOverrideApn(getWho(), testApnFull); in testInsertConflictingApn()
131 int insertConflictingId = mDevicePolicyManager.addOverrideApn(getWho(), testApnFull); in testInsertConflictingApn()
[all …]
DCreateAndManageUserTest.java69 mDevicePolicyManager.clearUserRestriction(getWho(), UserManager.DISALLOW_ADD_USER); in tearDown()
70 mDevicePolicyManager.clearUserRestriction(getWho(), UserManager.DISALLOW_REMOVE_USER); in tearDown()
77 UserHandle userHandle = mDevicePolicyManager.createAndManageUser( in testCreateAndManageUser()
90 mDevicePolicyManager.createAndManageUser( in testCreateAndManageUser_LowStorage()
106 mDevicePolicyManager.createAndManageUser( in testCreateAndManageUser_MaxUsers()
134 UserHandle userHandle = mDevicePolicyManager.createAndManageUser( in testCreateAndManageUser_GetSecondaryUsers()
142 List<UserHandle> secondaryUsers = mDevicePolicyManager.getSecondaryUsers(getWho()); in testCreateAndManageUser_GetSecondaryUsers()
153 UserHandle userHandle = mDevicePolicyManager.createAndManageUser( in testCreateAndManageUser_SwitchUser()
165 assertTrue(mDevicePolicyManager.switchUser(getWho(), userHandle)); in testCreateAndManageUser_SwitchUser()
178 UserHandle userHandle = mDevicePolicyManager.createAndManageUser( in testCreateAndManageUser_CannotStopCurrentUser()
[all …]
DSetTimeTest.java69 assertTrue("failed to set time", mDevicePolicyManager.setTime(getWho(), testTime)); in testSetTimeWithValue()
80 mDevicePolicyManager.setGlobalSetting(getWho(), Settings.Global.AUTO_TIME, "0"); in testSetTime()
86 mDevicePolicyManager.setGlobalSetting(getWho(), Settings.Global.AUTO_TIME, "1"); in testSetTimeFailWithAutoTimeOn()
87 assertFalse(mDevicePolicyManager.setTime(getWho(), TEST_TIME_1)); in testSetTimeFailWithAutoTimeOn()
104 mDevicePolicyManager.setTimeZone(getWho(), testTimeZone)); in testSetTimeZoneWithValue()
122 mDevicePolicyManager.setGlobalSetting(getWho(), Settings.Global.AUTO_TIME_ZONE, "0"); in testSetTimeZone()
134 mDevicePolicyManager.setGlobalSetting(getWho(), Settings.Global.AUTO_TIME_ZONE, "1"); in testSetTimeZone()
139 mDevicePolicyManager.setGlobalSetting(getWho(), Settings.Global.AUTO_TIME_ZONE, "1"); in testSetTimeZoneFailWithAutoTimezoneOn()
140 assertFalse(mDevicePolicyManager.setTimeZone(getWho(), TEST_TIME_ZONE_1)); in testSetTimeZoneFailWithAutoTimezoneOn()
149 mDevicePolicyManager.setGlobalSetting(getWho(), Settings.Global.AUTO_TIME, "0"); in restoreTime()
[all …]
/cts/tests/admin/src/android/admin/cts/
DDevicePolicyManagerTest.java63 private DevicePolicyManager mDevicePolicyManager; field in DevicePolicyManagerTest
93 mDevicePolicyManager = (DevicePolicyManager) in setUp()
111 List<ComponentName> activeAdmins = mDevicePolicyManager.getActiveAdmins(); in testGetActiveAdmins()
114 assertTrue(mDevicePolicyManager.isAdminActive(mComponent)); in testGetActiveAdmins()
122 int originalValue = mDevicePolicyManager.getKeyguardDisabledFeatures(mComponent); in testKeyguardDisabledFeatures()
127 mDevicePolicyManager.setKeyguardDisabledFeatures(mComponent, which); in testKeyguardDisabledFeatures()
128 assertEquals(which, mDevicePolicyManager.getKeyguardDisabledFeatures(mComponent)); in testKeyguardDisabledFeatures()
131 mDevicePolicyManager.setKeyguardDisabledFeatures(mComponent, originalValue); in testKeyguardDisabledFeatures()
141 mDevicePolicyManager.requestBugreport(mComponent); in testRequestRemoteBugreport_failIfNotDeviceOwner()
154 mDevicePolicyManager.setSecurityLoggingEnabled(mComponent, true); in testSetSecurityLoggingEnabled_failIfNotDeviceOwner()
[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 …]
DPasswordMinimumRestrictionsTest.java53 mParentDpm = mDevicePolicyManager.getParentProfileInstance(ADMIN_RECEIVER_COMPONENT); in setUp()
55 mDevicePolicyManager.getPasswordQuality(ADMIN_RECEIVER_COMPONENT); in setUp()
57 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, PASSWORD_QUALITY_COMPLEX); in setUp()
61 .add(invokeGetMethod(method, mDevicePolicyManager, ADMIN_RECEIVER_COMPONENT)); in setUp()
70 invokeSetMethod(METHOD_LIST[i], mDevicePolicyManager, ADMIN_RECEIVER_COMPONENT, in tearDown()
75 mDevicePolicyManager.setPasswordQuality(ADMIN_RECEIVER_COMPONENT, in tearDown()
83 invokeSetMethod(METHOD_LIST[i], mDevicePolicyManager, ADMIN_RECEIVER_COMPONENT, in testPasswordMinimumRestriction()
93 TEST_PASSWORD_LENGTH + i, invokeGetMethod(METHOD_LIST[i], mDevicePolicyManager, in testPasswordMinimumRestriction()
109 invokeSetMethod(method, mDevicePolicyManager, null, TEST_PASSWORD_LENGTH); in testSetPasswordMinimumRestrictionWithNull()
137 invokeSetMethod(METHOD_LIST[i], mDevicePolicyManager, ADMIN_RECEIVER_COMPONENT, in testGetPasswordMinimumRestrictionWithNullAdmin()
[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.setPasswordMinimumLength(mOutgoingComponentName, passwordLength); in testTransferWithPoliciesOutgoing()
47 mDevicePolicyManager.setCrossProfileCallerIdDisabled(mOutgoingComponentName, true); in testTransferWithPoliciesOutgoing()
52 mDevicePolicyManager.transferOwnership(mOutgoingComponentName, INCOMING_COMPONENT_NAME, b); in testTransferWithPoliciesOutgoing()
58 mDevicePolicyManager.transferOwnership(mOutgoingComponentName, INCOMING_COMPONENT_NAME, b); in testTransferOwnership()
59 assertTrue(mDevicePolicyManager.isAdminActive(INCOMING_COMPONENT_NAME)); in testTransferOwnership()
60 … assertTrue(mDevicePolicyManager.isProfileOwnerApp(INCOMING_COMPONENT_NAME.getPackageName())); in testTransferOwnership()
62 mDevicePolicyManager.isProfileOwnerApp(mOutgoingComponentName.getPackageName())); in testTransferOwnership()
63 assertFalse(mDevicePolicyManager.isAdminActive(mOutgoingComponentName)); in testTransferOwnership()
[all …]
DTransferDeviceOwnerOutgoingTest.java45 mDevicePolicyManager.setCameraDisabled(mOutgoingComponentName, true); in testTransferWithPoliciesOutgoing()
46 mDevicePolicyManager.setPasswordMinimumLength(mOutgoingComponentName, passwordLength); in testTransferWithPoliciesOutgoing()
47 mDevicePolicyManager.setKeepUninstalledPackages(mOutgoingComponentName, in testTransferWithPoliciesOutgoing()
49 mDevicePolicyManager.setSystemUpdatePolicy(mOutgoingComponentName, in testTransferWithPoliciesOutgoing()
53 mDevicePolicyManager.transferOwnership(mOutgoingComponentName, INCOMING_COMPONENT_NAME, b); in testTransferWithPoliciesOutgoing()
59 mDevicePolicyManager.transferOwnership(mOutgoingComponentName, INCOMING_COMPONENT_NAME, b); in testTransferOwnership()
60 assertTrue(mDevicePolicyManager.isAdminActive(INCOMING_COMPONENT_NAME)); in testTransferOwnership()
61 assertTrue(mDevicePolicyManager.isDeviceOwnerApp(INCOMING_COMPONENT_NAME.getPackageName())); in testTransferOwnership()
63 mDevicePolicyManager.isDeviceOwnerApp(mOutgoingComponentName.getPackageName())); in testTransferOwnership()
64 assertFalse(mDevicePolicyManager.isAdminActive(mOutgoingComponentName)); 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()

12345