use of com.android.settingslib.widget.FooterPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class BluetoothSwitchPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
mContext = spy(RuntimeEnvironment.application.getApplicationContext());
mFooterPreference = new FooterPreference(mContext);
FakeFeatureFactory.setupForTest();
mController = new BluetoothSwitchPreferenceController(mContext, mRestrictionUtils, mSwitchController, mFooterPreference);
}
use of com.android.settingslib.widget.FooterPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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(FooterPreference.KEY_FOOTER);
assertThat(footer.getTitle()).isEqualTo(expectedTitle);
}
use of com.android.settingslib.widget.FooterPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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(FooterPreference.KEY_FOOTER);
assertThat(footer.getTitle()).isEqualTo(expectedTitle);
}
use of com.android.settingslib.widget.FooterPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
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(FooterPreference.KEY_FOOTER);
assertThat(footer.getTitle()).isEqualTo(expectedTitle);
}
use of com.android.settingslib.widget.FooterPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ChooseLockGenericTest method updatePreferencesOrFinish_footerPreferenceAddedMediumComplexityText.
@Test
public void updatePreferencesOrFinish_footerPreferenceAddedMediumComplexityText() {
ShadowStorageManager.setIsFileEncryptedNativeOrEmulated(false);
Intent intent = new Intent().putExtra(EXTRA_KEY_CALLER_APP_NAME, "app name").putExtra(EXTRA_KEY_REQUESTED_MIN_COMPLEXITY, PASSWORD_COMPLEXITY_MEDIUM);
initActivity(intent);
CharSequence expectedTitle = mActivity.getString(R.string.unlock_footer_medium_complexity_requested, "app name");
mFragment.updatePreferencesOrFinish(false);
FooterPreference footer = mFragment.findPreference(FooterPreference.KEY_FOOTER);
assertThat(footer.getTitle()).isEqualTo(expectedTitle);
}
Aggregations