Search in sources :

Example 31 with IntentBuilder

use of com.android.settings.password.ChooseLockPassword.IntentBuilder in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ChooseLockPasswordTest method setActivityAndGetIconDrawable.

private ShadowDrawable setActivityAndGetIconDrawable(boolean addFingerprintExtra) {
    ChooseLockPassword passwordActivity = buildChooseLockPasswordActivity(new IntentBuilder(application).setUserId(UserHandle.myUserId()).setForFingerprint(addFingerprintExtra).build());
    ChooseLockPasswordFragment fragment = getChooseLockPasswordFragment(passwordActivity);
    return Shadows.shadowOf(((GlifLayout) fragment.getView()).getIcon());
}
Also used : IntentBuilder(com.android.settings.password.ChooseLockPassword.IntentBuilder) ChooseLockPasswordFragment(com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment)

Example 32 with IntentBuilder

use of com.android.settings.password.ChooseLockPassword.IntentBuilder in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ChooseLockPasswordTest method intentBuilder_setMinComplexityMedium_hasMinComplexityExtraMedium.

@Test
public void intentBuilder_setMinComplexityMedium_hasMinComplexityExtraMedium() {
    Intent intent = new IntentBuilder(application).setRequestedMinComplexity(PASSWORD_COMPLEXITY_MEDIUM).build();
    assertThat(intent.hasExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY)).isTrue();
    assertThat(intent.getIntExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY, PASSWORD_COMPLEXITY_NONE)).isEqualTo(PASSWORD_COMPLEXITY_MEDIUM);
}
Also used : IntentBuilder(com.android.settings.password.ChooseLockPassword.IntentBuilder) Intent(android.content.Intent) Test(org.junit.Test)

Example 33 with IntentBuilder

use of com.android.settings.password.ChooseLockPassword.IntentBuilder in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class ChooseLockPasswordTest method intentBuilder_setMinComplexityNotCalled.

@Test
public void intentBuilder_setMinComplexityNotCalled() {
    Intent intent = new IntentBuilder(application).build();
    assertThat(intent.hasExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY)).isFalse();
}
Also used : IntentBuilder(com.android.settings.password.ChooseLockPassword.IntentBuilder) Intent(android.content.Intent) Test(org.junit.Test)

Example 34 with IntentBuilder

use of com.android.settings.password.ChooseLockPassword.IntentBuilder in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SetupChooseLockPasswordTest method createActivity_shouldNotCrash.

@Test
public void createActivity_shouldNotCrash() {
    // Basic sanity test for activity created without crashing
    final Intent intent = SetupChooseLockPassword.modifyIntentForSetup(application, new IntentBuilder(application).build());
    ActivityController.of(new SetupChooseLockPassword(), intent).setup().get();
}
Also used : IntentBuilder(com.android.settings.password.ChooseLockPassword.IntentBuilder) Intent(android.content.Intent) Test(org.junit.Test)

Example 35 with IntentBuilder

use of com.android.settings.password.ChooseLockPassword.IntentBuilder in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class SetupChooseLockPasswordTest method createSetupChooseLockPassword.

private SetupChooseLockPassword createSetupChooseLockPassword() {
    final Intent intent = SetupChooseLockPassword.modifyIntentForSetup(application, new IntentBuilder(application).build());
    intent.putExtra(ChooseLockGenericFragment.EXTRA_SHOW_OPTIONS_BUTTON, true);
    return ActivityController.of(new SetupChooseLockPassword(), intent).setup().get();
}
Also used : IntentBuilder(com.android.settings.password.ChooseLockPassword.IntentBuilder) Intent(android.content.Intent)

Aggregations

IntentBuilder (com.android.settings.password.ChooseLockPassword.IntentBuilder)43 Intent (android.content.Intent)36 Test (org.junit.Test)29 Bundle (android.os.Bundle)7 ChooseLockPasswordFragment (com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment)7 SetupChooseLockPasswordFragment (com.android.settings.password.SetupChooseLockPassword.SetupChooseLockPasswordFragment)7 ShadowActivity (org.robolectric.shadows.ShadowActivity)7 IntentForResult (org.robolectric.shadows.ShadowActivity.IntentForResult)5 LockscreenCredential (com.android.internal.widget.LockscreenCredential)2