use of org.robolectric.shadows.ShadowPackageManager in project android_packages_apps_Settings by omnirom.
the class LiveCaptionPreferenceControllerTest method getAvailabilityStatus_noResolveIntent_shouldReturnUnavailable.
@Test
public void getAvailabilityStatus_noResolveIntent_shouldReturnUnavailable() {
final ShadowPackageManager pm = Shadows.shadowOf(RuntimeEnvironment.application.getPackageManager());
pm.setResolveInfosForIntent(LiveCaptionPreferenceController.LIVE_CAPTION_INTENT, Collections.emptyList());
assertThat(mController.getAvailabilityStatus()).isEqualTo(UNSUPPORTED_ON_DEVICE);
}
use of org.robolectric.shadows.ShadowPackageManager in project android_packages_apps_Settings by omnirom.
the class SetupChooseLockPatternTest method chooseLockSaved_shouldEnableRedactionInterstitial.
@Test
public void chooseLockSaved_shouldEnableRedactionInterstitial() {
findFragment(mActivity).onChosenLockSaveFinished(false, null);
ShadowPackageManager spm = Shadows.shadowOf(application.getPackageManager());
ComponentName cname = new ComponentName(application, SetupRedactionInterstitial.class);
final int componentEnabled = spm.getComponentEnabledSettingFlags(cname) & PackageManager.COMPONENT_ENABLED_STATE_ENABLED;
assertThat(componentEnabled).isEqualTo(PackageManager.COMPONENT_ENABLED_STATE_ENABLED);
}
Aggregations