Search in sources :

Example 61 with Tile

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();
}
Also used : Tile(com.android.settingslib.drawer.Tile) Intent(android.content.Intent) Test(org.junit.Test)

Example 62 with Tile

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");
}
Also used : Tile(com.android.settingslib.drawer.Tile) Intent(android.content.Intent) Test(org.junit.Test)

Example 63 with Tile

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;
}
Also used : Tile(com.android.settingslib.drawer.Tile) Intent(android.content.Intent) ComponentName(android.content.ComponentName)

Example 64 with 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();
}
Also used : Tile(com.android.settingslib.drawer.Tile) Test(org.junit.Test)

Example 65 with Tile

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();
}
Also used : Tile(com.android.settingslib.drawer.Tile) Test(org.junit.Test)

Aggregations

Tile (com.android.settingslib.drawer.Tile)506 Test (org.junit.Test)345 Intent (android.content.Intent)160 DashboardCategory (com.android.settingslib.drawer.DashboardCategory)117 Bundle (android.os.Bundle)108 Preference (android.support.v7.preference.Preference)98 ComponentName (android.content.ComponentName)93 ArrayList (java.util.ArrayList)87 Context (android.content.Context)70 ActivityTile (com.android.settingslib.drawer.ActivityTile)50 ProviderTile (com.android.settingslib.drawer.ProviderTile)45 UserHandle (android.os.UserHandle)39 Preference (androidx.preference.Preference)39 RecyclerView (android.support.v7.widget.RecyclerView)31 View (android.view.View)31 Icon (android.graphics.drawable.Icon)30 Activity (android.app.Activity)29 VisibleForTesting (android.support.annotation.VisibleForTesting)29 PackageManager (android.content.pm.PackageManager)25 ViewGroup (android.view.ViewGroup)24