Home
last modified time | relevance | path

Searched refs:mMockPm (Results 1 – 10 of 10) sorted by relevance

/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/system/legal/
DLegalPreferenceControllerTestCase.java77 private PackageManager mMockPm; field in LegalPreferenceControllerTestCase
84 when(mContext.getPackageManager()).thenReturn(mMockPm); in setUp()
105 when(mMockPm.queryIntentActivities(any(Intent.class), anyInt())) in getAvailabilityStatus_systemApp_shouldReturnAvailable()
117 when(mMockPm.queryIntentActivities(any(Intent.class), anyInt())) in getAvailabilityStatus_systemApp_shouldReturnAvailable_zoneWrite()
129 when(mMockPm.queryIntentActivities(any(Intent.class), anyInt())) in getAvailabilityStatus_systemApp_shouldReturnAvailable_zoneRead()
141 when(mMockPm.queryIntentActivities(any(Intent.class), anyInt())) in getAvailabilityStatus_systemApp_shouldReturnAvailable_zoneHidden()
152 when(mMockPm.queryIntentActivities(any(Intent.class), anyInt())) in getAvailabilityStatus_notSystemApp_shouldReturnUnsupported()
157 when(mMockPm.queryIntentActivities(any(Intent.class), anyInt())).thenReturn(null); in getAvailabilityStatus_notSystemApp_shouldReturnUnsupported()
167 when(mMockPm.queryIntentActivities(any(Intent.class), anyInt())) in getAvailabilityStatus_notSystemApp_shouldReturnUnsupported_zoneWrite()
172 when(mMockPm.queryIntentActivities(any(Intent.class), anyInt())).thenReturn(null); in getAvailabilityStatus_notSystemApp_shouldReturnUnsupported_zoneWrite()
[all …]
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/system/
DBluetoothMacAddressPreferenceControllerTest.java61 private PackageManager mMockPm; field in BluetoothMacAddressPreferenceControllerTest
72 when(mContext.getPackageManager()).thenReturn(mMockPm); in setUp()
83 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(true); in onCreate_setsAddress()
92 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(false); in getAvailabilityStatus_featureBluetooth_unsupportedOnDevice()
100 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(false); in getAvailabilityStatus_featureBluetooth_unsupportedOnDevice_zoneWrite()
109 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(false); in getAvailabilityStatus_featureBluetooth_unsupportedOnDevice_zoneRead()
118 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(false); in getAvailabilityStatus_featureBluetooth_unsupportedOnDevice_zoneHidden()
127 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(true); in getAvailabilityStatus_enableDefaultAdapter_availableForViewing()
135 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(true); in getAvailabilityStatus_enableDefaultAdapter_availableForViewing_zoneWrite()
144 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(true); in getAvailabilityStatus_enableDefaultAdapter_availableForViewing_zoneRead()
[all …]
DResetAppPrefFragmentTest.java85 private PackageManager mMockPm; field in ResetAppPrefFragmentTest
119 when(mContext.getPackageManager()).thenReturn(mMockPm); in setUp()
123 when(mMockPm.getInstalledApplications(anyInt())).thenReturn(mAppInfoList); in setUp()
148 when(mMockPm.getApplicationEnabledSetting(ENABLED_PKG_NAME)) in resetClicked_appEnabled_doesNotEnable()
153 verify(mMockPm, never()).setApplicationEnabledSetting(ENABLED_PKG_NAME, in resetClicked_appEnabled_doesNotEnable()
160 when(mMockPm.getApplicationEnabledSetting(DISABLED_PKG_NAME)) in resetClicked_appDisabled_doesEnable()
165 verify(mMockPm).setApplicationEnabledSetting(DISABLED_PKG_NAME, in resetClicked_appDisabled_doesEnable()
DResetNetworkItemsPreferenceControllerTest.java55 private PackageManager mMockPm; field in ResetNetworkItemsPreferenceControllerTest
64 when(mContext.getPackageManager()).thenReturn(mMockPm); in setUp()
136 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_WIFI)).thenReturn(hasWifi); in setSystemFeatures()
137 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)).thenReturn(hasTelephony); in setSystemFeatures()
138 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_BLUETOOTH)).thenReturn(hasBluetooth); in setSystemFeatures()
DResetNetworkSubscriptionPreferenceControllerTest.java81 private PackageManager mMockPm; field in ResetNetworkSubscriptionPreferenceControllerTest
93 when(mContext.getPackageManager()).thenReturn(mMockPm); in setUp()
95 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)).thenReturn(true); in setUp()
152 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)).thenReturn(false); in getAvailabilityStatus_telephonyNotAvailable_unsupportedOnDevice()
159 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)).thenReturn(false); in getAvailabilityStatus_telephonyNotAvailable_unsupportedOnDevice_zoneWrite()
168 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)).thenReturn(false); in getAvailabilityStatus_telephonyNotAvailable_unsupportedOnDevice_zoneRead()
177 when(mMockPm.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)).thenReturn(false); in getAvailabilityStatus_telephonyNotAvailable_unsupportedOnDevice_zoneHidden()
DSystemUpdatePreferenceControllerTest.java83 private PackageManager mMockPm; field in SystemUpdatePreferenceControllerTest
97 when(mContext.getPackageManager()).thenReturn(mMockPm); in setUp()
197 when(mMockPm.queryIntentActivities(eq(intent), anyInt())).thenReturn( in onCreate_setsActivityLabelAsTitle()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/applications/
DInstalledAppCountItemManagerTest.java52 private PackageManager mMockPm; field in InstalledAppCountItemManagerTest
73 when(mContext.getPackageManager()).thenReturn(mMockPm); in isSystemApp_userCanOpen_isCounted()
74 when(mMockPm.queryIntentActivitiesAsUser(any(), anyInt(), anyInt())).thenReturn(intents); in isSystemApp_userCanOpen_isCounted()
83 when(mContext.getPackageManager()).thenReturn(mMockPm); in isSystemApp_userCannotOpen_isNotCounted()
84 when(mMockPm.queryIntentActivitiesAsUser(any(), anyInt(), anyInt())).thenReturn(intents); in isSystemApp_userCannotOpen_isNotCounted()
DApplicationActionButtonsPreferenceControllerTest.java112 private PackageManager mMockPm; field in ApplicationActionButtonsPreferenceControllerTest
202 when(mMockPm.getHomeActivities(anyList())).then(invocation -> { in onCreate_bundledApp_homePackage_disablesDisableButton()
305 when(mMockPm.getHomeActivities(anyList())).then(invocation -> { in onStart_noDefaultHome_onlyHomeApp_disablesUninstallButton()
331 when(mMockPm.getHomeActivities(anyList())).then(invocation -> { in onStart_noDefaultHome_multipleHomeApps_enablesUninstallButton()
357 when(mMockPm.getHomeActivities(anyList())).then(invocation -> { in onStart_defaultHomeApp_disablesUninstallButton()
621 verify(mMockPm).setApplicationEnabledSetting(PACKAGE_NAME, in disableDialogConfirmed_disablesPackage()
638 verify(mMockPm, never()).setApplicationEnabledSetting(PACKAGE_NAME, in disableClicked_showsDisabledByDeviceAdminDialog()
651 verify(mMockPm).setApplicationEnabledSetting(PACKAGE_NAME, in enableClicked_enablesPackage()
668 verify(mMockPm, never()).setApplicationEnabledSetting(PACKAGE_NAME, in enableClicked_showsDisabledByDeviceAdminDialog()
785 when(mContext.getPackageManager()).thenReturn(mMockPm); in setMocks()
[all …]
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/bluetooth/
DPairNewDevicePreferenceControllerUnitTest.java82 private PackageManager mMockPm; field in PairNewDevicePreferenceControllerUnitTest
169 when(mContext.getPackageManager()).thenReturn(mMockPm); in preferenceClicked_triggersCustomPairingFlow_whenSystemApplicationIsFound()
179 when(mMockPm.queryIntentActivities(eq(intent), anyInt())).thenReturn( in preferenceClicked_triggersCustomPairingFlow_whenSystemApplicationIsFound()
207 when(mContext.getPackageManager()).thenReturn(mMockPm); in preferenceClicked_triggersDefaultPairingFlow_whenNoMatchingApplicationsFound()
208 when(mMockPm.queryIntentActivities(eq(intent), anyInt())).thenReturn( in preferenceClicked_triggersDefaultPairingFlow_whenNoMatchingApplicationsFound()
222 when(mContext.getPackageManager()).thenReturn(mMockPm); in preferenceClicked_triggersDefaultPairingFlow_whenNonSystemApplicationIsFound()
232 when(mMockPm.queryIntentActivities(eq(intent), anyInt())).thenReturn( in preferenceClicked_triggersDefaultPairingFlow_whenNonSystemApplicationIsFound()
/packages/apps/Car/Settings/tests/unit/src/com/android/car/settings/storage/
DStorageApplicationActionButtonsPreferenceControllerTest.java90 private PackageManager mMockPm; field in StorageApplicationActionButtonsPreferenceControllerTest
120 mPreferenceController.setPackageManager(mMockPm); in setUp()
188 doNothing().when(mMockPm).deleteApplicationCacheFiles(anyString(), any()); in handleClearCacheClick_disallowedBySystem_shouldNotDeleteApplicationCache()
200 verify(mMockPm, never()).deleteApplicationCacheFiles(anyString(), any()); in handleClearCacheClick_disallowedBySystem_shouldNotDeleteApplicationCache()
212 doNothing().when(mMockPm).deleteApplicationCacheFiles(anyString(), any()); in handleClearCacheClick_allowedBySystem_shouldNotDeleteApplicationCache()
224 verify(mMockPm).deleteApplicationCacheFiles(anyString(), any()); in handleClearCacheClick_allowedBySystem_shouldNotDeleteApplicationCache()
285 when(mMockPm.resolveActivity(any(Intent.class), eq(0))).thenReturn(new ResolveInfo()); in handleClearDataClick_hasValidManageSpaceActivity_shouldNotShowDialogToClear()
314 when(mMockPm.resolveActivity(any(Intent.class), eq(0))).thenReturn(null); in handleClearDataClick_hasInvalidManageSpaceActivity_shouldShowDialogToClear()