use of com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment in project android_packages_apps_Settings by LineageOS.
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());
}
use of com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment in project android_packages_apps_Settings by SudaMod.
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());
}
use of com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment in project android_packages_apps_Settings by DirtyUnicorns.
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());
}
use of com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment in project platform_packages_apps_Settings by BlissRoms.
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());
}
use of com.android.settings.password.ChooseLockPassword.ChooseLockPasswordFragment in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ChooseLockPasswordTest method assertPasswordValidationResult.
private void assertPasswordValidationResult(@PasswordComplexity int minComplexity, int passwordType, String userEnteredPassword, String... expectedValidationResult) {
Intent intent = new Intent();
intent.putExtra(CONFIRM_CREDENTIALS, false);
intent.putExtra(PASSWORD_TYPE_KEY, passwordType);
intent.putExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY, minComplexity);
ChooseLockPassword activity = buildChooseLockPasswordActivity(intent);
ChooseLockPasswordFragment fragment = getChooseLockPasswordFragment(activity);
byte[] userEnteredPasswordBytes = userEnteredPassword != null ? userEnteredPassword.getBytes() : null;
int validateResult = fragment.validatePassword(userEnteredPasswordBytes);
String[] messages = fragment.convertErrorCodeToMessages(validateResult);
assertThat(messages).asList().containsExactly((Object[]) expectedValidationResult);
}
Aggregations