Home
last modified time | relevance | path

Searched refs:restriction (Results 1 – 20 of 20) sorted by relevance

/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/userrestrictions/
DBaseUserRestrictionsTest.java112 protected void assertLayeredRestriction(String restriction, boolean expected) { in assertLayeredRestriction() argument
113 assertEquals("Restriction " + restriction + ": expected=" + expected, in assertLayeredRestriction()
114 expected, mUserManager.hasUserRestriction(restriction)); in assertLayeredRestriction()
117 protected void assertOwnerRestriction(String restriction, boolean expected) { in assertOwnerRestriction() argument
118 assertEquals("Restriction " + restriction + ": expected=" + expected, in assertOwnerRestriction()
120 .getBoolean(restriction)); in assertOwnerRestriction()
124 protected boolean hasBaseUserRestriction(String restriction, UserHandle userHandle) { in hasBaseUserRestriction() argument
126 (um) -> um.hasBaseUserRestriction(restriction, userHandle)); in hasBaseUserRestriction()
146 protected void assertSetClearUserRestriction(String restriction) { in assertSetClearUserRestriction() argument
147 final boolean hadRestriction = mUserManager.hasUserRestriction(restriction); in assertSetClearUserRestriction()
[all …]
DProfileGlobalRestrictionsTest.java23 private void assertRestriction(String restriction, boolean expected) { in assertRestriction() argument
25 expected, mUserManager.hasUserRestriction(restriction)); in assertRestriction()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DOrgOwnedProfileOwnerParentTest.java105 for (String restriction : PROFILE_OWNER_ORGANIZATION_OWNED_GLOBAL_RESTRICTIONS) { in testAddGetAndClearUserRestriction_onParent()
106 testAddGetAndClearUserRestriction_onParent(restriction); in testAddGetAndClearUserRestriction_onParent()
108 for (String restriction : PROFILE_OWNER_ORGANIZATION_OWNED_LOCAL_RESTRICTIONS) { in testAddGetAndClearUserRestriction_onParent()
109 testAddGetAndClearUserRestriction_onParent(restriction); in testAddGetAndClearUserRestriction_onParent()
121 private void testAddGetAndClearUserRestriction_onParent(String restriction) { in testAddGetAndClearUserRestriction_onParent() argument
122 mParentDevicePolicyManager.addUserRestriction(ADMIN_RECEIVER_COMPONENT, restriction); in testAddGetAndClearUserRestriction_onParent()
126 assertThat(restrictions.get(restriction)).isNotNull(); in testAddGetAndClearUserRestriction_onParent()
128 mParentDevicePolicyManager.clearUserRestriction(ADMIN_RECEIVER_COMPONENT, restriction); in testAddGetAndClearUserRestriction_onParent()
131 assertThat(restrictions.get(restriction)).isNull(); in testAddGetAndClearUserRestriction_onParent()
141 private void testUnableToAddBaseUserRestriction(String restriction) { in testUnableToAddBaseUserRestriction() argument
[all …]
DPolicyTransparencyTest.java66 private void runTestForRestriction(String restriction) throws Exception { in runTestForRestriction() argument
67 mDevicePolicyManager.addUserRestriction(ADMIN_RECEIVER_COMPONENT, restriction); in runTestForRestriction()
69 Intent intent = mDevicePolicyManager.createAdminSupportIntent(restriction); in runTestForRestriction()
71 assertEquals(restriction, intent.getStringExtra(DevicePolicyManager.EXTRA_RESTRICTION)); in runTestForRestriction()
73 mDevicePolicyManager.clearUserRestriction(ADMIN_RECEIVER_COMPONENT, restriction); in runTestForRestriction()
74 intent = mDevicePolicyManager.createAdminSupportIntent(restriction); in runTestForRestriction()
DUserRestrictionsParentTest.java230 for (String restriction : PROFILE_OWNER_ORGANIZATION_OWNED_LOCAL_RESTRICTIONS) { in testPerProfileUserRestriction_onParent()
233 restriction); in testPerProfileUserRestriction_onParent()
235 parentDevicePolicyManager.addUserRestriction(ADMIN_RECEIVER_COMPONENT, restriction); in testPerProfileUserRestriction_onParent()
237 assertThat(hasUserRestriction(restriction)).isTrue(); in testPerProfileUserRestriction_onParent()
239 assertThat(mUserManager.hasUserRestriction(restriction)).isEqualTo( in testPerProfileUserRestriction_onParent()
243 restriction); in testPerProfileUserRestriction_onParent()
244 assertThat(hasUserRestriction(restriction)).isFalse(); in testPerProfileUserRestriction_onParent()
267 for (String restriction : PROFILE_OWNER_ORGANIZATION_OWNED_GLOBAL_RESTRICTIONS) { in testPerDeviceUserRestriction_onParent()
269 parentDevicePolicyManager.addUserRestriction(ADMIN_RECEIVER_COMPONENT, restriction); in testPerDeviceUserRestriction_onParent()
271 assertThat(hasUserRestriction(restriction)).isTrue(); in testPerDeviceUserRestriction_onParent()
[all …]
DCustomizationRestrictionsTest.java49 RestrictionApplicator(String restriction) { in RestrictionApplicator() argument
50 mRestriction = restriction; in RestrictionApplicator()
/cts/hostsidetests/devicepolicy/app/CorpOwnedManagedProfile/src/com/android/cts/comp/provisioning/
DUserRestrictionTest.java35 private void setUserRestriction(String restriction, boolean add) { in setUserRestriction() argument
39 dpm.addUserRestriction(admin, restriction); in setUserRestriction()
41 dpm.clearUserRestriction(admin, restriction); in setUserRestriction()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DUserRestrictions.java221 public static String getRestrictionLabel(Context context, String restriction) { in getRestrictionLabel() argument
222 final UserRestrictionItem item = findRestrictionItem(restriction); in getRestrictionLabel()
226 public static String getUserAction(Context context, String restriction) { in getUserAction() argument
227 final UserRestrictionItem item = findRestrictionItem(restriction); in getUserAction()
231 private static UserRestrictionItem findRestrictionItem(String restriction) { in findRestrictionItem() argument
232 final UserRestrictionItem item = USER_RESTRICTION_ITEMS.get(restriction); in findRestrictionItem()
234 throw new IllegalArgumentException("Unknown restriction: " + restriction); in findRestrictionItem()
261 public static Intent getUserRestrictionTestIntent(Context context, String restriction, in getUserRestrictionTestIntent() argument
263 final UserRestrictionItem item = USER_RESTRICTION_ITEMS.get(restriction); in getUserRestrictionTestIntent()
268 .putExtra(CommandReceiverActivity.EXTRA_USER_RESTRICTION, restriction) in getUserRestrictionTestIntent()
[all …]
DByodHelperActivity.java340 final String restriction = intent.getStringExtra(EXTRA_PARAMETER_1); in onCreate() local
341 if (restriction != null) { in onCreate()
343 DeviceAdminTestReceiver.getReceiverComponentName(), restriction); in onCreate() local
346 final String restriction = intent.getStringExtra(EXTRA_PARAMETER_1); in onCreate() local
347 if (restriction != null) { in onCreate()
349 DeviceAdminTestReceiver.getReceiverComponentName(), restriction); in onCreate() local
548 private boolean isRestrictionSet(String restriction) { in isRestrictionSet() argument
552 return restrictions.getBoolean(restriction, false); in isRestrictionSet()
555 private void setRestriction(String restriction, boolean enabled) { in setRestriction() argument
557 mDevicePolicyManager.addUserRestriction(mAdminReceiverComponent, restriction); in setRestriction()
[all …]
DPolicyTransparencyTestListActivity.java142 for (String restriction : in addTestsToAdapter()
145 UserRestrictions.getUserRestrictionTestIntent(this, restriction, mMode); in addTestsToAdapter()
146 if (!UserRestrictions.isRestrictionValid(this, restriction)) { in addTestsToAdapter()
149 String title = UserRestrictions.getRestrictionLabel(this, restriction); in addTestsToAdapter()
DCommandReceiverActivity.java714 public static Intent createSetDeviceOwnerUserRestrictionIntent(String restriction, in createSetDeviceOwnerUserRestrictionIntent() argument
716 return createSetUserRestrictionIntent(restriction, enforced, /* currentUserDpm= */ false); in createSetDeviceOwnerUserRestrictionIntent()
722 public static Intent createSetCurrentUserRestrictionIntent(String restriction, in createSetCurrentUserRestrictionIntent() argument
724 return createSetUserRestrictionIntent(restriction, enforced, /* currentUserDpm= */ true); in createSetCurrentUserRestrictionIntent()
727 private static Intent createSetUserRestrictionIntent(String restriction, boolean enforced, in createSetUserRestrictionIntent() argument
729 Log.d(TAG, "createSetUserRestrictionIntent(): restriction=" + restriction in createSetUserRestrictionIntent()
737 .putExtra(EXTRA_USER_RESTRICTION, restriction) in createSetUserRestrictionIntent()
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DPrivateDnsPolicyTest.java61 private void setUserRestriction(String restriction, boolean add) { in setUserRestriction() argument
63 mDevicePolicyManager.addUserRestriction(getWho(), restriction); in setUserRestriction() local
65 mDevicePolicyManager.clearUserRestriction(getWho(), restriction); in setUserRestriction() local
DBluetoothRestrictionTest.java125 private void testOppDisabledWhenRestrictionSet(String restriction) { in testOppDisabledWhenRestrictionSet() argument
127 mDevicePolicyManager.addUserRestriction(getWho(), restriction); in testOppDisabledWhenRestrictionSet() local
134 mDevicePolicyManager.clearUserRestriction(getWho(), restriction); in testOppDisabledWhenRestrictionSet() local
/cts/hostsidetests/devicepolicy/app/TransferOwnerOutgoingApp/src/com/android/cts/transferowner/
DDeviceAndProfileOwnerTransferOutgoingTest.java173 private void setUserRestriction(String restriction, boolean add) { in setUserRestriction() argument
176 dpm.addUserRestriction(mOutgoingComponentName, restriction); in setUserRestriction()
178 dpm.clearUserRestriction(mOutgoingComponentName, restriction); in setUserRestriction()
/cts/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/
DManagedProfileTest.java151 String restriction = "no_debugging_features"; // UserManager.DISALLOW_DEBUGGING_FEATURES in testNoDebuggingFeaturesRestriction() local
153 changeUserRestrictionOrFail(restriction, true, mProfileUserId); in testNoDebuggingFeaturesRestriction()
159 changeUserRestriction(restriction, true, mProfileUserId); in testNoDebuggingFeaturesRestriction()
DBaseDevicePolicyTest.java1277 protected boolean isRestrictionSetOnUser(int userId, String restriction) throws Exception { in isRestrictionSetOnUser() argument
1309 if (restrictionsFound && line.contains(restriction)) { in isRestrictionSetOnUser()
DDeviceAndProfileOwnerTest.java1958 String restriction = getDevice().executeShellCommand(RESTRICT_BACKGROUND_GET_CMD); in ensureRestrictBackgroundPolicyOff() local
1959 if (restriction.contains("enabled")) { in ensureRestrictBackgroundPolicyOff()
/cts/
DAndroid.bp7 // every license restriction, it may not be entirely correct.
/cts/hostsidetests/sustainedperf/dhrystone/
DLICENSE.TXT20 the Software without restriction, including without limitation the rights to
DRationale283 restriction does not hold for the string functions of the C version