use of com.android.internal.widget.LockscreenCredential in project android_packages_apps_Settings by omnirom.
the class ChooseLockGenericTest method testUnifyProfile_IntentPassedToChooseLockPassword.
@Test
public void testUnifyProfile_IntentPassedToChooseLockPassword() {
final Bundle arguments = new Bundle();
arguments.putInt(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_ID, 11);
arguments.putParcelable(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_CREDENTIAL, LockscreenCredential.createNone());
mFragment.setArguments(arguments);
Intent intent = new Intent().putExtra(LockPatternUtils.PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_NUMERIC);
initActivity(intent);
mFragment.updatePreferencesOrFinish(false);
Intent nextIntent = shadowOf(mActivity).getNextStartedActivity();
assertThat(nextIntent).isNotNull();
assertThat(nextIntent.getComponent().getClassName()).isEqualTo(ChooseLockPassword.class.getName());
assertThat(nextIntent.getIntExtra(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_ID, 0)).isEqualTo(11);
assertThat((LockscreenCredential) nextIntent.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 ChooseLockGenericTest method testUnifyProfile_IntentPassedToChooseLockPattern.
@Test
public void testUnifyProfile_IntentPassedToChooseLockPattern() {
final Bundle arguments = new Bundle();
arguments.putInt(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_ID, 13);
arguments.putParcelable(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_CREDENTIAL, LockscreenCredential.createNone());
mFragment.setArguments(arguments);
Intent intent = new Intent().putExtra(LockPatternUtils.PASSWORD_TYPE_KEY, DevicePolicyManager.PASSWORD_QUALITY_SOMETHING);
initActivity(intent);
mFragment.updatePreferencesOrFinish(false);
Intent nextIntent = shadowOf(mActivity).getNextStartedActivity();
assertThat(nextIntent).isNotNull();
assertThat(nextIntent.getComponent().getClassName()).isEqualTo(ChooseLockPattern.class.getName());
assertThat(nextIntent.getIntExtra(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_ID, 0)).isEqualTo(13);
assertThat((LockscreenCredential) nextIntent.getParcelableExtra(ChooseLockSettingsHelper.EXTRA_KEY_UNIFICATION_PROFILE_CREDENTIAL)).isNotNull();
}
Aggregations