Home
last modified time | relevance | path

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

1234567

/packages/apps/Settings/src/com/android/settings/connecteddevice/usb/
DUsbBackend.java67 public UsbBackend(Context context, UserManager userManager) { in UsbBackend() argument
70 mFileTransferRestricted = isUsbFileTransferRestricted(userManager); in UsbBackend()
71 mFileTransferRestrictedBySystem = isUsbFileTransferRestrictedBySystem(userManager); in UsbBackend()
72 mTetheringRestricted = isUsbTetheringRestricted(userManager); in UsbBackend()
73 mTetheringRestrictedBySystem = isUsbTetheringRestrictedBySystem(userManager); in UsbBackend()
74 mIsAdminUser = userManager.isAdminUser(); in UsbBackend()
182 private static boolean isUsbFileTransferRestricted(UserManager userManager) { in isUsbFileTransferRestricted() argument
183 return userManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER); in isUsbFileTransferRestricted()
186 private static boolean isUsbTetheringRestricted(UserManager userManager) { in isUsbTetheringRestricted() argument
187 return userManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING); in isUsbTetheringRestricted()
[all …]
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/
DExternalSourcesDetailsTest.java113 final UserManager userManager = (UserManager) context.getSystemService( in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference() local
115 final ShadowUserManager shadowUserManager = Shadow.extract(userManager); in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference()
120 ReflectionHelpers.setField(fragment, "mUserManager", userManager); in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference()
141 assertThat(userManager.hasUserRestriction( in refreshUi_userRestrictionsUnknownSources_disablesSwitchPreference()
152 final UserManager userManager = (UserManager) context.getSystemService( in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference() local
154 final ShadowUserManager shadowUserManager = Shadow.extract(userManager); in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference()
159 ReflectionHelpers.setField(fragment, "mUserManager", userManager); in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference()
180 assertThat(userManager.hasUserRestriction( in refreshUi_userRestrictionsUnknownSourcesGlobally_disablesSwitchPreference()
191 final UserManager userManager = (UserManager) context.getSystemService( in refreshUi_bothUnknownSourcesUserRestrictions_disableSwitchPreference() local
193 final ShadowUserManager shadowUserManager = Shadow.extract(userManager); in refreshUi_bothUnknownSourcesUserRestrictions_disableSwitchPreference()
[all …]
/packages/apps/Settings/src/com/android/settings/applications/specialaccess/interactacrossprofiles/
DInteractAcrossProfilesSettings.java128 PackageManager packageManager, UserManager userManager, in collectConfigurableApps() argument
130 final UserHandle workProfile = getWorkProfile(userManager); in collectConfigurableApps()
134 final UserHandle personalProfile = userManager.getProfileParent(workProfile); in collectConfigurableApps()
170 Context context, PackageManager packageManager, UserManager userManager, in getNumberOfEnabledApps() argument
172 UserHandle workProfile = getWorkProfile(userManager); in getNumberOfEnabledApps()
176 UserHandle personalProfile = userManager.getProfileParent(workProfile); in getNumberOfEnabledApps()
181 collectConfigurableApps(packageManager, userManager, crossProfileApps); in getNumberOfEnabledApps()
195 static UserHandle getWorkProfile(UserManager userManager) { in getWorkProfile() argument
196 for (UserInfo user : userManager.getProfiles(UserHandle.myUserId())) { in getWorkProfile()
197 if (userManager.isManagedProfile(user.id)) { in getWorkProfile()
/packages/services/Car/user/car-user-lib/src/android/car/userlib/
DUserHelper.java80 UserManager userManager = UserManager.get(context); in grantAdminPermissions() local
82 if (!userManager.isAdminUser()) { in grantAdminPermissions()
87 userManager.setUserAdmin(user.id); in grantAdminPermissions()
92 userManager.setUserRestriction(restriction, /* enable= */ false, userHandle); in grantAdminPermissions()
96 userManager.setUserRestriction(restriction, /* enable= */ false, userHandle); in grantAdminPermissions()
112 UserManager userManager = UserManager.get(context); in setDefaultNonAdminRestrictions() local
114 userManager.setUserRestriction(restriction, enable, user.getUserHandle()); in setDefaultNonAdminRestrictions()
/packages/apps/Car/Settings/src/com/android/car/settings/development/
DDevelopmentSettingsUtil.java60 public static boolean isDevelopmentSettingsEnabled(Context context, UserManager userManager) { in isDevelopmentSettingsEnabled() argument
63 boolean hasRestriction = userManager.hasUserRestriction( in isDevelopmentSettingsEnabled()
65 boolean isAdmin = userManager.isAdminUser(); in isDevelopmentSettingsEnabled()
89 UserManager userManager = UserManager.get(context); in showDeveloperOptions() local
90 boolean showDev = isDevelopmentSettingsEnabled(context, userManager) in showDeveloperOptions()
92 boolean isAdmin = userManager.isAdminUser(); in showDeveloperOptions()
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/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/Car/Settings/src/com/android/car/settings/profiles/
DProfileIconProvider.java50 UserManager userManager = UserManager.get(context); in getRoundedProfileIcon() local
52 Bitmap icon = userManager.getUserIcon(userInfo.id); in getRoundedProfileIcon()
55 icon = assignDefaultIcon(userManager, res, userInfo); in getRoundedProfileIcon()
77 UserManager userManager, Resources resources, UserInfo userInfo) { in assignDefaultIcon() argument
81 userManager.setUserIcon(userInfo.id, bitmap); in assignDefaultIcon()
DProfileUtils.java43 UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE); in getUserInfo() local
44 return userManager.getUserInfo(userId); in getUserInfo()
60 public static boolean isAdminViewingNonAdmin(UserManager userManager, UserInfo userInfo) { in isAdminViewingNonAdmin() argument
61 return userManager.isAdminUser() && !userInfo.isAdmin(); in isAdminViewingNonAdmin()
/packages/apps/Car/SystemUI/src/com/android/systemui/car/userswitcher/
DUserIconProvider.java52 UserManager userManager = UserManager.get(context); in getRoundedUserIcon() local
54 Bitmap icon = userManager.getUserIcon(userInfo.id); in getRoundedUserIcon()
57 icon = assignDefaultIcon(userManager, res, userInfo); in getRoundedUserIcon()
89 UserManager userManager, Resources resources, UserInfo userInfo) { in assignDefaultIcon() argument
93 userManager.setUserIcon(userInfo.id, bitmap); in assignDefaultIcon()
/packages/apps/Settings/tests/robotests/src/com/android/settings/network/telephony/
DMobileNetworkSettingsTest.java118 final UserManager userManager = mock(UserManager.class); in isPageSearchEnabled_adminUser_shouldReturnTrue() local
119 when(mContext.getSystemService(UserManager.class)).thenReturn(userManager); in isPageSearchEnabled_adminUser_shouldReturnTrue()
120 when(userManager.isAdminUser()).thenReturn(true); in isPageSearchEnabled_adminUser_shouldReturnTrue()
133 final UserManager userManager = mock(UserManager.class); in isPageSearchEnabled_nonAdminUser_shouldReturnFalse() local
134 when(mContext.getSystemService(UserManager.class)).thenReturn(userManager); in isPageSearchEnabled_nonAdminUser_shouldReturnFalse()
135 when(userManager.isAdminUser()).thenReturn(false); in isPageSearchEnabled_nonAdminUser_shouldReturnFalse()
/packages/apps/DocumentsUI/src/com/android/documentsui/base/
DUserId.java144 public boolean isManagedProfile(UserManager userManager) { in isManagedProfile() argument
145 return userManager.isManagedProfile(mUserHandle.getIdentifier()); in isManagedProfile()
152 final UserManager userManager = in isQuietModeEnabled() local
154 return userManager.isQuietModeEnabled(mUserHandle); in isQuietModeEnabled()
165 final UserManager userManager = in requestQuietModeDisabled() local
167 return userManager.requestQuietModeEnabled(false, mUserHandle); in requestQuietModeDisabled()
/packages/apps/Settings/tests/robotests/src/com/android/settings/enterprise/
DActionDisabledByAdminDialogHelperTest.java139 final UserManager userManager = RuntimeEnvironment.application.getSystemService( in testSetAdminSupportDetails() local
141 final ShadowUserManager userManagerShadow = Shadow.extract(userManager); in testSetAdminSupportDetails()
160 final UserManager userManager = RuntimeEnvironment.application.getSystemService( in testSetAdminSupportDetails_shortSupportMessageIsNull() local
162 final ShadowUserManager userManagerShadow = Shadow.extract(userManager); in testSetAdminSupportDetails_shortSupportMessageIsNull()
182 final UserManager userManager = RuntimeEnvironment.application.getSystemService( in testSetAdminSupportDetailsNotAdmin() local
184 final ShadowUserManager userManagerShadow = Shadow.extract(userManager); in testSetAdminSupportDetailsNotAdmin()
203 UserManager userManager = RuntimeEnvironment.application in testMaybeSetLearnMoreButton() local
205 ShadowUserManager userManagerShadow = Shadow.extract(userManager); in testMaybeSetLearnMoreButton()
/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/apps/Settings/tests/robotests/src/com/android/settings/accounts/
DAccountDetailDashboardFragmentTest.java182 ShadowUserManager userManager = in onResume_accountMissing_shouldFinish() local
185 userManager.addUserProfile(new UserHandle(1)); in onResume_accountMissing_shouldFinish()
194 ShadowUserManager userManager = in onResume_accountPresentOneProfile_shouldNotFinish() local
197 userManager.addUserProfile(new UserHandle(1)); in onResume_accountPresentOneProfile_shouldNotFinish()
206 ShadowUserManager userManager = in onResume_accountPresentTwoProfiles_shouldNotFinish() local
209 userManager.addUserProfile(new UserHandle(1)); in onResume_accountPresentTwoProfiles_shouldNotFinish()
210 userManager.addUserProfile(new UserHandle(2)); in onResume_accountPresentTwoProfiles_shouldNotFinish()
/packages/apps/DocumentsUI/src/com/android/documentsui/
DUserIdManager.java161 UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); in getUserIdsInternal() local
162 if (userManager == null) { in getUserIdsInternal()
167 final List<UserHandle> userProfiles = userManager.getUserProfiles(); in getUserIdsInternal()
181 && userManager.isManagedProfile(userHandle.getIdentifier())) { in getUserIdsInternal()
191 } else if (mCurrentUser.isManagedProfile(userManager)) { in getUserIdsInternal()
/packages/apps/Bluetooth/src/com/android/bluetooth/opp/
DBluetoothOppFileProvider.java73 UserManager userManager = (UserManager) mContext.getSystemService(Context.USER_SERVICE); in attachInfo() local
74 if (userManager.isUserUnlocked()) { in attachInfo()
111 UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE); in getUriForFile() local
112 if (!userManager.isUserUnlocked()) { in getUriForFile()
/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/apps/Settings/src/com/android/settings/gestures/
DDoubleTwistPreferenceController.java101 public static void setDoubleTwistPreference(Context context, UserManager userManager, in setDoubleTwistPreference() argument
105 final int managedProfileUserId = getManagedProfileId(userManager); in setDoubleTwistPreference()
121 public static int getManagedProfileId(UserManager userManager) { in getManagedProfileId() argument
122 return Utils.getManagedProfileId(userManager, UserHandle.myUserId()); in getManagedProfileId()
/packages/services/Car/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/users/
DUserRestrictionsFragment.java76 UserManager userManager = getUserManager(); in onViewCreated()
81 userManager.setUserRestriction(item.getKey(), item.getIsChecked()); in onViewCreated()
93 UserManager userManager = getUserManager(); in createUserRestrictionItems() local
97 userManager.hasBaseUserRestriction(key, user))) in createUserRestrictionItems()
/packages/apps/Settings/src/com/android/settings/location/
DRecentLocationRequestPreferenceController.java85 final UserManager userManager = UserManager.get(mContext); in displayPreference() local
88 if (isRequestMatchesProfileType(userManager, request, mType)) { in displayPreference()
142 public static boolean isRequestMatchesProfileType(UserManager userManager, in isRequestMatchesProfileType() argument
144 final boolean isWorkProfile = userManager.isManagedProfile( in isRequestMatchesProfileType()
DRecentLocationAccessPreferenceController.java90 final UserManager userManager = UserManager.get(mContext); in displayPreference() local
93 if (isRequestMatchesProfileType(userManager, access, mType)) { in displayPreference()
151 public static boolean isRequestMatchesProfileType(UserManager userManager, in isRequestMatchesProfileType() argument
154 final boolean isWorkProfile = userManager.isManagedProfile( in isRequestMatchesProfileType()
/packages/apps/Bluetooth/src/com/android/bluetooth/util/
DDevicePolicyUtils.java33 final UserManager userManager = in isBluetoothWorkContactSharingDisabled() local
36 final List<UserInfo> userInfoList = userManager.getProfiles(myUserId); in isBluetoothWorkContactSharingDisabled()
40 if (!userManager.isManagedProfile(ui.id)) { in isBluetoothWorkContactSharingDisabled()
/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/Launcher3/tests/src_disabled/
DWorkTabTest.java117 UserManager userManager = getFromLauncher(l -> l.getSystemService(UserManager.class)); in toggleWorks() local
118 assertEquals(2, userManager.getUserProfiles().size()); in toggleWorks()
121 List<UserHandle> userProfiles = userManager.getUserProfiles(); in toggleWorks()
126 l -> userManager.requestQuietModeEnabled(true, workProfile)); in toggleWorks()
128 assertTrue(userManager.isQuietModeEnabled(workProfile)); in toggleWorks()
/packages/apps/Settings/src/com/android/settings/applications/appinfo/
DAppBatteryPreferenceController.java138 final UserManager userManager = in handlePreferenceTreeClick() local
140 final BatteryEntry entry = new BatteryEntry(mContext, /* handler */null, userManager, in handlePreferenceTreeClick()
262 final UserManager userManager = context.getSystemService(UserManager.class);
263 return userManager.isManagedProfile() && !userManager.isSystemUser();

1234567