use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by omnirom.
the class SuggestionFeatureProviderImplTest method getSuggestionIdentifier_nullComponent_shouldNotCrash.
@Test
public void getSuggestionIdentifier_nullComponent_shouldNotCrash() {
final Tile suggestion = new Tile();
suggestion.intent = new Intent();
assertThat(mProvider.getSuggestionIdentifier(mContext, suggestion)).isNotEmpty();
}
use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by omnirom.
the class SuggestionFeatureProviderImplTest method getSuggestionIdentifier_samePackage_returnClassName.
@Test
public void getSuggestionIdentifier_samePackage_returnClassName() {
final Tile suggestion = new Tile();
suggestion.intent = new Intent().setClassName(RuntimeEnvironment.application.getPackageName(), "123");
assertThat(mProvider.getSuggestionIdentifier(RuntimeEnvironment.application, suggestion)).isEqualTo("123");
}
use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by omnirom.
the class SuggestionsChecksTest method createFingerprintTile.
private Tile createFingerprintTile() {
final Tile tile = new Tile();
tile.intent = new Intent();
tile.intent.setComponent(new ComponentName(mContext, Settings.FingerprintEnrollSuggestionActivity.class));
return tile;
}
use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by omnirom.
the class SuggestionsChecksTest method testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintAdded.
@Test
public void testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintAdded() {
stubFingerprintSupported(true);
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(true);
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
Tile tile = createFingerprintTile();
assertThat(mSuggestionsChecks.isSuggestionComplete(tile)).isTrue();
}
use of com.android.settingslib.drawer.Tile in project android_packages_apps_Settings by omnirom.
the class SuggestionsChecksTest method testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintDisabled.
@Test
public void testFingerprintEnrollmentIntroductionIsCompleteWhenFingerprintDisabled() {
stubFingerprintSupported(true);
when(mFingerprintManager.hasEnrolledFingerprints()).thenReturn(false);
when(mFingerprintManager.isHardwareDetected()).thenReturn(true);
when(mDevicePolicyManager.getKeyguardDisabledFeatures(any(), anyInt())).thenReturn(DevicePolicyManager.KEYGUARD_DISABLE_FINGERPRINT);
Tile tile = createFingerprintTile();
assertThat(mSuggestionsChecks.isSuggestionComplete(tile)).isTrue();
}
Aggregations