use of com.android.internal.widget.LockscreenCredential in project android_packages_apps_Settings by omnirom.
the class CryptKeeperSettings method onActivityResult.
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode != KEYGUARD_REQUEST) {
return;
}
// confirmation prompt; otherwise, go back to the initial state.
if (resultCode == Activity.RESULT_OK && data != null) {
int type = data.getIntExtra(ChooseLockSettingsHelper.EXTRA_KEY_TYPE, -1);
LockscreenCredential password = data.getParcelableExtra(ChooseLockSettingsHelper.EXTRA_KEY_PASSWORD);
if (password != null && !password.isNone()) {
showFinalConfirmation(type, password.getCredential());
}
}
}
use of com.android.internal.widget.LockscreenCredential in project android_packages_apps_Settings by omnirom.
the class ChooseLockPatternTest 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.internal.widget.LockscreenCredential in project android_packages_apps_Settings by omnirom.
the class ChooseLockPatternTest method intentBuilder_setPattern_shouldAddExtras.
@Test
public void intentBuilder_setPattern_shouldAddExtras() {
Intent intent = new IntentBuilder(application).setPattern(createPattern("1234")).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(createPattern("1234"));
assertWithMessage("EXTRA_USER_ID").that(intent.getIntExtra(Intent.EXTRA_USER_ID, 0)).isEqualTo(123);
}
use of com.android.internal.widget.LockscreenCredential 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.internal.widget.LockscreenCredential 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