Home
last modified time | relevance | path

Searched refs:um (Results 1 – 25 of 158) sorted by relevance

1234567

/aosp12/packages/services/Car/car-test-lib/src/android/car/test/mocks/
H A DAndroidMockitoHelper.java95 Objects.requireNonNull(um); in mockUmGetUserInfo()
97 mockUmGetUserInfo(um, user); in mockUmGetUserInfo()
106 when(um.getUserInfo(user.id)).thenReturn(user); in mockUmGetUserInfo()
113 public static void mockUmGetSystemUser(@NonNull UserManager um) { in mockUmGetSystemUser() argument
123 Objects.requireNonNull(um); in mockUmGetAliveUsers()
130 public static void mockUmGetAliveUsers(@NonNull UserManager um, in mockUmGetAliveUsers() argument
133 when(um.getAliveUsers()).thenReturn(users); in mockUmGetAliveUsers()
143 when(um.getUserHandles(excludeDying)).thenReturn(result); in mockUmGetUserHandles()
152 Objects.requireNonNull(um); in mockUmGetUsers()
168 when(um.isUserRunning(userId)).thenReturn(isRunning); in mockUmIsUserRunning()
[all …]
/aosp12/packages/providers/ContactsProvider/tests/src/com/android/providers/contacts/util/
H A DUserUtilsTest.java45 final MockUserManager um = mActor.mockUserManager; in testGetCorpUser() local
51 um.setUsers(MockUserManager.PRIMARY_USER, MockUserManager.CORP_USER); in testGetCorpUser()
53 um.myUser = MockUserManager.PRIMARY_USER.id; in testGetCorpUser()
56 um.myUser = MockUserManager.CORP_USER.id; in testGetCorpUser()
60 um.setUsers(MockUserManager.PRIMARY_USER, MockUserManager.SECONDARY_USER, in testGetCorpUser()
63 um.myUser = MockUserManager.PRIMARY_USER.id; in testGetCorpUser()
66 um.myUser = MockUserManager.CORP_USER.id; in testGetCorpUser()
69 um.myUser = MockUserManager.SECONDARY_USER.id; in testGetCorpUser()
73 um.setUsers(MockUserManager.PRIMARY_USER, MockUserManager.SECONDARY_USER); in testGetCorpUser()
75 um.myUser = MockUserManager.PRIMARY_USER.id; in testGetCorpUser()
[all …]
/aosp12/packages/apps/Settings/src/com/android/settings/users/
H A DProfileUpdateReceiver.java54 final UserManager um = context.getSystemService(UserManager.class); in copyProfileName() local
56 if (newName != null && newName.length() > 0 && !isCurrentNameInteresting(context, um)) { in copyProfileName()
57 um.setUserName(userId, newName); in copyProfileName()
65 private static boolean isCurrentNameInteresting(Context context, UserManager um) { in isCurrentNameInteresting() argument
66 if (!um.isUserNameSet()) { in isCurrentNameInteresting()
69 final String currentName = um.getUserName(); in isCurrentNameInteresting()
70 final String defaultName = um.isRestrictedProfile() || um.isProfile() ? in isCurrentNameInteresting()
H A DRestrictionUtils.java61 UserManager um = UserManager.get(context); in getRestrictions() local
62 Bundle userRestrictions = um.getUserRestrictions(user); in getRestrictions()
79 UserManager um = UserManager.get(context); in setRestrictions() local
81 um.setUserRestriction(entry.getKey(), !entry.getSelectedState(), user); in setRestrictions()
/aosp12/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/testutils/
H A 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()
/aosp12/frameworks/base/packages/SettingsLib/src/com/android/settingslib/net/
H A DUidDetailProvider.java136 final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE); in buildUidDetail() local
141 final UserInfo info = um.getUserInfo(userHandle); in buildUidDetail()
144 detail.icon = Utils.getUserIcon(mContext, um, info); in buildUidDetail()
161 detail.icon = um.getBadgedIconForUser(info.loadIcon(pm), in buildUidDetail()
175 detail.detailContentDescriptions[i] = um.getBadgedLabelForUser( in buildUidDetail()
180 detail.icon = um.getBadgedIconForUser(appInfo.loadIcon(pm), userHandle); in buildUidDetail()
185 detail.contentDescription = um.getBadgedLabelForUser(detail.label, userHandle); in buildUidDetail()
/aosp12/packages/providers/ContactsProvider/src/com/android/providers/contacts/util/
H A DUserUtils.java54 final UserManager um = getUserManager(context); in getCorpUserInfo() local
55 final int myUser = um.getUserHandle(); in getCorpUserInfo()
58 for (UserInfo ui : um.getUsers()) { in getCorpUserInfo()
62 final UserInfo parent = um.getProfileParent(ui.id); in getCorpUserInfo()
/aosp12/packages/apps/Settings/src/com/android/settings/notification/
H A DAudioHelper.java47 public int getManagedProfileId(UserManager um) { in getManagedProfileId() argument
48 return Utils.getManagedProfileId(um, UserHandle.myUserId()); in getManagedProfileId()
51 public boolean isUserUnlocked(UserManager um, @UserIdInt int userId) { in isUserUnlocked() argument
52 return um.isUserUnlocked(userId); in isUserUnlocked()
/aosp12/packages/apps/TvSettings/Settings/src/com/android/tv/settings/users/
H A DRestrictionUtils.java52 UserManager um = UserManager.get(context); in getRestrictions() local
53 Bundle userRestrictions = um.getUserRestrictions(user); in getRestrictions()
70 UserManager um = UserManager.get(context); in setRestrictions() local
73 um.setUserRestriction(entry.getKey(), !entry.getSelectedState(), user); in setRestrictions()
/aosp12/packages/apps/DocumentsUI/tests/common/com/android/documentsui/testing/
H A DUserManagers.java32 final UserManager um = Mockito.mock(UserManager.class); in create() local
33 when(um.isQuietModeEnabled(any())).thenReturn(false); in create()
34 return um; in create()
/aosp12/packages/services/Car/tests/CarSecurityPermissionTest/src/com/android/car/user/
H A DCarUserManagerPermissionTest.java99 (um) -> um.createUser("Thanos", UserInfo.FLAG_ADMIN))); in testCannotCreateAdminUserWithoutManageUsersPermission()
108 (um) -> um.createUser("Thanos", UserManager.USER_TYPE_FULL_SECONDARY, in testCannotCreateAdminUserWithTypeWithoutManageUsersPermission()
136 (um) -> um.addListener(Runnable::run, listener)); in testRemoveListenerPermission()
/aosp12/frameworks/base/packages/SettingsLib/src/com/android/settingslib/development/
H A DDevelopmentSettingsEnabler.java43 final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); in isDevelopmentSettingsEnabled() local
47 final boolean hasRestriction = um.hasUserRestriction( in isDevelopmentSettingsEnabled()
49 final boolean isAdmin = um.isAdminUser(); in isDevelopmentSettingsEnabled()
/aosp12/packages/apps/Settings/src/com/android/settings/deviceinfo/storage/
H A DUserIconLoader.java68 UserManager um = context.getSystemService(UserManager.class); in loadUserIconsWithContext() local
69 for (UserInfo userInfo : um.getUsers()) { in loadUserIconsWithContext()
70 value.put(userInfo.id, Utils.getUserIcon(context, um, userInfo)); in loadUserIconsWithContext()
/aosp12/frameworks/base/core/tests/coretests/src/android/provider/
H A DSettingsProviderTest.java169 UserManager um = (UserManager) getContext().getSystemService(Context.USER_SERVICE); in testSettingsChangeForOtherUser() local
173 assertTrue(findUser(um, UserHandle.USER_SYSTEM)); in testSettingsChangeForOtherUser()
176 UserInfo otherUser = um.createUser("TestUser1", UserInfo.FLAG_GUEST); in testSettingsChangeForOtherUser()
195 um.removeUser(otherUser.id); in testSettingsChangeForOtherUser()
223 private boolean findUser(UserManager um, int userHandle) { in findUser() argument
224 for (UserInfo user : um.getUsers()) { in findUser()
234 UserManager um = (UserManager) getContext().getSystemService(Context.USER_SERVICE); in testPerUserSettings() local
238 assertTrue(findUser(um, UserHandle.USER_SYSTEM)); in testPerUserSettings()
241 UserInfo user = um.createUser("TestUser1", UserInfo.FLAG_GUEST); in testPerUserSettings()
266 um.removeUser(user.id); in testPerUserSettings()
/aosp12/packages/apps/Settings/src/com/android/settings/accounts/
H A DAddAccountSettings.java142 final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE); in onCreate() local
143 mUserHandle = Utils.getSecureTargetUser(getActivityToken(), um, null /* arguments */, in onCreate()
145 if (um.hasUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS, mUserHandle)) { in onCreate()
157 if (Utils.startQuietModeDialogIfNecessary(this, um, mUserHandle.getIdentifier())) { in onCreate()
161 if (um.isUserUnlocked(mUserHandle)) { in onCreate()
/aosp12/frameworks/base/services/tests/servicestests/src/com/android/server/pm/
H A DUserManagerServiceTest.java72 UserManager um = UserManager.get(mContext); in testAddUserWithAccount() local
73 UserInfo user = um.createUser("Test User", 0); in testAddUserWithAccount()
77 um.setUserAccount(tempUserId, accountName); in testAddUserWithAccount()
78 assertEquals(accountName, um.getUserAccount(tempUserId)); in testAddUserWithAccount()
/aosp12/packages/apps/Settings/tests/robotests/src/com/android/settings/bluetooth/
H A DBluetoothDevicePreferenceTest.java184 final UserManager um = mock(UserManager.class); in shouldHideSecondTarget_hasUserRestriction_shouldReturnTrue() local
185 ReflectionHelpers.setField(mPreference, "mUserManager", um); in shouldHideSecondTarget_hasUserRestriction_shouldReturnTrue()
186 when(um.hasUserRestriction(UserManager.DISALLOW_CONFIG_BLUETOOTH)).thenReturn(true); in shouldHideSecondTarget_hasUserRestriction_shouldReturnTrue()
194 final UserManager um = mock(UserManager.class); in shouldHideSecondTarget_hasBoundDeviceAndNoRestriction_shouldReturnFalse() local
195 ReflectionHelpers.setField(mPreference, "mUserManager", um); in shouldHideSecondTarget_hasBoundDeviceAndNoRestriction_shouldReturnFalse()
196 when(um.hasUserRestriction(UserManager.DISALLOW_CONFIG_BLUETOOTH)).thenReturn(false); in shouldHideSecondTarget_hasBoundDeviceAndNoRestriction_shouldReturnFalse()
/aosp12/packages/apps/TvSettings/Settings/src/com/android/tv/settings/connectivity/
H A DWifiConfigHelper.java254 final UserManager um = context.getSystemService(UserManager.class); in isNetworkLockedDown() local
275 int profileOwnerUserId = getManagedProfileId(um, UserHandle.myUserId()); in isNetworkLockedDown()
303 private static int getManagedProfileId(UserManager um, int parentUserId) { in getManagedProfileId() argument
304 final int[] profileIds = um.getProfileIdsWithDisabled(parentUserId); in getManagedProfileId()
306 if (profileId != parentUserId && um.isManagedProfile(profileId)) { in getManagedProfileId()
/aosp12/frameworks/base/packages/SettingsLib/src/com/android/settingslib/enterprise/
H A DActionDisabledLearnMoreButtonLauncher.java103 UserManager um = context.getSystemService(UserManager.class); in isSameProfileGroup() local
105 return um.isSameProfileGroup(enforcementAdminUserId, um.getUserHandle()); in isSameProfileGroup()
/aosp12/packages/apps/Settings/src/com/android/settings/
H A DTestingSettings.java33 final UserManager um = UserManager.get(getContext()); in onCreate() local
34 if (!um.isAdminUser()) { in onCreate()
H A DUtils.java461 public static int getManagedProfileId(UserManager um, int parentUserId) { in getManagedProfileId() argument
462 final int[] profileIds = um.getProfileIdsWithDisabled(parentUserId); in getManagedProfileId()
512 if (isProfileOf(um, launchedFromUser)) { in getSecureTargetUser()
519 if (launchedFromSettingsApp && isProfileOf(um, extrasUser)) { in getSecureTargetUser()
559 private static boolean isProfileOf(UserManager um, UserHandle otherUser) { in isProfileOf() argument
560 if (um == null || otherUser == null) return false; in isProfileOf()
562 || um.getUserProfiles().contains(otherUser); in isProfileOf()
718 final UserManager um = context.getSystemService(UserManager.class); in enforceSameOwner() local
738 final UserManager um = context.getSystemService(UserManager.class); in getCredentialOwnerUserId() local
739 return um.getCredentialOwnerProfile(userId); in getCredentialOwnerUserId()
[all …]
/aosp12/frameworks/base/packages/SettingsLib/src/com/android/settingslib/
H A DRestrictedLockUtilsInternal.java96 final UserManager um = UserManager.get(context); in checkIfRestrictionEnforced() local
99 um.getUserRestrictionSources(userRestriction, userHandle); in checkIfRestrictionEnforced()
127 final UserInfo parentUser = um.getProfileParent(adminUserId); in checkIfRestrictionEnforced()
146 final UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); in hasBaseUserRestriction() local
147 return um.hasBaseUserRestriction(userRestriction, UserHandle.of(userId)); in hasBaseUserRestriction()
365 UserManager um = (UserManager) context.getSystemService(Context.USER_SERVICE); in getManagedProfileId() local
366 List<UserInfo> userProfiles = um.getProfiles(userId); in getManagedProfileId()
688 UserManager um = UserManager.get(context); in isAdminInCurrentUserOrProfile() local
689 for (UserInfo userInfo : um.getProfiles(UserHandle.myUserId())) { in isAdminInCurrentUserOrProfile()
/aosp12/packages/apps/Settings/src/com/android/settings/dashboard/profileselector/
H A DUserAdapter.java52 public UserDetails(UserHandle userHandle, UserManager um, Context context) { in UserDetails() argument
54 UserInfo userInfo = um.getUserInfo(mUserHandle.getIdentifier()); in UserDetails()
63 if (um.getUserIcon(userId) != null) { in UserDetails()
64 icon = new BitmapDrawable(context.getResources(), um.getUserIcon(userId)); in UserDetails()
/aosp12/frameworks/base/core/tests/utiltests/src/com/android/internal/util/
H A DLockPatternUtilsTest.java77 final UserManager um = Mockito.mock(UserManager.class); in configureTest() local
78 when(um.getUserInfo(DEMO_USER_ID)).thenReturn(userInfo); in configureTest()
79 when(context.getSystemService(Context.USER_SERVICE)).thenReturn(um); in configureTest()
/aosp12/packages/providers/CalendarProvider/src/com/android/providers/calendar/
H A DCalendarConfidenceChecker.java88 final UserManager um = (UserManager) mContext.getSystemService(Context.USER_SERVICE); in getUserUnlockTime() local
89 final long startTime = um.getUserStartRealtime(); in getUserUnlockTime()
90 final long unlockTime = um.getUserUnlockRealtime(); in getUserUnlockTime()

1234567