Search in sources :

Example 1 with PptpProfile

use of android.net.vpn.PptpProfile in project android_packages_apps_Settings by LineageOS.

the class PptpEditor method createEncryptionPreference.

private Preference createEncryptionPreference(Context c) {
    final PptpProfile profile = (PptpProfile) getProfile();
    CheckBoxPreference encryption = mEncryption = new CheckBoxPreference(c);
    boolean enabled = profile.isEncryptionEnabled();
    setCheckBoxTitle(encryption, R.string.vpn_pptp_encryption_title);
    encryption.setChecked(enabled);
    setEncryptionSummary(encryption, enabled);
    encryption.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {

        public boolean onPreferenceChange(Preference pref, Object newValue) {
            boolean enabled = (Boolean) newValue;
            profile.setEncryptionEnabled(enabled);
            setEncryptionSummary(mEncryption, enabled);
            return true;
        }
    });
    return encryption;
}
Also used : CheckBoxPreference(android.preference.CheckBoxPreference) Preference(android.preference.Preference) CheckBoxPreference(android.preference.CheckBoxPreference) PptpProfile(android.net.vpn.PptpProfile)

Example 2 with PptpProfile

use of android.net.vpn.PptpProfile in project android_packages_apps_Settings by LineageOS.

the class PptpEditor method loadExtraPreferencesTo.

@Override
protected void loadExtraPreferencesTo(PreferenceGroup subpanel) {
    Context c = subpanel.getContext();
    subpanel.addPreference(createEncryptionPreference(c));
    PptpProfile profile = (PptpProfile) getProfile();
}
Also used : Context(android.content.Context) PptpProfile(android.net.vpn.PptpProfile)

Aggregations

PptpProfile (android.net.vpn.PptpProfile)2 Context (android.content.Context)1 CheckBoxPreference (android.preference.CheckBoxPreference)1 Preference (android.preference.Preference)1