Home
last modified time | relevance | path

Searched refs:userManager (Results 1 – 25 of 120) sorted by relevance

12345

/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/connecteddevice/usb/
DUsbBackend.java66 public UsbBackend(Context context, UserManager userManager) { in UsbBackend() argument
69 mFileTransferRestricted = isUsbFileTransferRestricted(userManager); in UsbBackend()
70 mFileTransferRestrictedBySystem = isUsbFileTransferRestrictedBySystem(userManager); in UsbBackend()
71 mTetheringRestricted = isUsbTetheringRestricted(userManager); in UsbBackend()
72 mTetheringRestrictedBySystem = isUsbTetheringRestrictedBySystem(userManager); in UsbBackend()
180 private static boolean isUsbFileTransferRestricted(UserManager userManager) { in isUsbFileTransferRestricted() argument
181 return userManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER); in isUsbFileTransferRestricted()
184 private static boolean isUsbTetheringRestricted(UserManager userManager) { in isUsbTetheringRestricted() argument
185 return userManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING); in isUsbTetheringRestricted()
188 private static boolean isUsbFileTransferRestrictedBySystem(UserManager userManager) { in isUsbFileTransferRestrictedBySystem() argument
[all …]
/packages/apps/Settings/src/com/android/settings/connecteddevice/usb/
DUsbBackend.java66 public UsbBackend(Context context, UserManager userManager) { in UsbBackend() argument
69 mFileTransferRestricted = isUsbFileTransferRestricted(userManager); in UsbBackend()
70 mFileTransferRestrictedBySystem = isUsbFileTransferRestrictedBySystem(userManager); in UsbBackend()
71 mTetheringRestricted = isUsbTetheringRestricted(userManager); in UsbBackend()
72 mTetheringRestrictedBySystem = isUsbTetheringRestrictedBySystem(userManager); in UsbBackend()
180 private static boolean isUsbFileTransferRestricted(UserManager userManager) { in isUsbFileTransferRestricted() argument
181 return userManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER); in isUsbFileTransferRestricted()
184 private static boolean isUsbTetheringRestricted(UserManager userManager) { in isUsbTetheringRestricted() argument
185 return userManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING); in isUsbTetheringRestricted()
188 private static boolean isUsbFileTransferRestrictedBySystem(UserManager userManager) { in isUsbFileTransferRestrictedBySystem() argument
[all …]
/packages/services/Car/tests/robotests/src/com/android/car/users/
DCarUserManagerHelperRoboTest.java100 ShadowUserManager userManager = ShadowUserManager.getShadow(); in testGetAllUsers() local
101 userManager.setCurrentUser(currentProcessUserId); in testGetAllUsers()
109 userManager.addUserInfo(systemUser); in testGetAllUsers()
110 userManager.addUserInfo(currentProcessUser); in testGetAllUsers()
111 userManager.addUserInfo(otherUser1); in testGetAllUsers()
112 userManager.addUserInfo(otherUser2); in testGetAllUsers()
127 ShadowUserManager userManager = ShadowUserManager.getShadow(); in testGetAllUsersExceptForegroundUser() local
134 userManager.addUserInfo(foregroundUser); in testGetAllUsersExceptForegroundUser()
135 userManager.addUserInfo(otherUser1); in testGetAllUsersExceptForegroundUser()
136 userManager.addUserInfo(otherUser2); in testGetAllUsersExceptForegroundUser()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/
DExternalSourcesDetailsTest.java160 final UserManager userManager = (UserManager) context.getSystemService( in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference() local
162 final ShadowUserManager shadowUserManager = Shadow.extract(userManager); in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference()
167 ReflectionHelpers.setField(fragment, "mUserManager", userManager); in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference()
188 assertThat(userManager.hasUserRestriction( in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference()
199 final UserManager userManager = (UserManager) context.getSystemService( in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference() local
201 final ShadowUserManager shadowUserManager = Shadow.extract(userManager); in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference()
206 ReflectionHelpers.setField(fragment, "mUserManager", userManager); in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference()
227 assertThat(userManager.hasUserRestriction( in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference()
238 final UserManager userManager = (UserManager) context.getSystemService( in refreshUi_bothUnknownSourcesUserRestrictions_disableSwitchPreference() local
240 final ShadowUserManager shadowUserManager = Shadow.extract(userManager); in refreshUi_bothUnknownSourcesUserRestrictions_disableSwitchPreference()
[all …]
/packages/apps/PermissionController/src/com/android/packageinstaller/role/utils/
DUserUtils.java47 UserManager userManager = context.getSystemService(UserManager.class); in isWorkProfile() local
48 return userManager.isManagedProfile(user.getIdentifier()); in isWorkProfile()
60 UserManager userManager = context.getSystemService(UserManager.class); in getWorkProfile() local
61 List<UserHandle> profiles = userManager.getUserProfiles(); in getWorkProfile()
71 if (!userManager.isManagedProfile(profile.getIdentifier())) { in getWorkProfile()
/packages/apps/Settings/tests/robotests/src/com/android/settings/accounts/
DAccountDetailDashboardFragmentTest.java181 ShadowUserManager userManager = in onResume_accountMissing_shouldFinish() local
184 userManager.addUserProfile(new UserHandle(1)); in onResume_accountMissing_shouldFinish()
193 ShadowUserManager userManager = in onResume_accountPresentOneProfile_shouldNotFinish() local
196 userManager.addUserProfile(new UserHandle(1)); in onResume_accountPresentOneProfile_shouldNotFinish()
205 ShadowUserManager userManager = in onResume_accountPresentTwoProfiles_shouldNotFinish() local
208 userManager.addUserProfile(new UserHandle(1)); in onResume_accountPresentTwoProfiles_shouldNotFinish()
209 userManager.addUserProfile(new UserHandle(2)); in onResume_accountPresentTwoProfiles_shouldNotFinish()
/packages/apps/Launcher3/src/com/android/launcher3/allapps/
DWorkModeSwitch.java60 UserManagerCompat userManager = UserManagerCompat.getInstance(getContext()); in refresh() local
61 setCheckedInternal(!userManager.isAnyProfileQuietModeEnabled()); in refresh()
101 UserManagerCompat userManager = in doInBackground() local
103 List<UserHandle> userProfiles = userManager.getUserProfiles(); in doInBackground()
109 showConfirm |= !userManager.requestQuietModeEnabled(enabled, userProfile); in doInBackground()
/packages/apps/Settings/src/com/android/settings/users/
DUserCapabilities.java47 UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE); in create() local
55 final UserInfo myUserInfo = userManager.getUserInfo(UserHandle.myUserId()); in create()
69 final UserManager userManager = in updateAddUserCapabilities() local
77 mUserSwitcherEnabled = userManager.isUserSwitcherEnabled(); in updateAddUserCapabilities()
89 mDisallowSwitchUser = userManager.hasUserRestriction(UserManager.DISALLOW_USER_SWITCH); in updateAddUserCapabilities()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/users/
DUserCapabilities.java47 UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE); in create() local
55 final UserInfo myUserInfo = userManager.getUserInfo(UserHandle.myUserId()); in create()
69 final UserManager userManager = in updateAddUserCapabilities() local
77 mUserSwitcherEnabled = userManager.isUserSwitcherEnabled(); in updateAddUserCapabilities()
89 mDisallowSwitchUser = userManager.hasUserRestriction(UserManager.DISALLOW_USER_SWITCH); in updateAddUserCapabilities()
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/telephony/
DMobileNetworkSettingsTest.java144 final UserManager userManager = mock(UserManager.class); in isPageSearchEnabled_adminUser_shouldReturnTrue() local
145 when(mContext.getSystemService(UserManager.class)).thenReturn(userManager); in isPageSearchEnabled_adminUser_shouldReturnTrue()
146 when(userManager.isAdminUser()).thenReturn(true); in isPageSearchEnabled_adminUser_shouldReturnTrue()
159 final UserManager userManager = mock(UserManager.class); in isPageSearchEnabled_nonAdminUser_shouldReturnFalse() local
160 when(mContext.getSystemService(UserManager.class)).thenReturn(userManager); in isPageSearchEnabled_nonAdminUser_shouldReturnFalse()
161 when(userManager.isAdminUser()).thenReturn(false); in isPageSearchEnabled_nonAdminUser_shouldReturnFalse()
/packages/apps/Settings/tests/robotests/src/com/android/settings/enterprise/
DActionDisabledByAdminDialogHelperTest.java150 final UserManager userManager = RuntimeEnvironment.application.getSystemService( in testSetAdminSupportDetails() local
152 final ShadowUserManager userManagerShadow = Shadow.extract(userManager); in testSetAdminSupportDetails()
175 final UserManager userManager = RuntimeEnvironment.application.getSystemService( in testSetAdminSupportDetailsNotAdmin() local
177 final ShadowUserManager userManagerShadow = Shadow.extract(userManager); in testSetAdminSupportDetailsNotAdmin()
192 final UserManager userManager = RuntimeEnvironment.application.getSystemService( in testMaybeSetLearnMoreButton() local
194 final ShadowUserManager userManagerShadow = Shadow.extract(userManager); in testMaybeSetLearnMoreButton()
/packages/apps/Bluetooth/src/com/android/bluetooth/opp/
DBluetoothOppFileProvider.java75 UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); in attachInfo() local
76 if (userManager.isUserUnlocked()) { in attachInfo()
113 UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE); in getUriForFile() local
114 if (!userManager.isUserUnlocked()) { in getUriForFile()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/dashboard/profileselector/
DUserAdapter.java191 public static UserAdapter createUserSpinnerAdapter(UserManager userManager, Context context) { in createUserSpinnerAdapter() argument
192 List<UserHandle> userProfiles = userManager.getUserProfiles(); in createUserSpinnerAdapter()
202 return createUserAdapter(userManager, context, userProfiles); in createUserSpinnerAdapter()
206 UserManager userManager, Context context, List<UserHandle> userProfiles) { in createUserAdapter() argument
210 userDetails.add(new UserDetails(userProfiles.get(i), userManager, context)); in createUserAdapter()
/packages/apps/Settings/src/com/android/settings/dashboard/profileselector/
DUserAdapter.java191 public static UserAdapter createUserSpinnerAdapter(UserManager userManager, Context context) { in createUserSpinnerAdapter() argument
192 List<UserHandle> userProfiles = userManager.getUserProfiles(); in createUserSpinnerAdapter()
202 return createUserAdapter(userManager, context, userProfiles); in createUserSpinnerAdapter()
206 UserManager userManager, Context context, List<UserHandle> userProfiles) { in createUserAdapter() argument
210 userDetails.add(new UserDetails(userProfiles.get(i), userManager, context)); in createUserAdapter()
/packages/services/Car/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/users/
DUsersFragment.java73 UserManager userManager = in onViewCreated()
79 userManager.setUserRestriction(item.getKey(), item.getIsChecked()); in onViewCreated()
89 UserManager userManager = (UserManager) getContext().getSystemService(Context.USER_SERVICE); in createUserRestrictionItems() local
92 list.add(new UserRestrictionListItem(key, userManager.hasUserRestriction(key))); in createUserRestrictionItems()
/packages/apps/Settings/src/com/android/settings/gestures/
DDoubleTwistPreferenceController.java96 public static void setDoubleTwistPreference(Context context, UserManager userManager, in setDoubleTwistPreference() argument
100 final int managedProfileUserId = getManagedProfileId(userManager); in setDoubleTwistPreference()
116 public static int getManagedProfileId(UserManager userManager) { in getManagedProfileId() argument
117 return Utils.getManagedProfileId(userManager, UserHandle.myUserId()); in getManagedProfileId()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/gestures/
DDoubleTwistPreferenceController.java96 public static void setDoubleTwistPreference(Context context, UserManager userManager, in setDoubleTwistPreference() argument
100 final int managedProfileUserId = getManagedProfileId(userManager); in setDoubleTwistPreference()
116 public static int getManagedProfileId(UserManager userManager) { in getManagedProfileId() argument
117 return Utils.getManagedProfileId(userManager, UserHandle.myUserId()); in getManagedProfileId()
/packages/apps/Settings/src/com/android/settings/
DUtils.java390 public static UserHandle getManagedProfile(UserManager userManager) { in getManagedProfile() argument
391 List<UserHandle> userProfiles = userManager.getUserProfiles(); in getManagedProfile()
393 if (profile.getIdentifier() == userManager.getUserHandle()) { in getManagedProfile()
396 final UserInfo userInfo = userManager.getUserInfo(profile.getIdentifier()); in getManagedProfile()
408 public static UserHandle getManagedProfileWithDisabled(UserManager userManager) { in getManagedProfileWithDisabled() argument
415 List<UserInfo> profiles = userManager.getProfiles(myUserId); in getManagedProfileWithDisabled()
543 public static UserInfo getExistingUser(UserManager userManager, UserHandle checkUser) { in getExistingUser() argument
544 final List<UserInfo> users = userManager.getUsers(true /* excludeDying */); in getExistingUser()
891 public static boolean isProfileOrDeviceOwner(UserManager userManager, in isProfileOrDeviceOwner() argument
893 List<UserInfo> userInfos = userManager.getUsers(); in isProfileOrDeviceOwner()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/
DUtils.java395 public static UserHandle getManagedProfile(UserManager userManager) { in getManagedProfile() argument
396 List<UserHandle> userProfiles = userManager.getUserProfiles(); in getManagedProfile()
398 if (profile.getIdentifier() == userManager.getUserHandle()) { in getManagedProfile()
401 final UserInfo userInfo = userManager.getUserInfo(profile.getIdentifier()); in getManagedProfile()
413 public static UserHandle getManagedProfileWithDisabled(UserManager userManager) { in getManagedProfileWithDisabled() argument
420 List<UserInfo> profiles = userManager.getProfiles(myUserId); in getManagedProfileWithDisabled()
548 public static UserInfo getExistingUser(UserManager userManager, UserHandle checkUser) { in getExistingUser() argument
549 final List<UserInfo> users = userManager.getUsers(true /* excludeDying */); in getExistingUser()
896 public static boolean isProfileOrDeviceOwner(UserManager userManager, in isProfileOrDeviceOwner() argument
898 List<UserInfo> userInfos = userManager.getUsers(); in isProfileOrDeviceOwner()
/packages/inputmethods/LatinIME/java/src/com/android/inputmethod/compat/
DUserManagerCompatUtils.java69 final UserManager userManager = context.getSystemService(UserManager.class); in getUserLockState() local
70 if (userManager == null) { in getUserLockState()
74 (Boolean) CompatUtils.invoke(userManager, null, METHOD_isUserUnlocked); in getUserLockState()
/packages/apps/Settings/src/com/android/settings/applications/
DApplicationFeatureProviderImpl.java206 UserManager userManager, ListOfAppsCallback callback) { in CurrentUserPolicyInstalledAppLister() argument
207 super(packageManager, userManager); in CurrentUserPolicyInstalledAppLister()
223 DevicePolicyManager devicePolicyManager, UserManager userManager, in CurrentUserAppWithAdminGrantedPermissionsLister() argument
226 userManager); in CurrentUserAppWithAdminGrantedPermissionsLister()
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/applications/
DApplicationFeatureProviderImpl.java206 UserManager userManager, ListOfAppsCallback callback) { in CurrentUserPolicyInstalledAppLister() argument
207 super(packageManager, userManager); in CurrentUserPolicyInstalledAppLister()
223 DevicePolicyManager devicePolicyManager, UserManager userManager, in CurrentUserAppWithAdminGrantedPermissionsLister() argument
226 userManager); in CurrentUserAppWithAdminGrantedPermissionsLister()
/packages/services/Telephony/src/com/android/phone/
DEmergencyInfoGroup.java155 final UserManager userManager = (UserManager) getContext().getSystemService( in getCircularUserIcon() local
157 Bitmap bitmapUserIcon = userManager.getUserIcon(UserHandle.getCallingUserId()); in getCircularUserIcon()
173 final UserManager userManager = (UserManager) getContext().getSystemService( in getUserName() local
175 final String userName = userManager.getUserName(); in getUserName()
/packages/apps/Settings/tests/robotests/src/com/android/settings/notification/
DSoundSettingsTest.java57 UserManager userManager = mock(UserManager.class); in getNonIndexableKeys_existInXmlLayout() local
58 when(userManager.isAdminUser()).thenReturn(false); in getNonIndexableKeys_existInXmlLayout()
59 doReturn(userManager).when(context).getSystemService(Context.USER_SERVICE); in getNonIndexableKeys_existInXmlLayout()
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/
DMobileNetworkPreferenceControllerTest.java94 ShadowUserManager userManager = extract(mContext.getSystemService(UserManager.class)); in secondaryUser_prefIsNotAvailable() local
95 userManager.setIsAdminUser(false); in secondaryUser_prefIsNotAvailable()
106 ShadowUserManager userManager = extract(mContext.getSystemService(UserManager.class)); in wifiOnly_prefIsNotAvailable() local
107 userManager.setIsAdminUser(true); in wifiOnly_prefIsNotAvailable()

12345