/packages/services/Car/car-builtin-lib/src/android/car/builtin/os/ |
D | UserManagerHelper.java | 88 public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, in getUserHandles() argument 90 return userManager.getUserHandles(excludeDying); in getUserHandles() 101 public static List<UserHandle> getUserHandles(@NonNull UserManager userManager, in getUserHandles() argument 103 List<UserInfo> users = userManager.getUsers(excludePartial, excludeDying, in getUserHandles() 117 public static boolean isEphemeralUser(@NonNull UserManager userManager, in isEphemeralUser() argument 119 return userManager.isUserEphemeral(user.getIdentifier()); in isEphemeralUser() 125 public static boolean isGuestUser(@NonNull UserManager userManager, @NonNull UserHandle user) { in isGuestUser() argument 126 return userManager.isGuestUser(user.getIdentifier()); in isGuestUser() 132 public static boolean isFullUser(@NonNull UserManager userManager, @NonNull UserHandle user) { in isFullUser() argument 133 UserInfo info = userManager.getUserInfo(user.getIdentifier()); in isFullUser() [all …]
|
/packages/services/Car/car-helper-lib/src/com/android/car/internal/user/ |
D | UserHelper.java | 79 UserManager userManager = context.getSystemService(UserManager.class); in grantAdminPermissions() local 80 if (!userManager.isAdminUser()) { in grantAdminPermissions() 84 userManager.setUserAdmin(user.getIdentifier()); in grantAdminPermissions() 87 userManager.setUserRestriction(restriction, /* enable= */ false, user); in grantAdminPermissions() 90 userManager.setUserRestriction(restriction, /* enable= */ false, user); in grantAdminPermissions() 106 UserManager userManager = context.getSystemService(UserManager.class); in setDefaultNonAdminRestrictions() local 108 userManager.setUserRestriction(restriction, enable, user); in setDefaultNonAdminRestrictions() 124 UserManager userManager = context.getSystemService(UserManager.class); in assignDefaultIcon() local 125 UserInfo userInfo = userManager.getUserInfo(user.getIdentifier()); in assignDefaultIcon() 130 userManager.setUserIcon(user.getIdentifier(), bitmap); in assignDefaultIcon() [all …]
|
/packages/apps/Settings/src/com/android/settings/connecteddevice/usb/ |
D | UsbBackend.java | 71 public UsbBackend(Context context, UserManager userManager) { in UsbBackend() argument 74 mFileTransferRestricted = isUsbFileTransferRestricted(userManager); in UsbBackend() 75 mFileTransferRestrictedBySystem = isUsbFileTransferRestrictedBySystem(userManager); in UsbBackend() 76 mTetheringRestricted = isUsbTetheringRestricted(userManager); in UsbBackend() 77 mTetheringRestrictedBySystem = isUsbTetheringRestrictedBySystem(userManager); in UsbBackend() 79 mIsAdminUser = userManager.isAdminUser(); in UsbBackend() 186 private static boolean isUsbFileTransferRestricted(UserManager userManager) { in isUsbFileTransferRestricted() argument 187 return userManager.hasUserRestriction(UserManager.DISALLOW_USB_FILE_TRANSFER); in isUsbFileTransferRestricted() 190 private static boolean isUsbTetheringRestricted(UserManager userManager) { in isUsbTetheringRestricted() argument 191 return userManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING); in isUsbTetheringRestricted() [all …]
|
/packages/modules/Permission/service/java/com/android/permission/util/ |
D | UserUtils.java | 57 UserManager userManager = context.getSystemService(UserManager.class); in enforceCrossUserPermission() local 58 if (userManager.hasUserRestrictionForUser( in enforceCrossUserPermission() 72 UserManager userManager = context.getSystemService(UserManager.class); in getUserHandles() local 76 return userManager.getUserHandles(true); in getUserHandles() 84 UserManager userManager = context.getSystemService(UserManager.class); in isManagedProfile() local 88 return userManager.isManagedProfile(userId); in isManagedProfile() 99 UserManager userManager = context.getSystemService(UserManager.class); in isProfileRunning() local 103 return userManager.isUserRunning(UserHandle.of(userId)) in isProfileRunning() 104 && !userManager.isQuietModeEnabled(UserHandle.of(userId)); in isProfileRunning()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/applications/appinfo/ |
D | ExternalSourcesDetailsTest.java | 113 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/providers/ContactsProvider/src/com/android/providers/contacts/util/ |
D | UserUtils.java | 88 final UserManager userManager = getUserManager(context); in shouldUseParentsContacts() local 89 final UserProperties userProperties = userManager.getUserProperties(context.getUser()); in shouldUseParentsContacts() 101 final UserManager userManager = getUserManager(context); in shouldUseParentsContacts() local 102 final UserProperties userProperties = userManager.getUserProperties(userHandle); in shouldUseParentsContacts() 118 final UserManager userManager = getUserManager(context); in isParentUser() 119 UserInfo parentUserInfo = userManager.getProfileParent(user2.getIdentifier()); in isParentUser() 127 final UserManager userManager = getUserManager(context); in getProfileParentUser() local 128 return userManager.getProfileParent(context.getUserId()); in getProfileParentUser()
|
/packages/modules/Bluetooth/android/app/tests/unit/src/com/android/bluetooth/pbap/ |
D | BluetoothPbapObexServerTest.java | 384 UserManager userManager = mock(UserManager.class); in testOnGet_whenUserIsNotUnlocked() local 385 doReturn(userManager).when(mPbapMethodProxy).getSystemService(any(), eq(UserManager.class)); in testOnGet_whenUserIsNotUnlocked() 387 when(userManager.isUserUnlocked()).thenReturn(false); in testOnGet_whenUserIsNotUnlocked() 398 UserManager userManager = mock(UserManager.class); in testOnGet_whenNameIsNotSet_andCurrentPathIsTelecom_andTypeIsListing() local 399 doReturn(userManager).when(mPbapMethodProxy).getSystemService(any(), eq(UserManager.class)); in testOnGet_whenNameIsNotSet_andCurrentPathIsTelecom_andTypeIsListing() 400 when(userManager.isUserUnlocked()).thenReturn(true); in testOnGet_whenNameIsNotSet_andCurrentPathIsTelecom_andTypeIsListing() 414 UserManager userManager = mock(UserManager.class); in testOnGet_whenNameIsNotSet_andCurrentPathIsInvalid() local 415 doReturn(userManager).when(mPbapMethodProxy).getSystemService(any(), eq(UserManager.class)); in testOnGet_whenNameIsNotSet_andCurrentPathIsInvalid() 416 when(userManager.isUserUnlocked()).thenReturn(true); in testOnGet_whenNameIsNotSet_andCurrentPathIsInvalid() 429 UserManager userManager = mock(UserManager.class); in testOnGet_whenAppParamIsInvalid() local [all …]
|
/packages/apps/Settings/src/com/android/settings/users/ |
D | UserCapabilities.java | 49 UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE); in create() local 57 final UserInfo myUserInfo = userManager.getUserInfo(UserHandle.myUserId()); in create() 67 offerRestricted && !dpm.isDeviceManaged() && userManager.isUserTypeEnabled( in create() 75 final UserManager userManager = in updateAddUserCapabilities() local 83 mUserSwitcherEnabled = userManager.isUserSwitcherEnabled(); in updateAddUserCapabilities() 89 || (!userManager.isUserTypeEnabled(UserManager.USER_TYPE_FULL_SECONDARY) in updateAddUserCapabilities() 97 && userManager.isUserTypeEnabled(UserManager.USER_TYPE_FULL_GUEST); in updateAddUserCapabilities() 99 mDisallowSwitchUser = userManager.hasUserRestriction(UserManager.DISALLOW_USER_SWITCH); in updateAddUserCapabilities()
|
/packages/apps/Settings/src/com/android/settings/applications/specialaccess/interactacrossprofiles/ |
D | InteractAcrossProfilesSettings.java | 133 PackageManager packageManager, UserManager userManager, in collectConfigurableApps() argument 135 final UserHandle workProfile = getWorkProfile(userManager); in collectConfigurableApps() 139 final UserHandle personalProfile = userManager.getProfileParent(workProfile); in collectConfigurableApps() 175 Context context, PackageManager packageManager, UserManager userManager, in getNumberOfEnabledApps() argument 177 UserHandle workProfile = getWorkProfile(userManager); in getNumberOfEnabledApps() 181 UserHandle personalProfile = userManager.getProfileParent(workProfile); in getNumberOfEnabledApps() 186 collectConfigurableApps(packageManager, userManager, crossProfileApps); in getNumberOfEnabledApps() 200 static UserHandle getWorkProfile(UserManager userManager) { in getWorkProfile() argument 201 for (UserInfo user : userManager.getProfiles(UserHandle.myUserId())) { in getWorkProfile() 202 if (userManager.isManagedProfile(user.id)) { in getWorkProfile()
|
/packages/apps/Settings/src/com/android/settings/spa/app/appinfo/ |
D | AppInfoSettingsMoreOptions.kt | 39 import com.android.settingslib.spaprivileged.framework.common.userManager 135 userManager = context.userManager, in getMoreOptionsState() 143 Utils.isProfileOrDeviceOwner(context.userManager, context.devicePolicyManager, packageName) in getMoreOptionsState() 156 isUpdatedSystemApp && context.userManager.isUserAdmin(userId) && in ApplicationInfo() 160 userManager: UserManager, in ApplicationInfo() 163 isOtherUserHasInstallPackage(userManager, packageManagers) in ApplicationInfo() 166 userManager: UserManager, in ApplicationInfo() 168 ): Boolean = userManager.aliveUsers in ApplicationInfo()
|
/packages/modules/IntentResolver/java/src/com/android/intentresolver/ |
D | AnnotatedUserHandles.java | 95 UserManager userManager = shareActivity.getSystemService(UserManager.class); in forShareActivity() local 102 getWorkProfileForUser(userManager, personalProfileUserHandle)) in forShareActivity() 104 getCloneProfileForUser(userManager, personalProfileUserHandle)) in forShareActivity() 155 UserManager userManager, UserHandle profileOwnerUserHandle) { in getWorkProfileForUser() argument 156 return userManager.getProfiles(profileOwnerUserHandle.getIdentifier()) in getWorkProfileForUser() 166 UserManager userManager, UserHandle profileOwnerUserHandle) { in getCloneProfileForUser() argument 167 return userManager.getProfiles(profileOwnerUserHandle.getIdentifier()) in getCloneProfileForUser()
|
/packages/modules/Permission/service/java/com/android/safetycenter/ |
D | UserProfileGroup.java | 112 UserManager userManager = getUserManagerForUser(userId, context); in fromUser() local 113 List<UserHandle> userProfiles = getEnabledUserProfiles(userManager); in fromUser() 114 UserHandle profileParent = getProfileParent(userManager, userId); in fromUser() 181 UserManager userManager = getUserManagerForUser(userId, context); in isProfile() local 182 return userManager.isProfile(); in isProfile() 188 private static List<UserHandle> getEnabledUserProfiles(UserManager userManager) { in getEnabledUserProfiles() argument 192 return userManager.getUserProfiles(); in getEnabledUserProfiles() 199 private static UserHandle getProfileParent(UserManager userManager, @UserIdInt int userId) { in getProfileParent() argument 203 return userManager.getProfileParent(UserHandle.of(userId)); in getProfileParent()
|
/packages/apps/Launcher3/tests/src/com/android/launcher3/util/ |
D | LockedUserStateTest.kt | 40 @Mock lateinit var userManager: UserManager variable in com.android.launcher3.util.LockedUserStateTest 46 `when`(context.getSystemService(UserManager::class.java)).thenReturn(userManager) in setup() 51 `when`(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(true) in runOnUserUnlocked_runs_action_immediately_if_already_unlocked() 59 `when`(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(false) in runOnUserUnlocked_waits_to_run_action_until_user_is_unlocked() 70 `when`(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(true) in isUserUnlocked_returns_true_when_user_is_unlocked() 76 `when`(userManager.isUserUnlocked(Process.myUserHandle())).thenReturn(false) in isUserUnlocked_returns_false_when_user_is_locked()
|
/packages/apps/Car/Settings/src/com/android/car/settings/development/ |
D | DevelopmentSettingsUtil.java | 60 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/apps/Settings/src/com/android/settings/biometrics/combination/ |
D | CombinedBiometricStatusUtils.java | 94 UserManager userManager = mContext.getSystemService(UserManager.class); in getTitle() local 95 if (userManager != null && userManager.isProfile()) { in getTitle() 140 UserManager userManager = mContext.getSystemService(UserManager.class); in getSettingsClassNameBasedOnUser() local 141 if (userManager != null && userManager.isProfile()) { in getSettingsClassNameBasedOnUser()
|
/packages/apps/Settings/tests/spa_unit/src/com/android/settings/spa/app/appinfo/ |
D | AppInfoSettingsMoreOptionsTest.kt | 44 import com.android.settingslib.spaprivileged.framework.common.userManager 76 private lateinit var userManager: UserManager variable in com.android.settings.spa.app.appinfo.AppInfoSettingsMoreOptionsTest 102 whenever(context.userManager).thenReturn(userManager) in setUp() 107 whenever(Utils.isProfileOrDeviceOwner(userManager, devicePolicyManager, PACKAGE_NAME)) in setUp() 118 whenever(Utils.isProfileOrDeviceOwner(userManager, devicePolicyManager, PACKAGE_NAME)) in whenProfileOrDeviceOwner_notDisplayed() 133 whenever(userManager.isUserAdmin(app.userId)).thenReturn(true) in uninstallUpdates_updatedSystemAppAndUserAdmin_displayed() 148 whenever(userManager.aliveUsers).thenReturn(listOf(OTHER_USER)) in uninstallForAllUsers_regularAppAndPrimaryUser_displayed()
|
D | AppDisableButtonTest.kt | 32 import com.android.settingslib.spaprivileged.framework.common.userManager 63 private lateinit var userManager: UserManager variable in com.android.settings.spa.app.appinfo.AppDisableButtonTest 83 whenever(context.userManager).thenReturn(userManager) in setUp() 89 whenever(Utils.isProfileOrDeviceOwner(userManager, devicePolicyManager, PACKAGE_NAME)) in setUp() 145 whenever(Utils.isProfileOrDeviceOwner(userManager, devicePolicyManager, PACKAGE_NAME)) in getActionButton_isProfileOrDeviceOwner_cannotDisable()
|
/packages/apps/Settings/src/com/android/settings/ |
D | RingtonePreference.java | 278 final UserManager userManager = mUserContext.getSystemService(UserManager.class); in isValidRingtoneUri() local 280 if (!userManager.isSameProfileGroup(mUserId, userIdFromUri)) { in isValidRingtoneUri() 289 if (userManager.isProfile()) { in isValidRingtoneUri() 297 final UserHandle parent = userManager.getProfileParent(UserHandle.of(profileUserId)); in isValidRingtoneUri() 306 if (userManager.hasUserRestrictionForUser( in isValidRingtoneUri() 314 if (!(userManager.isManagedProfile(profileUserId) || userManager.getUserProperties( in isValidRingtoneUri()
|
/packages/services/Telecomm/src/com/android/server/telecom/ |
D | UserUtil.java | 36 UserManager userManager = (UserManager) context.getSystemService(Context.USER_SERVICE); in getUserInfoFromUserHandle() local 37 return userManager.getUserInfo(userHandle.getIdentifier()); in getUserInfoFromUserHandle() 75 final UserManager userManager = in hasOutgoingCallsUserRestriction() local 77 if (userManager.hasBaseUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, in hasOutgoingCallsUserRestriction() 83 } else if (userManager.hasUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS, in hasOutgoingCallsUserRestriction()
|
/packages/modules/Permission/PermissionController/src/com/android/permissioncontroller/safetycenter/service/ |
D | SafetyCenterSearchIndexablesProvider.kt | 110 val userManager = context.getSystemService(UserManager::class.java) ?: return cursor in <lambda>() constant 123 keepActiveEntriesFromRemoval(safetyCenterManager, userManager, keysToRemove) in <lambda>() 180 context.getSystemService(UserManager::class.java)?.let { userManager -> in <lambda>() method 185 val isWorkProfile = userManager.isManagedProfile(it.key.userId) in <lambda>() 256 userManager: UserManager, in <lambda>() 266 keepEntryFromRemoval(it.entryId, userManager, keysToRemove) in <lambda>() 278 keepEntryFromRemoval(entryId, userManager, keysToRemove) in <lambda>() 285 userManager: UserManager, in <lambda>() 288 val isWorkProfile = userManager.isManagedProfile(entryId.userId) in <lambda>()
|
/packages/apps/DocumentsUI/src/com/android/documentsui/base/ |
D | UserId.java | 144 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/providers/MediaProvider/src/com/android/providers/media/photopicker/data/ |
D | UserIdManager.java | 301 UserManager userManager = mContext.getSystemService(UserManager.class); in setUserIdsInternal() local 302 if (userManager == null) { in setUserIdsInternal() 307 final List<UserHandle> userProfiles = userManager.getUserProfiles(); in setUserIdsInternal() 313 if (mCurrentUser.isManagedProfile(userManager)) { in setUserIdsInternal() 316 userManager.getProfileParent(managedUser.getUserHandle()); in setUserIdsInternal() 326 if (userManager.isManagedProfile(userHandle.getIdentifier())) { in setUserIdsInternal() 328 userManager.getProfileParent(userHandle); in setUserIdsInternal()
|
/packages/apps/Car/Settings/src/com/android/car/settings/profiles/ |
D | ProfileUtils.java | 43 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/Settings/tests/robotests/src/com/android/settings/network/telephony/ |
D | MobileNetworkSettingsTest.java | 126 final UserManager userManager = mock(UserManager.class); in isPageSearchEnabled_adminUser_shouldReturnTrue() local 127 when(mContext.getSystemService(UserManager.class)).thenReturn(userManager); in isPageSearchEnabled_adminUser_shouldReturnTrue() 128 when(userManager.isAdminUser()).thenReturn(true); in isPageSearchEnabled_adminUser_shouldReturnTrue() 141 final UserManager userManager = mock(UserManager.class); in isPageSearchEnabled_nonAdminUser_shouldReturnFalse() local 142 when(mContext.getSystemService(UserManager.class)).thenReturn(userManager); in isPageSearchEnabled_nonAdminUser_shouldReturnFalse() 143 when(userManager.isAdminUser()).thenReturn(false); in isPageSearchEnabled_nonAdminUser_shouldReturnFalse()
|
/packages/apps/Settings/tests/robotests/src/com/android/settings/accounts/ |
D | AccountDetailDashboardFragmentTest.java | 181 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()
|