Home
last modified time | relevance | path

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

123

/packages/apps/Car/Settings/src/com/android/car/settings/enterprise/
DEnterpriseUtils.java123 public static boolean hasUserRestrictionByDpm(Context context, String restriction) { in hasUserRestrictionByDpm() argument
124 if (hasUserRestrictionByUm(context, restriction)) { in hasUserRestrictionByDpm()
127 return getUserManager(context).hasUserRestriction(restriction); in hasUserRestrictionByDpm()
134 public static boolean hasUserRestrictionByUm(Context context, String restriction) { in hasUserRestrictionByUm() argument
136 .hasBaseUserRestriction(restriction, UserHandle.of(context.getUserId())); in hasUserRestrictionByUm()
184 Context context, String restriction) { in getActionDisabledByAdminDialog() argument
185 return getActionDisabledByAdminDialog(context, restriction, /* restrictedPackage= */ null); in getActionDisabledByAdminDialog()
193 Context context, String restriction) { in getInputMethodDisabledByAdminDialog() argument
194 return getActionDisabledByAdminDialog(context, restriction, /* restrictedPackage= */ null); in getInputMethodDisabledByAdminDialog()
202 Context context, String restriction, @Nullable String restrictedPackage) { in getActionDisabledByAdminDialog() argument
[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()
216 String restriction) { in setAdminSupportTitle() argument
217 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/Settings/src/com/android/settings/enterprise/
DActionDisabledByAdminDialogHelper.java64 public ActionDisabledByAdminDialogHelper(Activity activity, String restriction) { in ActionDisabledByAdminDialogHelper() argument
69 .createInstance(mActivity, restriction, in ActionDisabledByAdminDialogHelper()
89 public AlertDialog.Builder prepareDialogBuilder(String restriction, in prepareDialogBuilder() argument
96 prepareDialogBuilder(builder, restriction, enforcedAdmin); in prepareDialogBuilder()
101 void prepareDialogBuilder(AlertDialog.Builder builder, String restriction, in prepareDialogBuilder() argument
107 mRestriction = restriction; in prepareDialogBuilder()
113 public void updateDialog(String restriction, EnforcedAdmin admin) { in updateDialog() argument
114 if (mEnforcedAdmin.equals(admin) && Objects.equals(mRestriction, restriction)) { in updateDialog()
118 mRestriction = restriction; in updateDialog()
124 String restriction) { in initializeDialogViews() argument
[all …]
DActionDisabledByAdminDialog.java39 final String restriction = getRestrictionFromIntent(getIntent()); in onCreate() local
40 mDialogHelper = new ActionDisabledByAdminDialogHelper(this, restriction); in onCreate()
41 mDialogHelper.prepareDialogBuilder(restriction, enforcedAdmin) in onCreate()
50 final String restriction = getRestrictionFromIntent(intent); in onNewIntent() local
51 mDialogHelper.updateDialog(restriction, admin); in onNewIntent()
/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/apps/Car/Settings/tests/unit/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/services/Car/car-helper-lib/src/com/android/car/internal/user/
DUserHelper.java85 for (String restriction : DEFAULT_NON_ADMIN_RESTRICTIONS) { in grantAdminPermissions()
86 userManager.setUserRestriction(restriction, /* enable= */ false, user); in grantAdminPermissions()
88 for (String restriction : OPTIONAL_NON_ADMIN_RESTRICTIONS) { in grantAdminPermissions()
89 userManager.setUserRestriction(restriction, /* enable= */ false, user); in grantAdminPermissions()
106 for (String restriction : DEFAULT_NON_ADMIN_RESTRICTIONS) { in setDefaultNonAdminRestrictions()
107 userManager.setUserRestriction(restriction, enable, user); in setDefaultNonAdminRestrictions()
/packages/apps/Car/Settings/src/com/android/car/settings/qc/
DQCUtils.java36 public static PendingIntent getActionDisabledDialogIntent(Context context, String restriction) { in getActionDisabledDialogIntent() argument
37 return getActionDisabledDialogIntent(context, restriction, /* requestCode= */ 0); in getActionDisabledDialogIntent()
44 public static PendingIntent getActionDisabledDialogIntent(Context context, String restriction, in getActionDisabledDialogIntent() argument
48 intent.putExtra(DevicePolicyManager.EXTRA_RESTRICTION, restriction); in getActionDisabledDialogIntent()
/packages/apps/Car/Settings/tests/unit/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/Settings/tests/robotests/src/com/android/settings/testutils/shadow/
DShadowUserManager.java96 public void addBaseUserRestriction(String restriction) { in addBaseUserRestriction() argument
97 mBaseRestrictions.add(restriction); in addBaseUserRestriction()
103 mGuestRestrictions.forEach(restriction -> bundle.putBoolean(restriction, true)); in getDefaultGuestRestrictions()
107 public void addGuestUserRestriction(String restriction) { in addGuestUserRestriction() argument
108 mGuestRestrictions.add(restriction); in addGuestUserRestriction()
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/internal/user/
DUserHelperTest.java154 for (String restriction : UserHelper.DEFAULT_NON_ADMIN_RESTRICTIONS) { in testGrantingAdminPermissionsRemovesNonAdminRestrictions()
155 verify(mUserManager).setUserRestriction(restriction, restrictionEnabled, in testGrantingAdminPermissionsRemovesNonAdminRestrictions()
158 for (String restriction : UserHelper.DEFAULT_NON_ADMIN_RESTRICTIONS) { in testGrantingAdminPermissionsRemovesNonAdminRestrictions()
159 verify(mUserManager).setUserRestriction(restriction, restrictionEnabled, in testGrantingAdminPermissionsRemovesNonAdminRestrictions()
/packages/apps/Settings/tests/robotests/src/com/android/settings/enterprise/
DActionDisabledByAdminDialogTest.java65 final String restriction = "someRestriction"; in testGetRestrictionFromIntent() local
68 intent.putExtra(DevicePolicyManager.EXTRA_RESTRICTION, restriction); in testGetRestrictionFromIntent()
69 assertEquals(restriction, mDialog.getRestrictionFromIntent(intent)); in testGetRestrictionFromIntent()
/packages/services/Car/car-lib/src/android/car/drivingstate/
DCarUxRestrictionsConfiguration.java154 RestrictionsPerSpeedRange restriction = null; in getUxRestrictions() local
156 restriction = findUxRestrictionsInList(currentSpeed, in getUxRestrictions()
160 if (restriction == null) { in getUxRestrictions()
169 restriction = findUxRestrictionsInList( in getUxRestrictions()
175 if (restriction == null) { in getUxRestrictions()
182 return createUxRestrictionsEvent(restriction.mReqOpt, restriction.mRestrictions); in getUxRestrictions()
911 restriction -> restriction.mSpeedRange == null)) { in validateBaselineModeRestrictions()
913 for (RestrictionsPerSpeedRange restriction : restrictions) { in validateBaselineModeRestrictions()
914 error.append(restriction.toString()).append('\n'); in validateBaselineModeRestrictions()
/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/apps/Car/Settings/src/com/android/car/settings/applications/
DApplicationActionButtonsPreferenceController.java459 private Boolean shouldDisableButtonBecauseOfUserRestriction(String button, String restriction) { in shouldDisableButtonBecauseOfUserRestriction() argument
460 if (!mUserManager.hasUserRestriction(restriction)) return null; in shouldDisableButtonBecauseOfUserRestriction()
464 if (mUserManager.hasBaseUserRestriction(restriction, user)) { in shouldDisableButtonBecauseOfUserRestriction()
465 LOG.d(button + " disabled because " + user + " has " + restriction + " restriction"); in shouldDisableButtonBecauseOfUserRestriction()
469 LOG.d(button + " NOT disabled because " + user + " has " + restriction + " restriction but " in shouldDisableButtonBecauseOfUserRestriction()
471 mRestriction = restriction; in shouldDisableButtonBecauseOfUserRestriction()
/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/Car/Settings/src/com/android/car/settings/wifi/
DWifiUtil.java432 public static void runClickableWhileDisabled(Context context, String restriction, in runClickableWhileDisabled() argument
434 if (hasUserRestrictionByDpm(context, restriction)) { in runClickableWhileDisabled()
435 showActionDisabledByAdminDialog(context, restriction, fragmentController); in runClickableWhileDisabled()
458 public static void showActionDisabledByAdminDialog(Context context, String restriction, in showActionDisabledByAdminDialog() argument
461 EnterpriseUtils.getActionDisabledByAdminDialog(context, restriction), in showActionDisabledByAdminDialog()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/applications/
DApplicationActionButtonsPreferenceControllerTest.java724 private void testShowingDisabledByDeviceAdminDialogWhenUninstallClicked(String restriction) { in testShowingDisabledByDeviceAdminDialogWhenUninstallClicked() argument
725 mockDisabledByDevicePolicyManagerRestriction(restriction); in testShowingDisabledByDeviceAdminDialogWhenUninstallClicked()
820 private void mockDisabledByUserManagerRestriction(String restriction) { in mockDisabledByUserManagerRestriction() argument
821 when(mMockUserManager.hasUserRestriction(restriction)).thenReturn(true); in mockDisabledByUserManagerRestriction()
822 when(mMockUserManager.hasBaseUserRestriction(eq(restriction), any())).thenReturn(true); in mockDisabledByUserManagerRestriction()
825 private void mockDisabledByDevicePolicyManagerRestriction(String restriction) { in mockDisabledByDevicePolicyManagerRestriction() argument
826 when(mMockUserManager.hasUserRestriction(restriction)).thenReturn(true); in mockDisabledByDevicePolicyManagerRestriction()
827 when(mMockUserManager.hasBaseUserRestriction(eq(restriction), any())).thenReturn(false); in mockDisabledByDevicePolicyManagerRestriction()
/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()
DWallpaperPreferenceController.java137 final String restriction = DISALLOW_SET_WALLPAPER; in disablePreferenceIfManaged() local
141 restriction, UserHandle.myUserId())) { in disablePreferenceIfManaged()
144 pref.checkRestrictionAndSetDisabled(restriction); in disablePreferenceIfManaged()
/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/Car/Settings/tests/unit/src/com/android/car/settings/system/
DFactoryResetEntryPreferenceControllerTest.java288 private void addBaseUserRestriction(String restriction) { in addBaseUserRestriction() argument
290 eq(restriction), any())).thenReturn(true); in addBaseUserRestriction()
293 private void addUserRestriction(String restriction) { in addUserRestriction() argument
294 when(mMockUserManager.hasUserRestriction(restriction)).thenReturn(true); in addUserRestriction()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/profiles/
DPermissionsPreferenceControllerTest.java160 PreferenceGroup preferenceGroup, String restriction) { in getPreferenceForRestriction() argument
163 if (restriction.equals(preference.getExtras().getString( in getPreferenceForRestriction()

123