Home
last modified time | relevance | path

Searched refs:UserId (Results 1 – 25 of 132) sorted by relevance

123456

/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/
DUserManagerStateTest.java48 import com.android.documentsui.base.UserId;
159 UserId currentUser = UserId.of(mSystemUser); in testGetUserIds_onlySystemUser_returnsSystemUser()
163 .that(mUserManagerState.getUserIds()).containsExactly(UserId.of(mSystemUser)); in testGetUserIds_onlySystemUser_returnsSystemUser()
169 UserId currentUser = UserId.of(mSystemUser); in testGetUserIds_allProfilesCurrentUserSystem_allShowInSharingSurfacesSeparate()
176 .containsExactly(UserId.of(mSystemUser), UserId.of(mManagedUser), in testGetUserIds_allProfilesCurrentUserSystem_allShowInSharingSurfacesSeparate()
177 UserId.of(mPrivateUser)); in testGetUserIds_allProfilesCurrentUserSystem_allShowInSharingSurfacesSeparate()
183 UserId currentUser = UserId.of(mManagedUser); in testGetUserIds_allProfilesCurrentUserManaged_allShowInSharingSurfacesSeparate()
190 .containsExactly(UserId.of(mSystemUser), UserId.of(mManagedUser), in testGetUserIds_allProfilesCurrentUserManaged_allShowInSharingSurfacesSeparate()
191 UserId.of(mPrivateUser)); in testGetUserIds_allProfilesCurrentUserManaged_allShowInSharingSurfacesSeparate()
197 UserId currentUser = UserId.of(mPrivateUser); in testGetUserIds_allProfilesCurrentUserPrivate_allShowInSharingSurfacesSeparate()
[all …]
DUserIdManagerTest.java32 import com.android.documentsui.base.UserId;
70 UserId currentUser = UserId.of(systemUser); in testGetUserIds_systemUser_currentUserIsSystemUser()
72 assertThat(mUserIdManager.getUserIds()).containsExactly(UserId.of(systemUser)); in testGetUserIds_systemUser_currentUserIsSystemUser()
78 UserId currentUser = UserId.of(systemUser); in testGetUserIds_systemUserAndManagedUser_currentUserIsSystemUser()
81 .containsExactly(UserId.of(systemUser), UserId.of(managedUser1)).inOrder(); in testGetUserIds_systemUserAndManagedUser_currentUserIsSystemUser()
87 UserId currentUser = UserId.of(managedUser1); in testGetUserIds_systemUserAndManagedUser_currentUserIsManagedUser()
90 .containsExactly(UserId.of(systemUser), UserId.of(managedUser1)).inOrder(); in testGetUserIds_systemUserAndManagedUser_currentUserIsManagedUser()
96 UserId currentUser = UserId.of(systemUser); in testGetUserIds_managedUserAndSystemUser_currentUserIsSystemUser()
99 .containsExactly(UserId.of(systemUser), UserId.of(managedUser1)).inOrder(); in testGetUserIds_managedUserAndSystemUser_currentUserIsSystemUser()
106 UserId currentUser = UserId.of(nonManagedUser2); in testGetUserIds_NormalUser1AndNormalUser2_currentUserIsNormalUser2()
[all …]
DProfileTabsTest.java32 import com.android.documentsui.base.UserId;
53 private final UserId mSystemUser = UserId.of(UserHandle.SYSTEM);
54 private final UserId mManagedUser = UserId.of(100);
55 private final UserId mPrivateUser = UserId.of(101);
144 final Map<UserId, String> userIdToLabelMap = mTestUserManagerState.getUserIdToLabelMap(); in testUpdateView_multiUsers_shouldShow()
148 UserId userId = (UserId) tab.getTag(); in testUpdateView_multiUsers_shouldShow()
252 for (UserId userId : Lists.newArrayList(mManagedUser, mPrivateUser)) { in testUpdateView_afterCurrentRootChangedMultiUser_shouldChangeSelectedUser()
297 List<UserId> expectedProfiles = Lists.newArrayList(mSystemUser, mManagedUser, mPrivateUser); in testGetSelectedUser_multiUsers()
326 private void initializeWithUsers(boolean isPrivateSpaceEnabled, UserId... userIds) { in initializeWithUsers()
330 for (UserId userId : userIds) { in initializeWithUsers()
[all …]
/packages/providers/MediaProvider/tests/src/com/android/providers/media/photopicker/data/
DUserManagerStateTest.java35 import com.android.providers.media.photopicker.data.model.UserId;
120 initializeUserManagerState(UserId.of(mPersonalUser), in testUserManagerStateThrowsErrorIfCalledFromNonMainThread()
124 () -> mUserManagerState.isManagedUserProfile(UserId.of(mManagedUser))); in testUserManagerStateThrowsErrorIfCalledFromNonMainThread()
134 UserId.of(mPersonalUser))); in testUserManagerStateThrowsErrorIfCalledFromNonMainThread()
136 () -> mUserManagerState.isCrossProfileAllowedToUser(UserId.of(mManagedUser))); in testUserManagerStateThrowsErrorIfCalledFromNonMainThread()
140 () -> mUserManagerState.isBlockedByAdmin(UserId.of(mManagedUser))); in testUserManagerStateThrowsErrorIfCalledFromNonMainThread()
142 () -> mUserManagerState.isProfileOff(UserId.of(mManagedUser))); in testUserManagerStateThrowsErrorIfCalledFromNonMainThread()
144 () -> mUserManagerState.getShowInQuietMode(UserId.of(mOtherUser1))); in testUserManagerStateThrowsErrorIfCalledFromNonMainThread()
146 () -> mUserManagerState.setUserAsCurrentUserProfile(UserId.of(mManagedUser))); in testUserManagerStateThrowsErrorIfCalledFromNonMainThread()
149 UserId.of(mPersonalUser))); in testUserManagerStateThrowsErrorIfCalledFromNonMainThread()
[all …]
DUserIdManagerTest.java32 import com.android.providers.media.photopicker.data.model.UserId;
68 UserId currentUser = UserId.of(personalUser); in testUserIdManagerThrowsErrorIfCalledFromNonMainThread()
83 UserId currentUser = UserId.of(personalUser); in testUserIds_personaUser_currentUserIsPersonalUser()
99 UserId currentUser = UserId.of(personalUser); in testUserIds_personalUserAndManagedUser_currentUserIsPersonalUser()
108 assertThat(userIdManager.getManagedUserId()).isEqualTo(UserId.of(managedUser1)); in testUserIds_personalUserAndManagedUser_currentUserIsPersonalUser()
115 UserId currentUser = UserId.of(managedUser1); in testUserIds_personalUserAndManagedUser_currentUserIsManagedUser()
123 assertThat(userIdManager.getPersonalUserId()).isEqualTo(UserId.of(personalUser)); in testUserIds_personalUserAndManagedUser_currentUserIsManagedUser()
132 UserId currentUser = UserId.of(otherUser2); in testUserIds_otherUsers_currentUserIsOtherUser2()
147 UserId currentUser = UserId.of(otherUser1); in testUserIds_otherUserAndManagedUserAndPersonalUser_currentUserIsOtherUser()
166 UserId currentUser = UserId.of(managedUser1); in testGetUserIds_otherUserAndManagedUser_currentUserIsManagedUser()
[all …]
/packages/providers/MediaProvider/src/com/android/providers/media/photopicker/data/
DUserManagerState.java43 import com.android.providers.media.photopicker.data.model.UserId;
65 boolean isManagedUserProfile(UserId userId); in isManagedUserProfile()
72 UserId getCurrentUserProfileId(); in getCurrentUserProfileId()
81 Map<UserId, Boolean> getCrossProfileAllowedStatusForAll(); in getCrossProfileAllowedStatusForAll()
94 MutableLiveData<Map<UserId, Boolean>> getCrossProfileAllowed(); in getCrossProfileAllowed()
101 List<UserId> getAllUserProfileIds(); in getAllUserProfileIds()
116 void waitForMediaProviderToBeAvailable(UserId userId); in waitForMediaProviderToBeAvailable()
123 boolean isCrossProfileAllowedToUser(UserId otherUser); in isCrossProfileAllowedToUser()
158 boolean isBlockedByAdmin(UserId userId); in isBlockedByAdmin()
163 boolean isProfileOff(UserId userId); in isProfileOff()
[all …]
DUserIdManager.java35 import com.android.providers.media.photopicker.data.model.UserId;
56 UserId getPersonalUserId(); in getPersonalUserId()
63 UserId getManagedUserId(); in getManagedUserId()
71 UserId getCurrentUserProfileId(); in getCurrentUserProfileId()
175 private final UserId mCurrentUser;
180 private UserId mPersonalUser = null;
181 private UserId mManagedUser = null;
185 private UserId mCurrentUserProfile = null;
195 this(context, UserId.CURRENT_USER); in RuntimeUserIdManager()
199 RuntimeUserIdManager(Context context, UserId currentUser) { in RuntimeUserIdManager()
[all …]
DItemsProvider.java59 import com.android.providers.media.photopicker.data.model.UserId;
125 @Nullable UserId userId, in getAllItems()
163 @Nullable UserId userId, in getLocalItems()
191 @Nullable UserId userId, in getItemsForPreselectedMedia()
216 public Cursor getAllCategories(@Nullable String[] mimeTypes, @Nullable UserId userId, in getAllCategories()
239 public Cursor getLocalCategories(@Nullable String[] mimeTypes, @Nullable UserId userId, in getLocalCategories()
251 String[] mimeTypes, @NonNull Category category, @Nullable UserId userId, in queryMedia()
260 String[] mimeTypes, @NonNull Category category, @Nullable UserId userId, in queryMedia()
265 userId = UserId.CURRENT_USER; in queryMedia()
332 @Nullable UserId userId, @Nullable CancellationSignal cancellationSignal) { in queryAlbums()
[all …]
/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/base/
DUserIdTest.java48 assertEquals(UserId.CURRENT_USER, UserId.CURRENT_USER); in testEquals()
49 assertEquals(UserId.of(UserHandle.of(10)), UserId.of(UserHandle.of(10))); in testEquals()
54 assertFalse(UserId.CURRENT_USER.equals(null)); in testEquals_handlesNulls()
59 assertFalse(UserId.of(UserHandle.of(0)).equals(UserId.of(UserHandle.of(10)))); in testNotEquals_differentUserHandle()
64 assertEquals(UserId.of(UserHandle.of(0)).hashCode(), in testHashCode_sameUserHandle()
65 UserId.of(UserHandle.of(0)).hashCode()); in testHashCode_sameUserHandle()
70 assertThat(UserId.of(UserHandle.of(0)).hashCode()).isNotEqualTo( in testHashCode_differentUserHandle()
71 UserId.of(UserHandle.of(10)).hashCode()); in testHashCode_differentUserHandle()
76 UserId userId = UserId.of(Process.myUserHandle()); in testAsContext_sameUserReturnProvidedContext()
82 assertSame(mContext, UserId.UNSPECIFIED_USER.asContext(mContext)); in testAsContext_unspecifiedUserReturnProvidedContext()
[all …]
DRootInfoTest.java34 rootInfo.userId = UserId.of(100); in testEquals_sameUser()
39 rootInfo2.userId = UserId.of(100); in testEquals_sameUser()
49 rootInfo.userId = UserId.of(100); in testNotEquals_differentUser()
54 rootInfo2.userId = UserId.of(101); in testNotEquals_differentUser()
64 rootInfo.userId = UserId.of(100); in testCopyInfo_equal()
/packages/apps/DocumentsUI/src/com/android/documentsui/
DUserManagerState.java48 import com.android.documentsui.base.UserId;
68 List<UserId> getUserIds(); in getUserIds()
73 Map<UserId, String> getUserIdToLabelMap(); in getUserIdToLabelMap()
80 Map<UserId, Drawable> getUserIdToBadgeMap(); in getUserIdToBadgeMap()
86 Map<UserId, Boolean> getCanForwardToProfileIdMap(Intent intent); in getCanForwardToProfileIdMap()
97 void onProfileActionStatusChange(String action, UserId userId); in onProfileActionStatusChange()
122 private final UserId mCurrentUser;
131 private final List<UserId> mUserIds = new ArrayList<>();
136 private final Map<UserId, String> mUserIdToLabelMap = new HashMap<>();
141 private final Map<UserId, Drawable> mUserIdToBadgeMap = new HashMap<>();
[all …]
DUserIdManager.java38 import com.android.documentsui.base.UserId;
53 List<UserId> getUserIds(); in getUserIds()
60 UserId getSystemUser(); in getSystemUser()
67 UserId getManagedUser(); in getManagedUser()
84 private final UserId mCurrentUser;
88 private final List<UserId> mUserIds = new ArrayList<>();
90 private UserId mSystemUser = null;
92 private UserId mManagedUser = null;
105 this(context, UserId.CURRENT_USER, in RuntimeUserIdManager()
110 RuntimeUserIdManager(Context context, UserId currentUser, boolean isDeviceSupported) { in RuntimeUserIdManager()
[all …]
DProfileTabs.java35 import com.android.documentsui.base.UserId;
62 private List<UserId> mUserIds;
97 mUserIds = Collections.singletonList(UserId.CURRENT_USER); in ProfileTabs()
105 mListener.onUserSelected((UserId) tab.getTag()); in ProfileTabs()
174 List<UserId> userIds = getUserIds(); in updateTabsIfNeeded()
192 private List<UserId> getUserIds() { in getUserIds()
205 Map<UserId, String> userIdToLabelMap = mUserManagerState.getUserIdToLabelMap(); in addTabsPrivateSpaceEnabled()
208 for (UserId userId : mUserIds) { in addTabsPrivateSpaceEnabled()
245 public UserId getSelectedUser() { in getSelectedUser()
247 return (UserId) mTabs.getTabAt(mTabs.getSelectedTabPosition()).getTag(); in getSelectedUser()
[all …]
DDocumentsAccess.java38 import com.android.documentsui.base.UserId;
51 @Nullable DocumentInfo getDocument(Uri uri, UserId userId); in getDocument()
52 @Nullable DocumentInfo getArchiveDocument(Uri uri, UserId userId); in getArchiveDocument()
57 Path findDocumentPath(Uri uri, UserId userId) in findDocumentPath()
60 List<DocumentInfo> getDocuments(UserId userId, String authority, List<String> docIds) in getDocuments()
88 public @Nullable DocumentInfo getDocument(Uri uri, UserId userId) { in getDocument()
101 public List<DocumentInfo> getDocuments(UserId userId, String authority, List<String> docIds) in getDocuments()
127 public DocumentInfo getArchiveDocument(Uri uri, UserId userId) { in getArchiveDocument()
139 public Path findDocumentPath(Uri docUri, UserId userId) in findDocumentPath()
165 return UserId.CURRENT_USER.equals(parentDoc.userId) in createDocument()
/packages/apps/DocumentsUI/src/com/android/documentsui/base/
DUserId.java43 public final class UserId { class
46 public static final UserId UNSPECIFIED_USER = UserId.of(UserHandle.of(-1000));
48 public static final UserId CURRENT_USER = UserId.of(Process.myUserHandle());
51 public static final UserId DEFAULT_USER = CURRENT_USER;
57 private UserId(UserHandle userHandle) { in UserId() method in UserId
65 public static UserId of(UserHandle userHandle) { in of()
66 return new UserId(userHandle); in of()
74 public static UserId of(int userIdentifier) { in of()
223 if (o instanceof UserId) { in equals()
224 UserId other = (UserId) o; in equals()
[all …]
DDocumentInfo.java60 public UserId userId;
80 userId = UserId.UNSPECIFIED_USER; in reset()
98 userId = UserId.read(in); in read()
101 userId = UserId.CURRENT_USER; in read()
124 UserId.write(out, userId); in write()
163 final UserId userId = UserId.of(getCursorInt(cursor, RootCursorWrapper.COLUMN_USER_ID)); in fromDirectoryCursor()
168 public static DocumentInfo fromCursor(Cursor cursor, UserId userId, String authority) { in fromCursor()
175 public void updateFromCursor(Cursor cursor, UserId userId, String authority) { in updateFromCursor()
193 public static DocumentInfo fromUri(ContentResolver resolver, Uri uri, UserId userId) in fromUri()
204 public void updateSelf(ContentResolver resolver, UserId userId) throws FileNotFoundException { in updateSelf()
[all …]
/packages/apps/DocumentsUI/tests/common/com/android/documentsui/
DTestUserManagerState.java26 import com.android.documentsui.base.UserId;
37 public List<UserId> userIds = new ArrayList<>();
38 public Map<UserId, String> userIdToLabelMap = new HashMap<>();
39 public Map<UserId, Boolean> canFrowardToProfileIdMap = new HashMap<>();
40 public Map<UserId, Drawable> userIdToBadgeMap = new HashMap<>();
46 public List<UserId> getUserIds() { in getUserIds()
51 public Map<UserId, String> getUserIdToLabelMap() { in getUserIdToLabelMap()
56 public Map<UserId, Drawable> getUserIdToBadgeMap() { in getUserIdToBadgeMap()
61 public Map<UserId, Boolean> getCanForwardToProfileIdMap(Intent intent) { in getCanForwardToProfileIdMap()
66 public void onProfileActionStatusChange(String action, UserId userId) { in onProfileActionStatusChange()
DTestUserIdManager.java19 import com.android.documentsui.base.UserId;
25 public List<UserId> userIds = new ArrayList<>();
26 public UserId systemUser = null;
27 public UserId managedUser = null;
30 public List<UserId> getUserIds() { in getUserIds()
35 public UserId getSystemUser() { in getSystemUser()
40 public UserId getManagedUser() { in getManagedUser()
/packages/apps/DocumentsUI/src/com/android/documentsui/roots/
DProvidersCache.java60 import com.android.documentsui.base.UserId;
102 private final Map<UserId, RootsChangedObserver> mRootsChangedObservers = new HashMap<>();
105 private final Map<UserId, RootInfo> mRecentsRoots = new HashMap<>();
131 private RootInfo generateRecentsRoot(UserId rootUserId) { in generateRecentsRoot()
144 private RootInfo createOrGetRecentsRoot(UserId userId) {
148 private RootsChangedObserver createOrGetRootsChangedObserver(UserId userId) {
153 private static <T> T createOrGetByUserId(Map<UserId, T> map, UserId userId,
154 Function<UserId, T> supplier) {
165 private final UserId mUserId;
167 RootsChangedObserver(UserId userId) {
[all …]
DProvidersAccess.java29 import com.android.documentsui.base.UserId;
48 RootInfo getRootOneshot(UserId userId, String authority, String rootId); in getRootOneshot()
56 RootInfo getRecentsRoot(UserId userId); in getRecentsRoot()
58 String getApplicationName(UserId userId, String authority); in getApplicationName()
60 String getPackageName(UserId userId, String authority); in getPackageName()
66 Collection<RootInfo> getRootsForAuthorityBlocking(UserId userId, String authority); in getRootsForAuthorityBlocking()
116 if (!UserId.CURRENT_USER.equals(root.userId) && !state.supportsCrossProfile()) { in getMatchingRoots()
/packages/providers/MediaProvider/src/com/android/providers/media/photopicker/data/model/
DUserId.java35 public final class UserId { class
37 public static final UserId CURRENT_USER = UserId.of(Process.myUserHandle());
43 private UserId(UserHandle userHandle) { in UserId() method in UserId
55 public static UserId of(UserHandle userHandle) { in of()
56 return new UserId(userHandle); in of()
112 UserId other = (UserId)obj; in equals()
/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/sidebar/
DRootItemListBuilderTest.java24 import com.android.documentsui.base.UserId;
69 UserId.DEFAULT_USER, Collections.singletonList(UserId.DEFAULT_USER)); in testGetList_empty()
78 UserId.DEFAULT_USER, Collections.singletonList(UserId.DEFAULT_USER)); in testGetList_singleUser()
91 mBuilder = new RootItemListBuilder(UserId.DEFAULT_USER, in testGetList_twoUsers_allMultiProfileRootsMatchOther_defaultUser()
92 Lists.newArrayList(UserId.DEFAULT_USER, TestProvidersAccess.OtherUser.USER_ID)); in testGetList_twoUsers_allMultiProfileRootsMatchOther_defaultUser()
118 Lists.newArrayList(UserId.DEFAULT_USER, TestProvidersAccess.OtherUser.USER_ID)); in testGetList_twoUsers_allMultiProfileRootsMatchOther_otherUser()
141 mBuilder = new RootItemListBuilder(UserId.DEFAULT_USER, in testGetList_twoUsers_defaultUserHasAllMatchingRoots()
142 Lists.newArrayList(UserId.DEFAULT_USER, TestProvidersAccess.OtherUser.USER_ID)); in testGetList_twoUsers_defaultUserHasAllMatchingRoots()
164 Lists.newArrayList(UserId.DEFAULT_USER, TestProvidersAccess.OtherUser.USER_ID)); in testGetList_twoUsers_secondUserFillsUpNonMatchingRoots()
/packages/apps/DocumentsUI/tests/common/com/android/documentsui/testing/
DTestProvidersAccess.java26 import com.android.documentsui.base.UserId;
40 public static final UserId USER_ID = UserId.of(USER_HANDLE);
57 UserId userId = TestProvidersAccess.USER_ID;
174 public static final UserId USER_ID = UserId.of(OtherUser.USER_HANDLE);
183 UserId userId = OtherUser.USER_ID;
235 public static final UserId USER_ID = UserId.of(AnotherUser.USER_HANDLE);
244 UserId userId = AnotherUser.USER_ID;
321 public RootInfo getRootOneshot(UserId userId, String authority, String rootId) { in getRootOneshot()
342 public Collection<RootInfo> getRootsForAuthorityBlocking(UserId userId, String authority) { in getRootsForAuthorityBlocking()
361 public RootInfo getRecentsRoot(UserId userId) { in getRecentsRoot()
[all …]
/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/dirlist/
DIconHelperTest.java31 import com.android.documentsui.base.UserId;
46 private final UserId mSystemUser = UserId.of(UserHandle.SYSTEM);
47 private final UserId mManagedUser = UserId.of(100);
48 private final UserId mPrivateUser = UserId.of(101);
/packages/apps/DocumentsUI/src/com/android/documentsui/sidebar/
DRootItemListBuilder.java21 import com.android.documentsui.base.UserId;
54 private final UserId mSelectedUser;
55 private final List<UserId> mUserIds;
58 RootItemListBuilder(UserId selectedUser, List<UserId> userIds) { in RootItemListBuilder()

123456