use of com.android.settings.password.ChooseLockPassword.IntentBuilder in project android_packages_apps_Settings by omnirom.
the class ChooseLockPasswordTest method intentBuilder_setProfileToUnify_shouldAddExtras.
@Test
public void intentBuilder_setProfileToUnify_shouldAddExtras() {
Intent intent = new IntentBuilder(application).setProfileToUnify(23, LockscreenCredential.createNone()).build();
assertWithMessage("EXTRA_KEY_UNIFICATION_PROFILE_ID").that(intent.getIntExtra(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_ID, 0)).isEqualTo(23);
assertWithMessage("EXTRA_KEY_UNIFICATION_PROFILE_CREDENTIAL").that((LockscreenCredential) intent.getParcelableExtra(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_CREDENTIAL)).isNotNull();
}
use of com.android.settings.password.ChooseLockPassword.IntentBuilder 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());
}
use of com.android.settings.password.ChooseLockPassword.IntentBuilder in project android_packages_apps_Settings by omnirom.
the class ChooseLockPasswordTest method intentBuilder_setPassword_shouldAddExtras.
@Test
public void intentBuilder_setPassword_shouldAddExtras() {
Intent intent = new IntentBuilder(application).setPassword(LockscreenCredential.createPassword("password")).setPasswordType(DevicePolicyManager.PASSWORD_QUALITY_NUMERIC).setUserId(123).build();
assertWithMessage("EXTRA_KEY_FORCE_VERIFY").that(intent.getBooleanExtra(ChooseLockSettingsHelper.EXTRA_KEY_FORCE_VERIFY, false)).isFalse();
assertWithMessage("EXTRA_KEY_PASSWORD").that((LockscreenCredential) intent.getParcelableExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD)).isEqualTo(LockscreenCredential.createPassword("password"));
assertWithMessage("PASSWORD_TYPE_KEY").that(intent.getIntExtra(PASSWORD_TYPE_KEY, 0)).isEqualTo(DevicePolicyManager.PASSWORD_QUALITY_NUMERIC);
assertWithMessage("EXTRA_USER_ID").that(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).isEqualTo(123);
}
Aggregations