use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.
the class ChooseLockGenericTest method updatePreferencesOrFinish_footerPreferenceAddedNoneComplexityText.
@Test
public void updatePreferencesOrFinish_footerPreferenceAddedNoneComplexityText() {
ShadowStorageManager.setIsFileEncryptedNativeOrEmulated(false);
Intent intent = new Intent().putExtra(EXTRA_KEY_CALLER_APP_NAME, "app name").putExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY, PASSWORD_COMPLEXITY_NONE);
initActivity(intent);
CharSequence expectedTitle = mActivity.getString(R.string.unlock_footer_none_complexity_requested, "app name");
mFragment.updatePreferencesOrFinish(/* isRecreatingActivity= */
false);
FooterPreference footer = mFragment.findPreference(KEY_LOCK_SETTINGS_FOOTER);
assertThat(footer.getTitle()).isEqualTo(expectedTitle);
}
use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.
the class ChooseLockGenericTest method updatePreferencesOrFinish_footerPreferenceAddedHighComplexityText.
@Test
public void updatePreferencesOrFinish_footerPreferenceAddedHighComplexityText() {
ShadowStorageManager.setIsFileEncryptedNativeOrEmulated(false);
Intent intent = new Intent().putExtra(EXTRA_KEY_CALLER_APP_NAME, "app name").putExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY, PASSWORD_COMPLEXITY_HIGH);
initActivity(intent);
CharSequence expectedTitle = mActivity.getString(R.string.unlock_footer_high_complexity_requested, "app name");
mFragment.updatePreferencesOrFinish(false);
FooterPreference footer = mFragment.findPreference(KEY_LOCK_SETTINGS_FOOTER);
assertThat(footer.getTitle()).isEqualTo(expectedTitle);
}
use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.
the class ChooseLockGenericTest method updatePreferencesOrFinish_footerPreferenceAddedLowComplexityText.
@Test
public void updatePreferencesOrFinish_footerPreferenceAddedLowComplexityText() {
ShadowStorageManager.setIsFileEncryptedNativeOrEmulated(false);
Intent intent = new Intent().putExtra(EXTRA_KEY_CALLER_APP_NAME, "app name").putExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY, PASSWORD_COMPLEXITY_LOW);
initActivity(intent);
CharSequence expectedTitle = mActivity.getString(R.string.unlock_footer_low_complexity_requested, "app name");
mFragment.updatePreferencesOrFinish(false);
FooterPreference footer = mFragment.findPreference(KEY_LOCK_SETTINGS_FOOTER);
assertThat(footer.getTitle()).isEqualTo(expectedTitle);
}
use of com.android.settingslib.widget.FooterPreference in project android_packages_apps_Settings by omnirom.
the class ChooseLockGenericTest method updatePreferencesOrFinish_ComplexityIsReadFromDPM.
@Test
public void updatePreferencesOrFinish_ComplexityIsReadFromDPM() {
ShadowStorageManager.setIsFileEncryptedNativeOrEmulated(false);
ShadowLockPatternUtils.setRequiredPasswordComplexity(PASSWORD_COMPLEXITY_HIGH);
initActivity(null);
mFragment.updatePreferencesOrFinish(false);
FooterPreference footer = mFragment.findPreference(KEY_LOCK_SETTINGS_FOOTER);
assertThat(footer.getTitle()).isEqualTo(null);
Intent intent = mFragment.getLockPasswordIntent(PASSWORD_QUALITY_COMPLEX);
assertThat(intent.getIntExtra(ChooseLockPassword.EXTRA_KEY_MIN_COMPLEXITY, PASSWORD_COMPLEXITY_NONE)).isEqualTo(PASSWORD_COMPLEXITY_HIGH);
}
Aggregations