Search in sources :

Example 41 with ListPreference

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);
}
Also used : ListPreference(androidx.preference.ListPreference)

Example 42 with ListPreference

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));
}
Also used : ListPreference(androidx.preference.ListPreference)

Example 43 with ListPreference

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;
}
Also used : ListPreference(androidx.preference.ListPreference)

Example 44 with ListPreference

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));
    }
}
Also used : ListPreference(androidx.preference.ListPreference)

Example 45 with ListPreference

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)]);
}
Also used : ListPreference(androidx.preference.ListPreference)

Aggregations

ListPreference (androidx.preference.ListPreference)170 Test (org.junit.Test)24 Before (org.junit.Before)23 Preference (androidx.preference.Preference)20 EditTextPreference (androidx.preference.EditTextPreference)10 PreferenceScreen (androidx.preference.PreferenceScreen)10 SwitchPreference (androidx.preference.SwitchPreference)9 Context (android.content.Context)8 ContentResolver (android.content.ContentResolver)7 Intent (android.content.Intent)7 PersistableBundle (android.os.PersistableBundle)6 MultiSelectListPreference (androidx.preference.MultiSelectListPreference)6 Resources (android.content.res.Resources)5 Bundle (android.os.Bundle)5 RemoteException (android.os.RemoteException)5 RestrictionEntry (android.content.RestrictionEntry)4 OverlayInfo (android.content.om.OverlayInfo)4 ApplicationInfo (android.content.pm.ApplicationInfo)4 PackageInfo (android.content.pm.PackageInfo)4 WifiConfiguration (android.net.wifi.WifiConfiguration)4