use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class CdmaSystemSelectPreferenceController method resetCdmaRoamingModeToDefault.
private void resetCdmaRoamingModeToDefault() {
final ListPreference listPreference = (ListPreference) mPreference;
// set the mButtonCdmaRoam
listPreference.setValue(Integer.toString(TelephonyManager.CDMA_ROAMING_MODE_ANY));
// set the Settings.System
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.CDMA_ROAMING_MODE, TelephonyManager.CDMA_ROAMING_MODE_ANY);
// Set the Status
mTelephonyManager.setCdmaRoamingMode(TelephonyManager.CDMA_ROAMING_MODE_ANY);
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PreferredNetworkModePreferenceController method updateState.
@Override
public void updateState(Preference preference) {
super.updateState(preference);
final ListPreference listPreference = (ListPreference) preference;
final int networkMode = getPreferredNetworkMode();
listPreference.setValue(Integer.toString(networkMode));
listPreference.setSummary(getPreferredNetworkModeSummaryResId(networkMode));
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PreferredNetworkModePreferenceController method onPreferenceChange.
@Override
public boolean onPreferenceChange(Preference preference, Object object) {
final int settingsMode = Integer.parseInt((String) object);
if (mTelephonyManager.setPreferredNetworkType(mSubId, settingsMode)) {
Settings.Global.putInt(mContext.getContentResolver(), Settings.Global.PREFERRED_NETWORK_MODE + mSubId, settingsMode);
final ListPreference listPreference = (ListPreference) preference;
listPreference.setSummary(getPreferredNetworkModeSummaryResId(settingsMode));
return true;
}
return false;
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class CdmaSubscriptionPreferenceController method updateState.
@Override
public void updateState(Preference preference) {
super.updateState(preference);
final ListPreference listPreference = (ListPreference) preference;
listPreference.setVisible(getAvailabilityStatus() == AVAILABLE);
final int mode = Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.CDMA_SUBSCRIPTION_MODE, Phone.PREFERRED_CDMA_SUBSCRIPTION);
if (mode != Phone.CDMA_SUBSCRIPTION_UNKNOWN) {
listPreference.setValue(Integer.toString(mode));
}
}
use of androidx.preference.ListPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class ZenRuleCallsPreferenceController method updateFromContactsValue.
private void updateFromContactsValue(Preference preference) {
if (mRule == null || mRule.getZenPolicy() == null) {
return;
}
ListPreference listPreference = (ListPreference) preference;
listPreference.setSummary(mBackend.getContactsCallsSummary(mRule.getZenPolicy()));
final String currentVal = ZenModeBackend.getKeyFromZenPolicySetting(mRule.getZenPolicy().getPriorityCallSenders());
listPreference.setValue(mListValues[getIndexOfSendersValue(currentVal)]);
}
Aggregations