Home
last modified time | relevance | path

Searched refs:restrictions (Results 1 – 25 of 85) sorted by relevance

1234

/frameworks/base/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/template/scaffold/
DRestrictedMenuItemTest.kt53 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
55 setContent(restrictions, enabled = false) in <lambda>()
62 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
64 setContent(restrictions) in <lambda>()
71 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
73 setContent(restrictions) in <lambda>()
81 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
84 setContent(restrictions) in <lambda>()
91 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
94 setContent(restrictions) in <lambda>()
[all …]
/frameworks/base/packages/SettingsLib/SpaPrivileged/tests/src/com/android/settingslib/spaprivileged/template/preference/
DRestrictedTwoTargetSwitchPreferenceTest.kt62 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
64 setContent(restrictions) in <lambda>()
72 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
74 setContent(restrictions) in <lambda>()
82 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
85 setContent(restrictions) in <lambda>()
93 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
96 setContent(restrictions) in <lambda>()
104 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
107 setContent(restrictions) in <lambda>()
[all …]
DRestrictedSwitchPreferenceTest.kt61 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
63 setContent(restrictions) in <lambda>()
71 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
73 setContent(restrictions) in <lambda>()
81 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
84 setContent(restrictions) in <lambda>()
92 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
95 setContent(restrictions) in <lambda>()
103 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
106 setContent(restrictions) in <lambda>()
[all …]
DRestrictedPreferenceTest.kt56 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
58 setContent(restrictions) in <lambda>()
65 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
67 setContent(restrictions) in <lambda>()
75 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
78 setContent(restrictions) in <lambda>()
85 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
88 setContent(restrictions) in <lambda>()
96 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
99 setContent(restrictions) in <lambda>()
[all …]
DRestrictedMainSwitchPreferenceTest.kt59 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
61 setContent(restrictions) in <lambda>()
69 val restrictions = Restrictions(userId = USER_ID, keys = emptyList()) in <lambda>() constant
71 setContent(restrictions) in <lambda>()
79 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
82 setContent(restrictions) in <lambda>()
90 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
93 setContent(restrictions) in <lambda>()
101 val restrictions = Restrictions(userId = USER_ID, keys = listOf(RESTRICTION_KEY)) in <lambda>() constant
104 setContent(restrictions) in <lambda>()
[all …]
/frameworks/base/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/model/enterprise/
DRestrictionsProvider.kt55 restrictions: Restrictions, in restrictedModeState()
58 val restrictionsProvider = remember(restrictions) { in restrictedModeState()
59 this(context, restrictions) in restrictedModeState()
66 private val restrictions: Restrictions, constant in com.android.settingslib.spaprivileged.model.enterprise.RestrictionsProviderImpl
79 for (key in restrictions.keys) { in restrictedModeState()
80 if (userManager.hasBaseUserRestriction(key, UserHandle.of(restrictions.userId))) { in restrictedModeState()
84 for (key in restrictions.keys) { in restrictedModeState()
86 .checkIfRestrictionEnforced(context, key, restrictions.userId) in restrictedModeState()
90 restrictions.enhancedConfirmation?.let { ec -> in restrictedModeState()
/frameworks/base/packages/SystemUI/multivalentTests/src/com/android/systemui/brightness/data/repository/
DBrightnessPolicyRepositoryImplTest.kt79 val restrictions by collectLastValue(underTest.restrictionPolicy) in noRestrictionByDefaultForAllUsers() constant
81 assertThat(restrictions).isEqualTo(PolicyRestriction.NoRestriction) in noRestrictionByDefaultForAllUsers()
85 assertThat(restrictions).isEqualTo(PolicyRestriction.NoRestriction) in noRestrictionByDefaultForAllUsers()
105 val restrictions by collectLastValue(underTest.restrictionPolicy) in restrictDefaultUser() constant
107 assertThat(restrictions).isEqualTo(PolicyRestriction.Restricted(enforcedAdmin)) in restrictDefaultUser()
111 assertThat(restrictions).isEqualTo(PolicyRestriction.NoRestriction) in restrictDefaultUser()
131 val restrictions by collectLastValue(underTest.restrictionPolicy) in restrictMainUser() constant
133 assertThat(restrictions).isEqualTo(PolicyRestriction.NoRestriction) in restrictMainUser()
137 assertThat(restrictions).isEqualTo(PolicyRestriction.Restricted(enforcedAdmin)) in restrictMainUser()
155 val restrictions by collectLastValue(underTest.restrictionPolicy) in brightnessBaseUserRestriction_flagOff_noRestriction() constant
[all …]
/frameworks/base/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/preference/
DRestrictedTwoTargetSwitchPreference.kt32 restrictions: Restrictions, in <lambda>()
40 restrictions = restrictions,
51 restrictions: Restrictions,
54 if (restrictions.isEmpty()) {
58 val restrictedMode = restrictionsProviderFactory.rememberRestrictedMode(restrictions).value
DRestrictedSwitchPreference.kt31 restrictions: Restrictions, in RestrictedSwitchPreference()
33 RestrictedSwitchPreference(model, restrictions, ::RestrictionsProviderImpl) in RestrictedSwitchPreference()
40 restrictions: Restrictions, in RestrictedSwitchPreference()
43 if (restrictions.isEmpty()) { in RestrictedSwitchPreference()
47 restrictionsProviderFactory.RestrictedSwitchWrapper(model, restrictions) { in RestrictedSwitchPreference()
DRestrictedMainSwitchPreference.kt29 fun RestrictedMainSwitchPreference(model: SwitchPreferenceModel, restrictions: Restrictions) { in RestrictedMainSwitchPreference()
30 RestrictedMainSwitchPreference(model, restrictions, ::RestrictionsProviderImpl) in RestrictedMainSwitchPreference()
37 restrictions: Restrictions, in RestrictedMainSwitchPreference()
40 if (restrictions.keys.isEmpty()) { in RestrictedMainSwitchPreference()
44 restrictionsProviderFactory.RestrictedSwitchWrapper(model, restrictions) { in RestrictedMainSwitchPreference()
DRestrictedPreference.kt40 restrictions: Restrictions, in RestrictedPreference()
42 RestrictedPreference(model, restrictions, ::RestrictionsProviderImpl) in RestrictedPreference()
49 restrictions: Restrictions, in RestrictedPreference()
52 if (restrictions.keys.isEmpty()) { in RestrictedPreference()
56 val restrictedMode = restrictionsProviderFactory.rememberRestrictedMode(restrictions).value in RestrictedPreference()
/frameworks/base/services/core/java/com/android/server/pm/
DRestrictionsSet.java63 public RestrictionsSet(@UserIdInt int userId, @NonNull Bundle restrictions) { in RestrictionsSet() argument
64 if (restrictions.isEmpty()) { in RestrictionsSet()
67 mUserRestrictions.put(userId, restrictions); in RestrictionsSet()
76 public boolean updateRestrictions(@UserIdInt int userId, @Nullable Bundle restrictions) { in updateRestrictions() argument
78 !UserRestrictionsUtils.areEqual(mUserRestrictions.get(userId), restrictions); in updateRestrictions()
82 if (!BundleUtils.isEmpty(restrictions)) { in updateRestrictions()
83 mUserRestrictions.put(userId, restrictions); in updateRestrictions()
98 final Bundle restrictions = mUserRestrictions.valueAt(i); in removeRestrictionsForAllUsers() local
100 if (UserRestrictionsUtils.contains(restrictions, restriction)) { in removeRestrictionsForAllUsers()
101 restrictions.remove(restriction); in removeRestrictionsForAllUsers()
[all …]
DUserTypeFactory.java222 final Bundle restrictions = getDefaultProfileRestrictions(); in getDefaultTypeProfileTest() local
223 restrictions.putBoolean(UserManager.DISALLOW_FUN, true); in getDefaultTypeProfileTest()
249 .setDefaultRestrictions(restrictions) in getDefaultTypeProfileTest()
418 final Bundle restrictions = new Bundle(); in getDefaultSecondaryUserRestrictions() local
419 restrictions.putBoolean(UserManager.DISALLOW_OUTGOING_CALLS, true); in getDefaultSecondaryUserRestrictions()
420 restrictions.putBoolean(UserManager.DISALLOW_SMS, true); in getDefaultSecondaryUserRestrictions()
421 return restrictions; in getDefaultSecondaryUserRestrictions()
426 final Bundle restrictions = getDefaultSecondaryUserRestrictions(); in getDefaultGuestUserRestrictions() local
427 restrictions.putBoolean(UserManager.DISALLOW_CONFIG_WIFI, true); in getDefaultGuestUserRestrictions()
428 restrictions.putBoolean(UserManager.DISALLOW_INSTALL_UNKNOWN_SOURCES, true); in getDefaultGuestUserRestrictions()
[all …]
DUserRestrictionsUtils.java400 @Nullable Bundle restrictions, @NonNull String tag) throws IOException { in writeRestrictions() argument
401 writeRestrictions(XmlUtils.makeTyped(serializer), restrictions, tag); in writeRestrictions() local
405 @Nullable Bundle restrictions, @NonNull String tag) throws IOException { in writeRestrictions() argument
406 if (restrictions == null) { in writeRestrictions()
411 for (String key : restrictions.keySet()) { in writeRestrictions()
416 if (restrictions.getBoolean(key)) { in writeRestrictions()
426 public static void readRestrictions(XmlPullParser parser, Bundle restrictions) { in readRestrictions() argument
427 readRestrictions(XmlUtils.makeTyped(parser), restrictions); in readRestrictions() local
430 public static void readRestrictions(TypedXmlPullParser parser, Bundle restrictions) { in readRestrictions() argument
431 restrictions.clear(); in readRestrictions()
[all …]
/frameworks/base/services/devicepolicy/java/com/android/server/devicepolicy/
DBundlePolicySerializer.java75 private static void readBundle(Bundle restrictions, ArrayList<String> values, in readBundle() argument
93 restrictions.putStringArray(key, valueStrings); in readBundle()
95 restrictions.putBundle(key, readBundleEntry(parser, values)); in readBundle()
103 restrictions.putParcelableArray(key, in readBundle()
108 restrictions.putBoolean(key, Boolean.parseBoolean(value)); in readBundle()
110 restrictions.putInt(key, Integer.parseInt(value)); in readBundle()
112 restrictions.putString(key, value); in readBundle()
128 private static void writeBundle(Bundle restrictions, TypedXmlSerializer serializer) in writeBundle() argument
130 for (String key : restrictions.keySet()) { in writeBundle()
131 Object value = restrictions.get(key); in writeBundle()
/frameworks/base/services/tests/PackageManagerServiceTests/server/src/com/android/server/pm/
DRestrictionsSetTest.java51 Bundle restrictions = newRestrictions(UserManager.ENSURE_VERIFY_APPS); in testUpdateRestrictions_addRestrictions() local
53 assertTrue(mRestrictionsSet.updateRestrictions(originatingUserId, restrictions)); in testUpdateRestrictions_addRestrictions()
55 assertRestrictions(restrictions, mRestrictionsSet.getRestrictions(originatingUserId)); in testUpdateRestrictions_addRestrictions()
60 Bundle restrictions = newRestrictions(UserManager.ENSURE_VERIFY_APPS); in testUpdateRestrictions_removeRestrictions() local
61 mRestrictionsSet.updateRestrictions(originatingUserId, restrictions); in testUpdateRestrictions_removeRestrictions()
70 Bundle restrictions = newRestrictions(UserManager.ENSURE_VERIFY_APPS); in testUpdateRestrictions_noChange() local
71 mRestrictionsSet.updateRestrictions(originatingUserId, restrictions); in testUpdateRestrictions_noChange()
73 assertFalse(mRestrictionsSet.updateRestrictions(originatingUserId, restrictions)); in testUpdateRestrictions_noChange()
/frameworks/base/packages/SettingsLib/SpaPrivileged/src/com/android/settingslib/spaprivileged/template/scaffold/
DRestrictedMenuItem.kt34 restrictions: Restrictions, in MoreOptionsScope()
37 RestrictedMenuItemImpl(text, enabled, restrictions, onClick, ::RestrictionsProviderImpl) in MoreOptionsScope()
45 restrictions: Restrictions, in RestrictedMenuItemImpl()
49 val restrictedMode = restrictionsProviderFactory.rememberRestrictedMode(restrictions).value in RestrictedMenuItemImpl()
/frameworks/base/services/restrictions/
DAndroid.bp11 name: "services.restrictions-sources",
18 name: "services.restrictions",
20 srcs: [":services.restrictions-sources"],
DOWNERS1 include /core/java/android/service/restrictions/OWNERS
/frameworks/base/services/tests/servicestests/src/com/android/server/pm/
DUserManagerServiceUserTypeTest.java76 final Bundle restrictions = makeRestrictionsBundle("r1", "r2"); in testUserTypeBuilder_createUserType() local
117 .setDefaultRestrictions(restrictions) in testUserTypeBuilder_createUserType()
137 assertTrue(UserRestrictionsUtils.areEqual(restrictions, type.getDefaultRestrictions())); in testUserTypeBuilder_createUserType()
138 assertNotSame(restrictions, type.getDefaultRestrictions()); in testUserTypeBuilder_createUserType()
323 final Bundle restrictions = makeRestrictionsBundle("no_config_vpn", "no_config_tethering"); in testUserTypeFactoryCustomize_profile() local
349 .setDefaultRestrictions(restrictions) in testUserTypeFactoryCustomize_profile()
357 .setDefaultRestrictions(restrictions) in testUserTypeFactoryCustomize_profile()
367 assertTrue(UserRestrictionsUtils.areEqual(restrictions, aospType.getDefaultRestrictions())); in testUserTypeFactoryCustomize_profile()
466 final Bundle restrictions = makeRestrictionsBundle("no_config_vpn", "no_config_tethering"); in testUserTypeFactoryCustomize_full() local
472 .setDefaultRestrictions(restrictions)); in testUserTypeFactoryCustomize_full()
[all …]
/frameworks/base/services/core/java/com/android/server/appop/
DAudioRestrictionManager.java155 final SparseArray<Restriction> restrictions = mZenModeAudioRestrictions.valueAt(o); in dump() local
156 for (int i = 0; i < restrictions.size(); i++) { in dump()
162 final int usage = restrictions.keyAt(i); in dump()
165 Restriction r = restrictions.valueAt(i); in dump()
/frameworks/base/services/tests/servicestests/src/com/android/server/devicepolicy/
DDpmTestUtils.java62 public static RestrictionsSet newRestrictions(int userId, String... restrictions) { in newRestrictions() argument
63 Bundle localRestrictionsBundle = newRestrictions(restrictions); in newRestrictions()
69 public static Bundle newRestrictions(String... restrictions) { in newRestrictions() argument
71 for (String restriction : restrictions) { in newRestrictions()
/frameworks/base/core/java/android/security/
Dresponsible_apis_flags.aconfig15 description: "Enables ASM restrictions for activity starts and finishes"
22 description: "Enables toasts when ASM restrictions are triggered"
/frameworks/base/cmds/incidentd/src/
DPrivacyFilter.cpp126 FieldStripper(const Privacy* restrictions, const sp<ProtoReader>& data,
172 FieldStripper::FieldStripper(const Privacy* restrictions, const sp<ProtoReader>& data, in FieldStripper() argument
174 :mRestrictions(restrictions), in FieldStripper()
254 PrivacyFilter::PrivacyFilter(int sectionId, const Privacy* restrictions) in PrivacyFilter() argument
256 mRestrictions(restrictions), in PrivacyFilter()
/frameworks/base/core/java/android/content/
DRestrictionsManager.java38 import android.service.restrictions.RestrictionsReceiver;
625 ArrayList<RestrictionEntry> restrictions = new ArrayList<>(); in loadManifestRestrictions() local
634 restrictions.add(restriction); in loadManifestRestrictions()
647 return restrictions; in loadManifestRestrictions()
783 RestrictionEntry[] restrictions = entry.getRestrictions(); in addRestrictionToBundle() local
784 Bundle childBundle = convertRestrictionsToBundle(Arrays.asList(restrictions)); in addRestrictionToBundle()

1234