Home
last modified time | relevance | path

Searched refs:CURRENT_USER (Results 1 – 25 of 46) sorted by relevance

12

/packages/modules/HealthFitness/tests/unittests/src/com/android/server/healthconnect/permission/
DFirstGrantTimeUnitTest.java77 private static final UserHandle CURRENT_USER = Process.myUserHandle(); field in FirstGrantTimeUnitTest
97 when(mDatastore.readForUser(CURRENT_USER, DATA_TYPE_CURRENT)) in setUp()
99 when(mDatastore.readForUser(CURRENT_USER, DATA_TYPE_STAGED)) in setUp()
101 when(mTracker.supportsPermissionUsageIntent(SELF_PACKAGE_NAME, CURRENT_USER)) in setUp()
151 when(mDatastore.readForUser(CURRENT_USER, DATA_TYPE_CURRENT)) in testSetFirstGrantTimeForAnApp_expectOtherAppsGrantTimesRemained()
159 assertThat(mGrantTimeManager.getFirstGrantTime(SELF_PACKAGE_NAME, CURRENT_USER)) in testSetFirstGrantTimeForAnApp_expectOtherAppsGrantTimesRemained()
161 assertThat(mGrantTimeManager.getFirstGrantTime(anotherPackage, CURRENT_USER)) in testSetFirstGrantTimeForAnApp_expectOtherAppsGrantTimesRemained()
164 mGrantTimeManager.setFirstGrantTime(SELF_PACKAGE_NAME, instant3, CURRENT_USER); in testSetFirstGrantTimeForAnApp_expectOtherAppsGrantTimesRemained()
165 verify(mDatastore).writeForUser(captor.capture(), eq(CURRENT_USER), anyInt()); in testSetFirstGrantTimeForAnApp_expectOtherAppsGrantTimesRemained()
177 mGrantTimeManager.getFirstGrantTime("android.unknown_package", CURRENT_USER); in testUnknownPackage_throwsException()
[all …]
DHealthPermissionIntentAppsTrackerTest.java43 private static final UserHandle CURRENT_USER = Process.myUserHandle(); field in HealthPermissionIntentAppsTrackerTest
56 when(mUserManager.getUserHandles(anyBoolean())).thenReturn(List.of(CURRENT_USER)); in setUp()
64 assertThat(mTracker.supportsPermissionUsageIntent(SELF_PACKAGE_NAME, CURRENT_USER)) in testCheckPackage_packageSupportsIntent_returnsTrue()
71 assertThat(mTracker.supportsPermissionUsageIntent(SELF_PACKAGE_NAME, CURRENT_USER)) in testCheckPackage_packageDoesntSupportIntent_returnsFalse()
78 assertThat(mTracker.supportsPermissionUsageIntent(SELF_PACKAGE_NAME, CURRENT_USER)) in testUpdatePackageState_packageSupportIntentRemoved_returnsRemovedIntentTrue()
81 assertThat(mTracker.updateStateAndGetIfIntentWasRemoved(SELF_PACKAGE_NAME, CURRENT_USER)) in testUpdatePackageState_packageSupportIntentRemoved_returnsRemovedIntentTrue()
83 assertThat(mTracker.supportsPermissionUsageIntent(SELF_PACKAGE_NAME, CURRENT_USER)) in testUpdatePackageState_packageSupportIntentRemoved_returnsRemovedIntentTrue()
88 when(mPackageManager.queryIntentActivitiesAsUser(any(), any(), eq(CURRENT_USER))) in setSelfIntentSupport()
DPermissionPackageChangesOrchestratorTest.java50 private static final UserHandle CURRENT_USER = Process.myUserHandle(); field in PermissionPackageChangesOrchestratorTest
93 .updateStateAndGetIfIntentWasRemoved(eq(SELF_PACKAGE_NAME), eq(CURRENT_USER)); in testPackageAdded_callsTrackerToUpdateState_noGrantTimeOrPermsCalls()
95 .revokeAllHealthPermissions(eq(SELF_PACKAGE_NAME), anyString(), eq(CURRENT_USER)); in testPackageAdded_callsTrackerToUpdateState_noGrantTimeOrPermsCalls()
97 .onPackageRemoved(eq(SELF_PACKAGE_NAME), eq(mCurrentUid), eq(CURRENT_USER)); in testPackageAdded_callsTrackerToUpdateState_noGrantTimeOrPermsCalls()
105 .updateStateAndGetIfIntentWasRemoved(eq(SELF_PACKAGE_NAME), eq(CURRENT_USER)); in testPackageChanged_intentWasRemoved_revokesPerms()
107 .revokeAllHealthPermissions(eq(SELF_PACKAGE_NAME), anyString(), eq(CURRENT_USER)); in testPackageChanged_intentWasRemoved_revokesPerms()
116 .onPackageRemoved(eq(SELF_PACKAGE_NAME), eq(mCurrentUid), eq(CURRENT_USER)); in testPackageRemoved_resetsGrantTime()
138 .onPackageRemoved(eq(SELF_PACKAGE_NAME), eq(mCurrentUid), eq(CURRENT_USER)); in testPackageReplaced_noGrantTimeResetsOrPermsRevokes()
140 .revokeAllHealthPermissions(eq(SELF_PACKAGE_NAME), anyString(), eq(CURRENT_USER)); in testPackageReplaced_noGrantTimeResetsOrPermsRevokes()
150 .revokeAllHealthPermissions(eq(SELF_PACKAGE_NAME), anyString(), eq(CURRENT_USER)); in testPackageReplaced_intentNotSupported_revokesPerms()
[all …]
/packages/providers/MediaProvider/tests/src/com/android/providers/media/photopicker/
DItemsProviderTest.java576 Item item = Item.fromCursor(res, UserId.CURRENT_USER); in testGetItems_withPagination_sameDateModified()
604 assertThat(Item.fromCursor(res2, UserId.CURRENT_USER).compareTo( in testGetItems_withPagination_sameDateModified()
639 Item item = Item.fromCursor(res, UserId.CURRENT_USER); in testGetItems_withPagination_differentTimeModified()
665 assertThat(Item.fromCursor(res2, UserId.CURRENT_USER).compareTo( in testGetItems_withPagination_differentTimeModified()
882 Item item = Item.fromCursor(res, UserId.CURRENT_USER); in testGetItemsImages_withLocalIdSelection()
918 Item item = Item.fromCursor(res, UserId.CURRENT_USER); in testGetItemsImages_withLocalIdSelection_largeDataSet()
1027 UserId.CURRENT_USER); in testGetLocalItems_withCloudFeatureOn()
1032 UserId.CURRENT_USER, /* cancellationSignal */ null)) { in testGetLocalItems_withCloudFeatureOn() argument
1044 UserId.CURRENT_USER, in testGetLocalItems_withCloudFeatureOn() argument
1074 UserId.CURRENT_USER); in testGetLocalItems_mergedAlbum_withCloudFeatureOn()
[all …]
/packages/apps/DocumentsUI/tests/unit/com/android/documentsui/base/
DUserIdTest.java48 assertEquals(UserId.CURRENT_USER, UserId.CURRENT_USER); in testEquals()
54 assertFalse(UserId.CURRENT_USER.equals(null)); in testEquals_handlesNulls()
/packages/apps/DocumentsUI/src/com/android/documentsui/base/
DUserId.java48 public static final UserId CURRENT_USER = UserId.of(Process.myUserHandle()); field in UserId
51 public static final UserId DEFAULT_USER = CURRENT_USER;
86 if (CURRENT_USER.equals(this) || isUnspecified()) { in asContext()
DState.java111 if (canForwardToProfileIdMap.isEmpty() && UserId.CURRENT_USER.equals(userId)) { in canInteractWith()
116 return canShareAcrossProfile || UserId.CURRENT_USER.equals(userId); in canInteractWith()
DDocumentInfo.java101 userId = UserId.CURRENT_USER; in read()
339 if (UserId.CURRENT_USER.equals(userId)) { in getDocumentUri()
351 if (UserId.CURRENT_USER.equals(userId)) { in getTreeDocumentUri()
/packages/services/Car/tests/carservice_unit_test/src/com/android/car/
DCarOccupantZoneServiceTest.java129 private static final int CURRENT_USER = 100; field in CarOccupantZoneServiceTest
263 mVisibleUsers.add(CURRENT_USER); in setUp()
270 doReturn(CURRENT_USER).when(mService).getCurrentUser(); in setUp()
405 doReturn(CURRENT_USER).when(mService).getCurrentUser(); in setUpServiceWithProfileSupportEnabled()
409 doReturn(profileUsers).when(mUserHandleHelper).getEnabledProfiles(CURRENT_USER); in setUpServiceWithProfileSupportEnabled()
526 assertUserForThreeZones(CURRENT_USER, VISIBLE_USER, in assertVisibleUserAssignment()
543 assertUserForThreeZones(CURRENT_USER, VISIBLE_USER, in testKeepVisibleUserAfterDisplayChange()
550 assertUserForThreeZones(CURRENT_USER, VISIBLE_USER, in testKeepVisibleUserAfterDisplayChange()
597 assertUserForThreeZones(CURRENT_USER, CarOccupantZoneManager.INVALID_USER_ID, in testUnassignAfterUserStop()
812 assertOccupantConfig(configs.get(0), CURRENT_USER, new Display[]{mDisplay0, mDisplay1}, in testActiveOccupantConfigs()
[all …]
/packages/providers/MediaProvider/tests/src/com/android/providers/media/photopicker/data/model/
DCategoryTest.java54 final Category category = Category.fromCursor(cursor, UserId.CURRENT_USER); in testConstructor()
61 /* authority */ LOCAL_PROVIDER_AUTHORITY, UserId.CURRENT_USER)); in testConstructor()
/packages/providers/MediaProvider/src/com/android/providers/media/photopicker/data/model/
DUserId.java37 public static final UserId CURRENT_USER = UserId.of(Process.myUserHandle()); field in UserId
66 if (CURRENT_USER.equals(this)) { in asContext()
/packages/apps/DocumentsUI/tests/functional/com/android/documentsui/dirlist/
DDirectoryAddonsAdapterPrivateSpaceTest.java53 private static final UserId CURRENT_USER = TestProvidersAccess.USER_ID; field in DirectoryAddonsAdapterPrivateSpaceTest
82 userIdToLabelMap.put(CURRENT_USER, "Personal"); in setUp()
92 CURRENT_USER, SELECTED_USER, userIdToLabelMap, mUserManager, mTestConfigStore); in setUp()
/packages/apps/DocumentsUI/src/com/android/documentsui/
DUserIdManager.java105 this(context, UserId.CURRENT_USER, in RuntimeUserIdManager()
203 Log.w(TAG, "The current user " + UserId.CURRENT_USER in getUserIdsInternal()
DProfileTabs.java97 mUserIds = Collections.singletonList(UserId.CURRENT_USER); in ProfileTabs()
249 return UserId.CURRENT_USER; in getSelectedUser()
/packages/providers/MediaProvider/src/com/android/providers/media/photopicker/data/
DUserIdManager.java195 this(context, UserId.CURRENT_USER); in RuntimeUserIdManager()
269 return mCurrentUserProfile.equals(UserId.CURRENT_USER); in isCurrentUserSelected()
DItemsProvider.java265 userId = UserId.CURRENT_USER; in queryMedia()
334 userId = UserId.CURRENT_USER; in queryAlbums()
383 if (userId.equals(UserId.CURRENT_USER)) { in getItemsUri()
DPickerResult.java76 final String userId = userInfo == null ? UserId.CURRENT_USER.toString() : userInfo; in getPickerUri()
DUserManagerState.java250 this(context, UserId.CURRENT_USER); in RuntimeUserManagerState()
361 return mCurrentUserProfile.equals(UserId.CURRENT_USER); in isCurrentUserSelected()
/packages/apps/DocumentsUI/src/com/android/documentsui/sidebar/
DProfileItem.java32 super(info, title, UserId.CURRENT_USER, actionHandler); in ProfileItem()
DRootsFragment.java283 UserId.CURRENT_USER, getContext().getPackageManager(), in onActivityCreated()
364 if (!UserId.CURRENT_USER.equals(getBaseActivity().getSelectedUser())) { in updateCrossProfileStateAndMaybeRefresh()
375 if (!UserId.CURRENT_USER.equals(getBaseActivity().getSelectedUser())) { in updateCrossProfileMapStateAndMaybeRefresh()
595 if (UserId.CURRENT_USER.equals(userIds.get(i))) { in addToApplicationItemListPrivateSpaceEnabled()
627 if (UserId.CURRENT_USER.equals(item.userId)) { in createRootListsPrivateSpaceDisabled()
DUserItemsCombiner.java56 mCurrentUser = UserId.CURRENT_USER; in UserItemsCombiner()
/packages/providers/MediaProvider/tests/src/com/android/providers/media/photopicker/viewmodel/
DPickerViewModelTest.java174 when(userManagerState.getCurrentUserProfileId()).thenReturn(UserId.CURRENT_USER); in setUp()
180 when(userIdManager.getCurrentUserProfileId()).thenReturn(UserId.CURRENT_USER); in setUp()
190 UserId.CURRENT_USER.getIdentifier()); in setUp()
221 final Category fakeFirstCategory = Category.fromCursor(fakeCursor, UserId.CURRENT_USER); in testGetCategories()
224 UserId.CURRENT_USER); in testGetCategories()
380 UserId.CURRENT_USER)); in test_initialisePreSelectionItems_correctItemsLoaded()
/packages/apps/DocumentsUI/src/com/android/documentsui/picker/
DPickActivity.java237 } else if (CrossProfileUtils.getCrossProfileResolveInfo(UserId.CURRENT_USER, in setupLayout()
419 mInjector.pickResult.setHasCrossProfileUri(!UserId.CURRENT_USER.equals(doc.userId)); in onDocumentPicked()
443 if (!UserId.CURRENT_USER.equals(doc.userId)) { in onDocumentsPicked()
DActionHandler.java375 boolean isCurrentUser = UserId.CURRENT_USER.equals(userId); in openRoot()
381 Metrics.logLaunchOtherApp(!UserId.CURRENT_USER.equals(userId)); in openRoot()
/packages/apps/DocumentsUI/src/com/android/documentsui/roots/
DProvidersAccess.java116 if (!UserId.CURRENT_USER.equals(root.userId) && !state.supportsCrossProfile()) { in getMatchingRoots()

12