Search in sources :

Example 6 with LockscreenCredential

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();
}
Also used : LockscreenCredential(com.android.internal.widget.LockscreenCredential) Bundle(android.os.Bundle) Intent(android.content.Intent) Test(org.junit.Test)

Example 7 with LockscreenCredential

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();
}
Also used : LockscreenCredential(com.android.internal.widget.LockscreenCredential) Bundle(android.os.Bundle) Intent(android.content.Intent) Test(org.junit.Test)

Aggregations

LockscreenCredential (com.android.internal.widget.LockscreenCredential)7 Intent (android.content.Intent)6 Test (org.junit.Test)6 Bundle (android.os.Bundle)2 IntentBuilder (com.android.settings.password.ChooseLockPassword.IntentBuilder)2 IntentBuilder (com.android.settings.password.ChooseLockPattern.IntentBuilder)2