Search in sources :

Example 6 with ChooseLockPasswordFragment

use of com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment in project android_packages_apps_Settings by crdroidandroid.

the class ChooseLockPasswordTest method setActivityAndGetIconDrawable.

private ShadowDrawable setActivityAndGetIconDrawable(boolean addFingerprintExtra) {
    ChooseLockPassword passwordActivity = Robolectric.buildActivity(ChooseLockPassword.class, new IntentBuilder(application).setUserId(UserHandle.myUserId()).setForFingerprint(addFingerprintExtra).build()).setup().get();
    ChooseLockPasswordFragment fragment = (ChooseLockPasswordFragment) passwordActivity.getFragmentManager().findFragmentById(R.id.main_content);
    return Shadows.shadowOf(((GlifLayout) fragment.getView()).getIcon());
}
Also used : IntentBuilder(com.android.settings.password.ChooseLockPassword.IntentBuilder) ChooseLockPasswordFragment(com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment)

Example 7 with ChooseLockPasswordFragment

use of com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment 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 8 with ChooseLockPasswordFragment

use of com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment in project android_packages_apps_Settings by omnirom.

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 9 with ChooseLockPasswordFragment

use of com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment in project android_packages_apps_Settings by omnirom.

the class ChooseLockPasswordTest method assertPasswordValidationResultForIntent.

private void assertPasswordValidationResultForIntent(LockscreenCredential userEnteredPassword, Intent intent, String... expectedValidationResult) {
    ChooseLockPassword activity = buildChooseLockPasswordActivity(intent);
    ChooseLockPasswordFragment fragment = getChooseLockPasswordFragment(activity);
    fragment.validatePassword(userEnteredPassword);
    String[] messages = fragment.convertErrorCodeToMessages();
    assertThat(messages).asList().containsExactly(expectedValidationResult);
}
Also used : ChooseLockPasswordFragment(com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment)

Aggregations

ChooseLockPasswordFragment (com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment)9 IntentBuilder (com.android.settings.password.ChooseLockPassword.IntentBuilder)7 Intent (android.content.Intent)1