Home
last modified time | relevance | path

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

1234

/packages/apps/Car/Settings/src/com/android/car/settings/enterprise/
DEnterpriseUtils.java127 public static int getAvailabilityStatusRestricted(Context context, String restriction) { in getAvailabilityStatusRestricted() argument
128 if (hasUserRestrictionByUm(context, restriction)) { in getAvailabilityStatusRestricted()
131 if (hasUserRestrictionByDpm(context, restriction)) { in getAvailabilityStatusRestricted()
144 public static boolean hasUserRestrictionByDpm(Context context, String restriction) { in hasUserRestrictionByDpm() argument
145 if (hasUserRestrictionByUm(context, restriction)) { in hasUserRestrictionByDpm()
148 return getUserManager(context).hasUserRestriction(restriction); in hasUserRestrictionByDpm()
155 public static boolean hasUserRestrictionByUm(Context context, String restriction) { in hasUserRestrictionByUm() argument
157 .hasBaseUserRestriction(restriction, UserHandle.of(context.getUserId())); in hasUserRestrictionByUm()
162 String restriction) { in onClickWhileDisabled() argument
163 if (hasUserRestrictionByDpm(context, restriction)) { in onClickWhileDisabled()
[all …]
DActionDisabledByAdminDialogFragment.java78 public static ActionDisabledByAdminDialogFragment newInstance(String restriction, in newInstance() argument
80 return newInstance(restriction, null, userId); in newInstance()
86 public static ActionDisabledByAdminDialogFragment newInstance(String restriction, in newInstance() argument
89 instance.mRestriction = restriction; in newInstance()
202 String restriction) { in setAdminSupportTitle() argument
203 builder.setTitle(mActionDisabledByAdminController.getAdminSupportTitle(restriction)); in setAdminSupportTitle()
DActionDisabledByAdminActivity.java45 String restriction = getRestrictionFromIntent(getIntent()); in onCreate() local
47 EnterpriseUtils.getActionDisabledByAdminDialog(this, restriction); in onCreate()
/packages/apps/Multiuser/Widget/src/main/java/com/android/multiuser/widget/data/
DIntentRepository.kt28 fun getUserSwitchRestrictedIntent(restriction: UserSwitchRestrictions) = in <lambda>()
37 .putExtra("title", res.getUserSwitchRestrictedTitle(restriction)) in <lambda>()
38 .putExtra("message", res.getUserSwitchRestrictedMessage(restriction)) in <lambda>()
39 .multiuserSettingsIntent(restriction) in <lambda>()
42 restriction: UserSwitchRestrictions in <lambda>()
44 return when (restriction) { in <lambda>()
57 restriction: UserSwitchRestrictions in <lambda>()
59 return when (restriction) { in <lambda>()
73 restriction: UserSwitchRestrictions in <lambda>()
75 if (restriction == UserSwitchRestrictions.DISABLED) { in <lambda>()
/packages/modules/Telephony/services/QualifiedNetworksService/src/com/android/telephony/qns/
DRestrictManager.java233 Restriction restriction = (Restriction) message.obj; in handleMessage() local
239 + restrictTypeToString(restriction.mRestrictType)); in handleMessage()
240 if (restriction in handleMessage()
244 .get(restriction.mRestrictType)) { in handleMessage()
245 releaseRestriction(transportType, restriction.mRestrictType); in handleMessage()
247 .getOrDefault(restriction, INVALID_ID)); in handleMessage()
248 mRestrictionTimers.remove(restriction); in handleMessage()
448 for (Restriction restriction : mRestrictionMap.values()) { in toString()
449 builder.append(restriction.toString()).append(" "); in toString()
682 Restriction restriction = in onLowRtpQualityEvent() local
[all …]
/packages/apps/Settings/src/com/android/settings/enterprise/
DActionDisabledByAdminDialog.java45 final String restriction = getRestrictionFromIntent(getIntent()); in onCreate() local
46 mDialogHelper = new ActionDisabledByAdminDialogHelper(this, restriction); in onCreate()
47 mDialogHelper.prepareDialogBuilder(restriction, enforcedAdmin) in onCreate()
56 final String restriction = getRestrictionFromIntent(intent); in onNewIntent() local
57 mDialogHelper.updateDialog(restriction, admin); in onNewIntent()
74 final String restriction = getRestrictionFromIntent(intent); in getAdminDetailsFromIntent() local
75 if (android.security.Flags.aapmApi() && dpm != null && restriction != null) { in getAdminDetailsFromIntent()
78 launchAdvancedProtectionDialogOrTryToSetAdminComponent(dpm, userId, restriction, in getAdminDetailsFromIntent()
81 adminDetails = dpm.getEnforcingAdminAndUserDetails(userId, restriction); in getAdminDetailsFromIntent()
105 int userId, String restriction, EnforcedAdmin enforcedAdmin) { in launchAdvancedProtectionDialogOrTryToSetAdminComponent() argument
[all …]
DActionDisabledByAdminDialogHelper.java65 public ActionDisabledByAdminDialogHelper(Activity activity, String restriction) { in ActionDisabledByAdminDialogHelper() argument
70 .createInstance(mActivity, restriction, in ActionDisabledByAdminDialogHelper()
90 public AlertDialog.Builder prepareDialogBuilder(String restriction, in prepareDialogBuilder() argument
98 prepareDialogBuilder(builder, restriction, enforcedAdmin); in prepareDialogBuilder()
103 void prepareDialogBuilder(AlertDialog.Builder builder, String restriction, in prepareDialogBuilder() argument
109 mRestriction = restriction; in prepareDialogBuilder()
115 public void updateDialog(String restriction, EnforcedAdmin admin) { in updateDialog() argument
116 if (mEnforcedAdmin.equals(admin) && Objects.equals(mRestriction, restriction)) { in updateDialog()
120 mRestriction = restriction; in updateDialog()
126 String restriction) { in initializeDialogViews() argument
[all …]
/packages/apps/Car/Settings/tests/multivalent/src/com/android/car/settings/testutils/
DEnterpriseTestUtils.java29 public static void mockUserRestrictionSetByUm(UserManager um, String restriction, in mockUserRestrictionSetByUm() argument
31 when(um.hasBaseUserRestriction(eq(restriction), any())) in mockUserRestrictionSetByUm()
36 when(um.hasUserRestriction(restriction)).thenReturn(restricted); in mockUserRestrictionSetByUm()
40 public static void mockUserRestrictionSetByDpm(UserManager um, String restriction, in mockUserRestrictionSetByDpm() argument
42 mockUserRestrictionSetByUm(um, restriction, false); in mockUserRestrictionSetByDpm()
43 when(um.hasUserRestriction(restriction)).thenReturn(restricted); in mockUserRestrictionSetByDpm()
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/
DActionDisabledByAdminDialogHelper.java71 public AlertDialog.Builder prepareDialogBuilder(String restriction, in prepareDialogBuilder() argument
74 mRestriction = restriction; in prepareDialogBuilder()
100 public void updateDialog(String restriction, EnforcedAdmin admin) { in updateDialog() argument
101 if (mEnforcedAdmin.equals(admin) && Objects.equals(mRestriction, restriction)) { in updateDialog()
105 mRestriction = restriction; in updateDialog()
111 String restriction) { in initializeDialogViews() argument
116 setAdminSupportTitle(root, restriction); in initializeDialogViews()
129 void setAdminSupportTitle(View root, String restriction) { in setAdminSupportTitle() argument
134 if (restriction == null) { in setAdminSupportTitle()
138 switch (restriction) { in setAdminSupportTitle()
DActionDisabledByAdminDialog.java41 final String restriction = getRestrictionFromIntent(getIntent()); in onCreate() local
43 AlertDialog dialog = mDialogHelper.prepareDialogBuilder(restriction, enforcedAdmin) in onCreate()
53 final String restriction = getRestrictionFromIntent(intent); in onNewIntent() local
54 mDialogHelper.updateDialog(restriction, admin); in onNewIntent()
/packages/services/Car/libs/car-helper-lib/src/com/android/car/internal/user/
DUserHelper.java86 for (String restriction : DEFAULT_NON_ADMIN_RESTRICTIONS) { in grantAdminPermissions()
87 userManager.setUserRestriction(restriction, /* enable= */ false, user); in grantAdminPermissions()
89 for (String restriction : OPTIONAL_NON_ADMIN_RESTRICTIONS) { in grantAdminPermissions()
90 userManager.setUserRestriction(restriction, /* enable= */ false, user); in grantAdminPermissions()
107 for (String restriction : DEFAULT_NON_ADMIN_RESTRICTIONS) { in setDefaultNonAdminRestrictions()
108 userManager.setUserRestriction(restriction, enable, user); in setDefaultNonAdminRestrictions()
/packages/modules/DeviceLock/DeviceLockController/src/com/android/devicelockcontroller/policy/
DUserRestrictionsPolicyHandler.java165 String restriction = restrictions.valueAt(i);
166 if (userRestrictionBundle.getBoolean(restriction, false) != enable) {
168 mDpm.addUserRestriction(null /* admin */, restriction);
169 LogUtil.v(TAG, String.format(Locale.US, "enable %s restriction", restriction));
171 mDpm.clearUserRestriction(null /* admin */, restriction);
172 LogUtil.v(TAG, String.format(Locale.US, "clear %s restriction", restriction));
/packages/apps/Car/Settings/tests/multivalent/src/com/android/car/settings/qc/
DBaseSettingsQCItemTestCase.java53 protected void setBaseUserRestriction(String restriction, boolean restricted) { in setBaseUserRestriction() argument
54 when(mUm.hasBaseUserRestriction(eq(restriction), any())).thenReturn(restricted); in setBaseUserRestriction()
58 protected void setUserRestriction(String restriction, boolean restricted) { in setUserRestriction() argument
59 when(mUm.hasUserRestriction(restriction)).thenReturn(restricted); in setUserRestriction()
/packages/apps/Multiuser/Widget/src/main/java/com/android/multiuser/widget/domain/
DUserSwitchUseCase.kt36 val restriction = usersRepo.checkUserSwitchRestrictions() in invoke() constant
37 if (restriction != UserSwitchRestrictions.NONE) { in invoke()
38 return intentRepo.getUserSwitchRestrictedIntent(restriction); in invoke()
/packages/apps/Settings/tests/robotests/testutils/com/android/settings/testutils/shadow/
DShadowUserManager.java147 public void addBaseUserRestriction(String restriction) { in addBaseUserRestriction() argument
148 mBaseRestrictions.add(restriction); in addBaseUserRestriction()
167 public void addGuestUserRestriction(String restriction) { in addGuestUserRestriction() argument
168 mDefaultGuestUserRestriction.putBoolean(restriction, true); in addGuestUserRestriction()
171 public boolean hasGuestUserRestriction(String restriction, boolean expectedValue) { in hasGuestUserRestriction() argument
172 return mDefaultGuestUserRestriction.containsKey(restriction) in hasGuestUserRestriction()
173 && mDefaultGuestUserRestriction.getBoolean(restriction) == expectedValue; in hasGuestUserRestriction()
/packages/apps/Car/Settings/src/com/android/car/settings/qc/
DQCUtils.java53 public static PendingIntent getActionDisabledDialogIntent(Context context, String restriction) { in getActionDisabledDialogIntent() argument
54 return getActionDisabledDialogIntent(context, restriction, /* requestCode= */ 0); in getActionDisabledDialogIntent()
61 public static PendingIntent getActionDisabledDialogIntent(Context context, String restriction, in getActionDisabledDialogIntent() argument
65 intent.putExtra(DevicePolicyManager.EXTRA_RESTRICTION, restriction); in getActionDisabledDialogIntent()
/packages/apps/Settings/src/com/android/settings/
DSettingsPreferenceBindingFactory.kt20 import com.android.settings.restriction.PreferenceRestrictionMixin
21 import com.android.settings.restriction.getRestrictionEnforcedAdmin
22 import com.android.settings.restriction.hasBaseUserRestriction
/packages/services/Car/tests/CarLibUnitTest/src/com/android/car/internal/user/
DUserHelperUnitTest.java156 for (String restriction : UserHelper.DEFAULT_NON_ADMIN_RESTRICTIONS) { in testGrantingAdminPermissionsRemovesNonAdminRestrictions()
157 verify(mUserManager).setUserRestriction(restriction, restrictionEnabled, in testGrantingAdminPermissionsRemovesNonAdminRestrictions()
160 for (String restriction : UserHelper.DEFAULT_NON_ADMIN_RESTRICTIONS) { in testGrantingAdminPermissionsRemovesNonAdminRestrictions()
161 verify(mUserManager).setUserRestriction(restriction, restrictionEnabled, in testGrantingAdminPermissionsRemovesNonAdminRestrictions()
/packages/services/Car/tests/CarTestDpc/src/com/android/car/testdpc/
DDpcShellCommand.java193 String restriction = mArgs[3]; in runAddUserRestriction() local
203 Log.d(TAG, targetDpm.getUser() + ": addUserRestriction(" + restriction + ")"); in runAddUserRestriction()
205 targetDpm.addUserRestriction(restriction); in runAddUserRestriction()
209 String restriction = mArgs[1]; in runClearUserRestriction() local
210 Log.i(TAG, "Calling clearUserRestriction(" + restriction + ")"); in runClearUserRestriction()
211 mDpm.clearUserRestriction(mAdmin, restriction); in runClearUserRestriction()
DDpcActivity.java108 String restriction = mKey.getText().toString(); in uiAddUserRestriction() local
124 targetDpm.addUserRestriction(restriction); in uiAddUserRestriction()
125 showToast("%s: addUserRestriction(%s)", targetDpm.getUser(), restriction); in uiAddUserRestriction()
127 showToast(e, "Exception when calling addUserRestriction(%s)", restriction); in uiAddUserRestriction()
/packages/apps/Car/Launcher/libs/car-launcher-common/src/com/android/car/carlaunchercommon/shortcuts/
DForceStopShortcutItem.kt127 val restriction = UserManager.DISALLOW_APPS_CONTROL in <lambda>() constant
133 if (!userManager.hasUserRestriction(restriction)) { in <lambda>()
137 if (hasBaseUserRestriction(userManager, restriction, user)) { in <lambda>()
138 if (DEBUG) Log.d(TAG, " Disabled because $user has $restriction restriction") in <lambda>()
/packages/apps/Settings/src/com/android/settings/bluetooth/
DRestrictionUtils.java38 public EnforcedAdmin checkIfRestrictionEnforced(Context context, String restriction) { in checkIfRestrictionEnforced() argument
40 context, restriction, UserHandle.myUserId()); in checkIfRestrictionEnforced()
/packages/apps/TvSettings/SettingsAPI/java/com/android/tv/settings/library/settingslib/enterprise/
DManagedDeviceActionDisabledByAdminController.java125 public String getAdminSupportTitle(@Nullable String restriction) { in getAdminSupportTitle() argument
126 if (restriction == null) { in getAdminSupportTitle()
129 switch (restriction) { in getAdminSupportTitle()
/packages/services/Car/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/users/
DUserRestrictionsFragment.java90 String restriction = item.getKey(); in onViewCreated()
92 userManager.setUserRestriction(restriction, added); in onViewCreated()
94 restrictions.add(restriction); in onViewCreated()
/packages/apps/Settings/src/com/android/settings/display/
DTopLevelWallpaperPreferenceController.java132 final String restriction = DISALLOW_SET_WALLPAPER; in disablePreferenceIfManaged() local
136 restriction, UserHandle.myUserId())) { in disablePreferenceIfManaged()
140 pref.checkRestrictionAndSetDisabled(restriction); in disablePreferenceIfManaged()

1234