Home
last modified time | relevance | path

Searched refs:mMockPackageManager (Results 1 – 25 of 42) sorted by relevance

12

/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/statusbar/notification/row/
DPartialConversationInfoTest.java95 private PackageManager mMockPackageManager; field in PartialConversationInfoTest
122 when(mMockPackageManager.getPackageInfo(eq(TEST_PACKAGE_NAME), anyInt())) in setUp()
126 when(mMockPackageManager.getApplicationInfo(eq(TEST_PACKAGE_NAME), anyInt())).thenReturn( in setUp()
130 when(mMockPackageManager.getPackageInfo(eq(TEST_SYSTEM_PACKAGE_NAME), anyInt())) in setUp()
132 when(mMockPackageManager.getPackageInfo(eq("android"), anyInt())) in setUp()
157 when(mMockPackageManager.getApplicationLabel(any())).thenReturn("Package"); in testBindNotification_SetsName()
159 mMockPackageManager, in testBindNotification_SetsName()
175 when(mMockPackageManager.getApplicationIcon((ApplicationInfo) any())).thenReturn(mDrawable); in testBindNotification_setsIcon()
177 mMockPackageManager, in testBindNotification_setsIcon()
193 mMockPackageManager, in testBindNotification_noDelegate()
[all …]
DNotificationInfoTest.java112 private PackageManager mMockPackageManager; field in NotificationInfoTest
141 when(mMockPackageManager.getPackageInfo(eq(TEST_PACKAGE_NAME), anyInt())) in setUp()
147 when(mMockPackageManager.getPackageInfo(eq(TEST_SYSTEM_PACKAGE_NAME), anyInt())) in setUp()
149 when(mMockPackageManager.getPackageInfo(eq("android"), anyInt())) in setUp()
174 when(mMockPackageManager.getApplicationLabel(any())).thenReturn("App Name"); in testBindNotification_SetsTextApplicationName()
176 mMockPackageManager, in testBindNotification_SetsTextApplicationName()
199 when(mMockPackageManager.getApplicationIcon(any(ApplicationInfo.class))) in testBindNotification_SetsPackageIcon()
202 mMockPackageManager, in testBindNotification_SetsPackageIcon()
224 mMockPackageManager, in testBindNotification_noDelegate()
249 when(mMockPackageManager.getApplicationInfo(eq("other"), anyInt())).thenReturn( in testBindNotification_delegate()
[all …]
DFeedbackInfoTest.java82 private final PackageManager mMockPackageManager = mock(PackageManager.class); field in FeedbackInfoTest
112 when(mMockPackageManager.getPackageInfo(eq(TEST_PACKAGE_NAME), anyInt())) in setUp()
116 when(mMockPackageManager.getApplicationInfo(anyString(), anyInt())).thenReturn( in setUp()
134 when(mMockPackageManager.getApplicationLabel(any())).thenReturn("App Name"); in testBindNotification_SetsTextApplicationName()
135 mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(), in testBindNotification_SetsTextApplicationName()
145 when(mMockPackageManager.getApplicationIcon(any(ApplicationInfo.class))) in testBindNotification_SetsPackageIcon()
147 mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(), in testBindNotification_SetsPackageIcon()
158 mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(), mMockNotificationRow, in testPrompt_silenced()
170 mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(), mMockNotificationRow, in testPrompt_promoted()
182 mFeedbackInfo.bindGuts(mMockPackageManager, mSbn, getEntry(), mMockNotificationRow, in testPrompt_alerted()
[all …]
DNotificationConversationInfoTest.java136 private PackageManager mMockPackageManager; field in NotificationConversationInfoTest
184 when(mMockPackageManager.getPackageInfo(eq(TEST_PACKAGE_NAME), anyInt())) in setUp()
190 when(mMockPackageManager.getPackageInfo(eq(TEST_SYSTEM_PACKAGE_NAME), anyInt())) in setUp()
192 when(mMockPackageManager.getPackageInfo(eq("android"), anyInt())) in setUp()
244 mMockPackageManager, in testBindNotification_SetsShortcutIcon()
266 when(mMockPackageManager.getApplicationLabel(any())).thenReturn("App Name"); in testBindNotification_SetsTextApplicationName()
269 mMockPackageManager, in testBindNotification_SetsTextApplicationName()
322 mMockPackageManager, in testBindNotification_SetsTextGroupName()
348 mMockPackageManager, in testBindNotification_GroupNameHiddenIfNoGroup()
373 mMockPackageManager, in testBindNotification_noDelegate()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/
DResumeOnRebootServiceProviderTests.java57 PackageManager mMockPackageManager; field in ResumeOnRebootServiceProviderTests
79 when(mMockPackageManager.queryIntentServices(any(), in noServiceFound()
83 mMockPackageManager).getServiceConnection()).isNull(); in noServiceFound()
91 when(mMockPackageManager.queryIntentServices(any(), anyInt())).thenReturn(resultList); in serviceNotGuardedWithPermission()
93 mMockPackageManager).getServiceConnection()).isNull(); in serviceNotGuardedWithPermission()
101 when(mMockPackageManager.queryIntentServices(any(), anyInt())).thenReturn(resultList); in serviceResolved()
104 mMockPackageManager).getServiceConnection()).isNotNull(); in serviceResolved()
106 verify(mMockPackageManager).queryIntentServices(mIntentArgumentCaptor.capture(), in serviceResolved()
/frameworks/base/services/tests/servicestests/src/com/android/server/locales/
DLocaleManagerServiceTest.java90 private PackageManager mMockPackageManager; field in LocaleManagerServiceTest
105 mMockPackageManager = mock(PackageManager.class); in setUp()
110 doReturn(DEFAULT_INSTALL_SOURCE_INFO).when(mMockPackageManager) in setUp()
112 doReturn(mMockPackageManager).when(mMockContext).getPackageManager(); in setUp()
129 mMockActivityManager, mMockPackageManager, in setUp()
136 .when(mMockPackageManager).getPackageUidAsUser(anyString(), any(), anyInt()); in testSetApplicationLocales_arbitraryAppWithoutPermissions_fails()
185 .when(mMockPackageManager).getPackageUidAsUser(anyString(), any(), anyInt()); in testSetApplicationLocales_arbitraryAppWithPermission_succeeds()
202 .when(mMockPackageManager).getPackageUidAsUser(anyString(), any(), anyInt()); in testSetApplicationLocales_callerOwnsPackage_succeeds()
215 .when(mMockPackageManager).getPackageUidAsUser(anyString(), any(), anyInt()); in testSetApplicationLocales_invalidPackageOrUserId_fails()
229 doReturn(DEFAULT_UID).when(mMockPackageManager) in testGetApplicationLocales_arbitraryAppWithoutPermission_fails()
[all …]
DSystemAppUpdateTrackerTest.java98 PackageManager mMockPackageManager; field in SystemAppUpdateTrackerTest
115 mMockPackageManager = mock(PackageManager.class); in setUp()
122 mMockPackageManager, mockLocaleManagerBackupHelper, in setUp()
129 doReturn(DEFAULT_INSTALL_SOURCE_INFO).when(mMockPackageManager) in setUp()
131 doReturn(mMockPackageManager).when(mMockContext).getPackageManager(); in setUp()
155 .when(mMockPackageManager).getApplicationInfo(eq(DEFAULT_PACKAGE_NAME_1), any()); in testInit_loadsCorrectly()
172 .when(mMockPackageManager).getApplicationInfo(eq(DEFAULT_PACKAGE_NAME_1), any()); in testOnPackageUpdatedFinished_systemAppFirstUpdate_writesToFile()
191 .when(mMockPackageManager).getApplicationInfo(eq(DEFAULT_PACKAGE_NAME_1), any()); in testOnPackageUpdatedFinished_systemAppSecondUpdate_doesNothing()
222 .when(mMockPackageManager).getApplicationInfo(eq(DEFAULT_PACKAGE_NAME_2), any()); in testOnPackageUpdatedFinished_notSystemApp_doesNothing()
240 .when(mMockPackageManager).getApplicationInfo(eq(DEFAULT_PACKAGE_NAME_1), any()); in testOnPackageUpdatedFinished_noInstaller_doesNothing()
[all …]
DLocaleManagerBackupRestoreTest.java114 private PackageManager mMockPackageManager; field in LocaleManagerBackupRestoreTest
142 mMockPackageManager = mock(PackageManager.class); in setUp()
148 doReturn(mMockPackageManager).when(mContext).getPackageManager(); in setUp()
162 mMockLocaleManagerService, mMockPackageManager, mClock, broadcastHandlerThread, in setUp()
188 doReturn(List.of()).when(mMockPackageManager) in testBackupPayload_noAppsInstalled_returnsNull()
242 doReturn(List.of(defaultAppInfo, anotherAppInfo)).when(mMockPackageManager) in testBackupPayload_exceptionInGetLocalesSomePackages_appsWithExceptionNotBackedUp()
642 doReturn(List.of()).when(mMockPackageManager) in testStageDataDeletion_backupPassRunAfterRetentionPeriod_stageDataDeleted()
651 doReturn(List.of()).when(mMockPackageManager) in testStageDataDeletion_backupPassRunAfterRetentionPeriod_stageDataDeleted()
660 doReturn(List.of()).when(mMockPackageManager) in testStageDataDeletion_backupPassRunAfterRetentionPeriod_stageDataDeleted()
860 doReturn(new PackageInfo()).when(mMockPackageManager).getPackageInfoAsUser( in setUpPackageInstalled()
[all …]
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/rollback/
DRollbackPackageHealthObserverTest.java90 PackageManager mMockPackageManager; field in RollbackPackageHealthObserverTest
235 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in testMayObservePackage_forPersistentApp()
236 when(mMockPackageManager.getApplicationInfo(APP_A, 0)).thenReturn(info); in testMayObservePackage_forPersistentApp()
248 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in testMayObservePackage_forNonPersistentApp()
249 when(mMockPackageManager.getApplicationInfo(APP_A, 0)) in testMayObservePackage_forNonPersistentApp()
276 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in healthCheckFailed_impactLevelLow_onePackage()
277 when(mMockPackageManager.getModuleInfo(any(), eq(0))).thenReturn(null); in healthCheckFailed_impactLevelLow_onePackage()
307 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in healthCheckFailed_impactLevelHigh_onePackage()
308 when(mMockPackageManager.getModuleInfo(any(), eq(0))).thenReturn(null); in healthCheckFailed_impactLevelHigh_onePackage()
338 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in healthCheckFailed_impactLevelManualOnly_onePackage()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/tv/
DTvRemoteProviderWatcherTest.java50 PackageManager mMockPackageManager; field in TvRemoteProviderWatcherTest
64 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp()
71 when(mMockPackageManager.checkPermission( in setUp()
76 when(mMockPackageManager.checkPermission( in setUp()
81 when(mMockPackageManager.checkPermission(Manifest.permission.TV_VIRTUAL_REMOTE_CONTROLLER, in setUp()
142 reset(mMockPackageManager); in packageManagerPermissionIsRequired()
143 when(mMockPackageManager.checkPermission(anyString(), anyString())).thenReturn( in packageManagerPermissionIsRequired()
/frameworks/base/core/tests/coretests/src/com/android/internal/accessibility/util/
DAccessibilityUtilsTest.java54 private PackageManager mMockPackageManager; field in AccessibilityUtilsTest
154 when(mMockPackageManager.queryIntentServicesAsUser(any(), any(), in getAccessibilityMenuComponentToMigrate_isNull_whenNoMenuComponents()
158 mMockPackageManager, USER_ID); in getAccessibilityMenuComponentToMigrate_isNull_whenNoMenuComponents()
165 when(mMockPackageManager.queryIntentServicesAsUser(any(), any(), in getAccessibilityMenuComponentToMigrate_isNull_whenTooManyMenuComponents()
175 mMockPackageManager, USER_ID); in getAccessibilityMenuComponentToMigrate_isNull_whenTooManyMenuComponents()
182 when(mMockPackageManager.queryIntentServicesAsUser(any(), any(), in getAccessibilityMenuComponentToMigrate_isNull_whenMenuInSystemNotFound()
190 mMockPackageManager, USER_ID); in getAccessibilityMenuComponentToMigrate_isNull_whenMenuInSystemNotFound()
199 when(mMockPackageManager.queryIntentServicesAsUser(any(), any(), in getAccessibilityMenuComponentToMigrate_returnsMenuOutsideSystem()
205 mMockPackageManager, USER_ID); in getAccessibilityMenuComponentToMigrate_returnsMenuOutsideSystem()
/frameworks/base/core/tests/coretests/src/com/android/internal/app/
DResolverListControllerTest.java73 @Mock private PackageManager mMockPackageManager; field in ResolverListControllerTest
91 when(mMockPackageManager.queryIntentServices(any(), anyInt())).thenReturn(services); in setUp()
97 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp()
125 mController = new ResolverListController(mMockContext, mMockPackageManager, sendIntent, in reportChooserSelection()
141 mController = new ResolverListController(mMockContext, mMockPackageManager, sendIntent, in topKEqualsToSort()
168 when(mMockPackageManager.queryIntentActivitiesAsUser(any(), anyInt(), in getResolversForIntent_usesResultsFromPackageManager()
170 mController = new ResolverListController(mMockContext, mMockPackageManager, in getResolversForIntent_usesResultsFromPackageManager()
193 when(mMockPackageManager.queryIntentActivitiesAsUser(any(), anyInt(), in getResolversForIntent_shouldGetOnlyDefaultActivitiesTrue_addsFlag()
195 mController = new ResolverListController(mMockContext, mMockPackageManager, in getResolversForIntent_shouldGetOnlyDefaultActivitiesTrue_addsFlag()
208 verify(mMockPackageManager).queryIntentActivitiesAsUser(any(), in getResolversForIntent_shouldGetOnlyDefaultActivitiesTrue_addsFlag()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/
DSecurityStateTest.java66 private PackageManager mMockPackageManager; field in SecurityStateTest
80 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp()
84 when(mMockPackageManager.getPackageInfo(anyString(), anyInt())) in setUp()
88 when(mMockPackageManager.getPackageInfo(DEFAULT_MODULE_METADATA_PROVIDER, 0)) in setUp()
92 when(mMockPackageManager.getPackageInfo(DEFAULT_SECURITY_STATE_PACKAGE, 0)) in setUp()
/frameworks/base/services/tests/servicestests/src/com/android/server/rotationresolver/
DRotationResolverManagerPerUserServiceTest.java57 PackageManager mMockPackageManager; field in RotationResolverManagerPerUserServiceTest
70 doReturn(PACKAGE_NAME).when(mMockPackageManager).getRotationResolverPackageName(); in setUp()
71 doReturn(createTestingResolveInfo()).when(mMockPackageManager).resolveServiceAsUser(any(), in setUp()
73 doReturn(mMockPackageManager).when(mContext).getPackageManager(); in setUp()
/frameworks/base/services/tests/servicestests/src/com/android/server/accounts/
DAccountManagerServiceTest.java119 @Mock private PackageManager mMockPackageManager; field in AccountManagerServiceTest
147 when(mMockPackageManager.checkSignatures(anyInt(), anyInt())) in setUp()
153 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp()
160 when(mMockPackageManager.getPackageInfo(anyString(), anyInt())).thenReturn(mPackageInfo); in setUp()
161 when(mMockPackageManager.getPackageInfoAsUser( in setUp()
244 when(mMockPackageManager.getPackagesForUid(anyInt())).thenReturn(list); in testCheckAddAccount()
287 when(mMockPackageManager.getPackagesForUid(anyInt())).thenReturn(list); in testCheckAddAccountLongName()
387 when(mMockPackageManager.getPackagesForUid(anyInt())).thenReturn(list); in testRemovedAccountSync()
432 when(mMockPackageManager.getPackagesForUid(anyInt())).thenReturn(list); in testPreNDatabaseMigration()
670 when(mMockPackageManager.resolveActivityAsUser( in testStartAddAccountSessionReturnWithInvalidIntent()
[all …]
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/wallpapereffectsgeneration/
DWallpaperEffectsGenerationPerUserServiceTest.java56 PackageManager mMockPackageManager; field in WallpaperEffectsGenerationPerUserServiceTest
71 when(mContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp()
72 when(mMockPackageManager.checkPermission(any(), any())) in setUp()
/frameworks/base/services/tests/mockingservicestests/src/com/android/server/app/
DGameServiceProviderSelectorImplTest.java103 private PackageManager mMockPackageManager; field in GameServiceProviderSelectorImplTest
118 when(mMockPackageManager.getResourcesForApplication(anyString())) in setUp()
122 mMockPackageManager); in setUp()
362 .when(mMockPackageManager).queryIntentServicesAsUser( in seedGameServiceResolveInfos()
374 when(mMockPackageManager.getServiceInfo(eq(componentName), anyInt())) in seedServiceServiceInfo()
380 when(mMockPackageManager.getServiceInfo(eq(componentName), anyInt())) in seedServiceServiceInfoNotFound()
392 when(mMockPackageManager.getXml(eq(packageName), eq(resId), any())) in seedGameServiceMetaDataFromFile()
DGameManagerServiceTests.java136 private PackageManager mMockPackageManager; field in GameManagerServiceTests
207 return mMockPackageManager; in getPackageManager()
250 reset(mMockPackageManager); in mockAppCategory()
262 when(mMockPackageManager.getApplicationInfoAsUser(eq(packageName), anyInt(), anyInt())) in mockAppCategory()
270 when(mMockPackageManager.getPackageUidAsUser(eq(packageName), anyInt())).thenReturn( in mockAppCategory()
272 when(mMockPackageManager.getPackagesForUid(packageUid)).thenReturn( in mockAppCategory()
275 when(mMockPackageManager.getInstalledPackagesAsUser(anyInt(), anyInt())) in mockAppCategory()
279 when(mMockPackageManager.getResourcesForApplication(anyString())) in mockAppCategory()
388 final ApplicationInfo applicationInfo = mMockPackageManager.getApplicationInfoAsUser( in mockGameModeOptInAll()
396 when(mMockPackageManager.getApplicationInfoAsUser(anyString(), anyInt(), anyInt())) in mockGameModeOptInAll()
[all …]
/frameworks/base/services/tests/servicestests/src/com/android/server/grammaticalinflection/
DGrammaticalInflectionBackupTest.java63 private PackageManager mMockPackageManager; field in GrammaticalInflectionBackupTest
72 null, mGrammaticalInflectionService, mMockPackageManager); in setUp()
136 doReturn(List.of(dummyApp)).when(mMockPackageManager) in mockAppInstalled()
/frameworks/base/services/tests/servicestests/src/com/android/server/audio/
DMusicFxHelperTest.java56 @Mock private PackageManager mMockPackageManager; field in MusicFxHelperTest
109 doReturn(mMockPackageManager).when(mMockContext).getPackageManager(); in openSessionWithResList()
110 doReturn(list).when(mMockPackageManager).queryBroadcastReceivers(anyObject(), anyInt()); in openSessionWithResList()
113 doReturn(uid).when(mMockPackageManager) in openSessionWithResList()
115 doReturn(mMusicFxUid).when(mMockPackageManager) in openSessionWithResList()
138 doReturn(mMockPackageManager).when(mMockContext).getPackageManager(); in closeSessionWithResList()
139 doReturn(list).when(mMockPackageManager).queryBroadcastReceivers(anyObject(), anyInt()); in closeSessionWithResList()
142 doReturn(uid).when(mMockPackageManager) in closeSessionWithResList()
144 doReturn(mMusicFxUid).when(mMockPackageManager) in closeSessionWithResList()
/frameworks/opt/car/services/updatableServices/tests/src/com/android/server/wm/
DCarDisplayCompatActivityInterceptorTest.java73 private PackageManager mMockPackageManager; field in CarDisplayCompatActivityInterceptorTest
96 when(mMockPackageManager.hasSystemFeature(FEATURE_CAR_DISPLAY_COMPATIBILITY)) in setUp()
98 when(mMockPackageManager.resolveActivity(any(Intent.class), any(ResolveInfoFlags.class))) in setUp()
100 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp()
DCarLaunchOnPrivateDisplayActivityInterceptorTest.java78 private PackageManager mMockPackageManager; field in CarLaunchOnPrivateDisplayActivityInterceptorTest
114 when(mMockPackageManager.resolveActivity(any(Intent.class), in setUp()
116 when(mMockContext.getPackageManager()).thenReturn(mMockPackageManager); in setUp()
/frameworks/base/services/tests/wmtests/src/com/android/server/wm/
DActivityStarterTests.java163 private PackageManagerInternal mMockPackageManager; field in ActivityStarterTests
399 mMockPackageManager = mock(PackageManagerInternal.class, in prepareStarter()
403 doReturn(null).when(mMockPackageManager).getDefaultHomeActivity(anyInt()); in prepareStarter()
404 doReturn(mMockPackageManager).when(mAtm).getPackageManagerInternalLocked(); in prepareStarter()
405 doReturn("packageName").when(mMockPackageManager).getNameForUid(anyInt()); in prepareStarter()
406 doReturn(false).when(mMockPackageManager).isInstantAppInstallerComponent(any()); in prepareStarter()
407 doReturn(null).when(mMockPackageManager).resolveIntent(any(), any(), anyLong(), anyLong(), in prepareStarter()
409 doReturn(new ComponentName("", "")).when(mMockPackageManager).getSystemUiServiceComponent(); in prepareStarter()
412 doReturn(false).when(mMockPackageManager).isPermissionsReviewRequired(any(), anyInt()); in prepareStarter()
413 doNothing().when(mMockPackageManager).grantImplicitAccess( in prepareStarter()
[all …]
/frameworks/base/tests/testables/src/android/testing/
DTestableContext.java74 private PackageManager mMockPackageManager; field in TestableContext
111 mMockPackageManager = mock; in setMockPackageManager()
116 if (mMockPackageManager != null) { in getPackageManager()
117 return mMockPackageManager; in getPackageManager()
/frameworks/base/services/tests/servicestests/src/com/android/server/accessibility/
DAccessibilitySecurityPolicyTest.java133 private PackageManager mMockPackageManager; field in AccessibilitySecurityPolicyTest
156 mContext.setMockPackageManager(mMockPackageManager); in setUp()
278 when(mMockPackageManager.getPackagesForUid(APP_UID)) in resolveValidReportedPackage_pkgNameIsInvalid_returnFirstCorrectPkgName()
299 when(mMockPackageManager.getPackagesForUid(APP_UID)) in resolveValidReportedPackage_anotherPkgNameWithActAsPkgPermission_returnPkg()
320 when(mMockPackageManager.getPackagesForUid(APP_UID)) in resolveValidReportedPackage_anotherPkgNameWithoutActAsPkgPermission_returnUidPkg()

12