Home
last modified time | relevance | path

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

12345

/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
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 …]
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 …]
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 …]
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 …]
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.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()
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()
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/
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()
111 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 …]
DAffiliationTest.java43 private DevicePolicyManager mDevicePolicyManager; field in AffiliationTest
49 mDevicePolicyManager = (DevicePolicyManager) in setUp()
57 mDevicePolicyManager.setAffiliationIds(mAdminComponent, null); in testSetAffiliationId_null()
67 mDevicePolicyManager.setAffiliationIds(mAdminComponent, Collections.singleton(null)); in testSetAffiliationId_containsEmptyString()
93 mDevicePolicyManager.setLockTaskPackages(mAdminComponent, packages); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
94 assertArrayEquals(packages, mDevicePolicyManager.getLockTaskPackages(mAdminComponent)); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
95 assertTrue(mDevicePolicyManager.isLockTaskPermitted("package1")); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
96 assertFalse(mDevicePolicyManager.isLockTaskPermitted("package3")); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
99 mDevicePolicyManager.getAffiliationIds(mAdminComponent); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
104 assertFalse(mDevicePolicyManager.isLockTaskPermitted("package1")); in testSetLockTaskPackagesClearedIfUserBecomesUnaffiliated()
[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 …]
DBaseAffiliatedProfileOwnerTest.java31 protected DevicePolicyManager mDevicePolicyManager; field in BaseAffiliatedProfileOwnerTest
37 mDevicePolicyManager = mContext.getSystemService(DevicePolicyManager.class); in setUp()
42 assertNotNull(mDevicePolicyManager); in assertDeviceOrAffiliatedProfileOwner()
43 assertTrue(mDevicePolicyManager.isAdminActive(getWho())); in assertDeviceOrAffiliatedProfileOwner()
44 boolean isDeviceOwner = mDevicePolicyManager.isDeviceOwnerApp(mContext.getPackageName()); in assertDeviceOrAffiliatedProfileOwner()
45 boolean isAffiliatedProfileOwner = mDevicePolicyManager.isProfileOwnerApp( in assertDeviceOrAffiliatedProfileOwner()
47 && mDevicePolicyManager.isAffiliatedUser(); in assertDeviceOrAffiliatedProfileOwner()
DLockTaskTest.java149 private DevicePolicyManager mDevicePolicyManager; field in LockTaskTest
155 mDevicePolicyManager = mContext.getSystemService(DevicePolicyManager.class); in setUp()
156 mDevicePolicyManager.setLockTaskPackages(ADMIN_COMPONENT, new String[0]); in setUp()
171 mDevicePolicyManager.setLockTaskPackages(ADMIN_COMPONENT, new String[0]); in tearDown()
179 mDevicePolicyManager.setLockTaskPackages(ADMIN_COMPONENT, packages); in testSetLockTaskPackages()
180 assertArrayEquals(packages, mDevicePolicyManager.getLockTaskPackages(ADMIN_COMPONENT)); in testSetLockTaskPackages()
181 assertTrue(mDevicePolicyManager.isLockTaskPermitted(TEST_PACKAGE)); in testSetLockTaskPackages()
183 mDevicePolicyManager.setLockTaskPackages(ADMIN_COMPONENT, new String[0]); in testSetLockTaskPackages()
184 assertEquals(0, mDevicePolicyManager.getLockTaskPackages(ADMIN_COMPONENT).length); in testSetLockTaskPackages()
185 assertFalse(mDevicePolicyManager.isLockTaskPermitted(TEST_PACKAGE)); in testSetLockTaskPackages()
[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 …]
DBaseManagedProfileTest.java39 protected DevicePolicyManager mDevicePolicyManager; field in BaseManagedProfileTest
49 mDevicePolicyManager = (DevicePolicyManager) in setUp()
52 mDevicePolicyManager.getParentProfileInstance(ADMIN_RECEIVER_COMPONENT); in setUp()
53 assertNotNull(mDevicePolicyManager); in setUp()
55 assertTrue(mDevicePolicyManager.isAdminActive(ADMIN_RECEIVER_COMPONENT)); in setUp()
56 assertTrue(mDevicePolicyManager.isProfileOwnerApp( in setUp()
58 assertTrue(mDevicePolicyManager.isManagedProfile(ADMIN_RECEIVER_COMPONENT)); in setUp()
65 return isParent ? mParentDevicePolicyManager : mDevicePolicyManager; in getDevicePolicyManager()
/cts/tests/admin/src/android/admin/cts/
DDevicePolicyManagerTest.java64 private DevicePolicyManager mDevicePolicyManager; field in DevicePolicyManagerTest
94 mDevicePolicyManager = (DevicePolicyManager) in setUp()
112 List<ComponentName> activeAdmins = mDevicePolicyManager.getActiveAdmins(); in testGetActiveAdmins()
115 assertTrue(mDevicePolicyManager.isAdminActive(mComponent)); in testGetActiveAdmins()
123 int originalValue = mDevicePolicyManager.getKeyguardDisabledFeatures(mComponent); in testKeyguardDisabledFeatures()
128 mDevicePolicyManager.setKeyguardDisabledFeatures(mComponent, which); in testKeyguardDisabledFeatures()
129 assertEquals(which, mDevicePolicyManager.getKeyguardDisabledFeatures(mComponent)); in testKeyguardDisabledFeatures()
132 mDevicePolicyManager.setKeyguardDisabledFeatures(mComponent, originalValue); in testKeyguardDisabledFeatures()
142 mDevicePolicyManager.requestBugreport(mComponent); in testRequestRemoteBugreport_failIfNotDeviceOwner()
155 mDevicePolicyManager.setSecurityLoggingEnabled(mComponent, true); in testSetSecurityLoggingEnabled_failIfNotDeviceOwner()
[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