use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class WifiTetherSecurityPreferenceController method updateDisplay.
@Override
public void updateDisplay() {
final WifiConfiguration config = mWifiManager.getWifiApConfiguration();
if (config != null && config.getAuthType() == WifiConfiguration.KeyMgmt.NONE) {
mSecurityValue = WifiConfiguration.KeyMgmt.NONE;
} else {
mSecurityValue = WifiConfiguration.KeyMgmt.WPA2_PSK;
}
final ListPreference preference = (ListPreference) mPreference;
preference.setSummary(getSummaryForSecurityType(mSecurityValue));
preference.setValue(String.valueOf(mSecurityValue));
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GameDriverAppPreferenceControllerTest method onPreferenceChange_selectGAME_DRIVER_shouldUpdateAttributesAndSettingsGlobal.
@Test
public void onPreferenceChange_selectGAME_DRIVER_shouldUpdateAttributesAndSettingsGlobal() {
loadDefaultConfig();
final ListPreference preference = mController.createListPreference(mContext, TEST_PKG_NAME, TEST_APP_NAME);
mController.onPreferenceChange(preference, mValueList[GAME_DRIVER]);
assertThat(preference.getEntry()).isEqualTo(mValueList[GAME_DRIVER]);
assertThat(preference.getValue()).isEqualTo(mValueList[GAME_DRIVER]);
assertThat(preference.getSummary()).isEqualTo(mValueList[GAME_DRIVER]);
assertThat(Settings.Global.getString(mResolver, Settings.Global.GAME_DRIVER_OPT_IN_APPS)).isEqualTo(TEST_PKG_NAME);
assertThat(Settings.Global.getString(mResolver, Settings.Global.GAME_DRIVER_OPT_OUT_APPS)).isEqualTo("");
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GameDriverAppPreferenceControllerTest method createPreference_configPRERELEASE_DRIVER_shouldSetPrereleaseDriverAttributes.
@Test
public void createPreference_configPRERELEASE_DRIVER_shouldSetPrereleaseDriverAttributes() {
loadConfig("", TEST_PKG_NAME, "");
final ListPreference preference = mController.createListPreference(mContext, TEST_PKG_NAME, TEST_APP_NAME);
assertThat(preference.getKey()).isEqualTo(TEST_PKG_NAME);
assertThat(preference.getTitle()).isEqualTo(TEST_APP_NAME);
assertThat(preference.getDialogTitle()).isEqualTo(mDialogTitle);
assertThat(preference.getEntries()).isEqualTo(mValueList);
assertThat(preference.getEntryValues()).isEqualTo(mValueList);
assertThat(preference.getSummary()).isEqualTo(mPreferencePrereleaseDriver);
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GameDriverAppPreferenceControllerTest method createPreference_configSystem_shouldSetSystemAttributes.
@Test
public void createPreference_configSystem_shouldSetSystemAttributes() {
loadConfig("", "", TEST_PKG_NAME);
final ListPreference preference = mController.createListPreference(mContext, TEST_PKG_NAME, TEST_APP_NAME);
assertThat(preference.getKey()).isEqualTo(TEST_PKG_NAME);
assertThat(preference.getTitle()).isEqualTo(TEST_APP_NAME);
assertThat(preference.getDialogTitle()).isEqualTo(mDialogTitle);
assertThat(preference.getEntries()).isEqualTo(mValueList);
assertThat(preference.getEntryValues()).isEqualTo(mValueList);
assertThat(preference.getEntry()).isEqualTo(mValueList[SYSTEM]);
assertThat(preference.getValue()).isEqualTo(mValueList[SYSTEM]);
assertThat(preference.getSummary()).isEqualTo(mValueList[SYSTEM]);
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class GameDriverAppPreferenceControllerTest method createPreference_configGAME_DRIVER_shouldSetGameDriverAttributes.
@Test
public void createPreference_configGAME_DRIVER_shouldSetGameDriverAttributes() {
loadConfig(TEST_PKG_NAME, "", "");
final ListPreference preference = mController.createListPreference(mContext, TEST_PKG_NAME, TEST_APP_NAME);
assertThat(preference.getKey()).isEqualTo(TEST_PKG_NAME);
assertThat(preference.getTitle()).isEqualTo(TEST_APP_NAME);
assertThat(preference.getDialogTitle()).isEqualTo(mDialogTitle);
assertThat(preference.getEntries()).isEqualTo(mValueList);
assertThat(preference.getEntryValues()).isEqualTo(mValueList);
assertThat(preference.getEntry()).isEqualTo(mValueList[GAME_DRIVER]);
assertThat(preference.getValue()).isEqualTo(mValueList[GAME_DRIVER]);
assertThat(preference.getSummary()).isEqualTo(mValueList[GAME_DRIVER]);
}
Aggregations