Added option to prefer IPv4

This commit is contained in:
M66B
2020-10-27 13:22:23 +01:00
parent f58182f2a4
commit b051aaf41e
5 changed files with 37 additions and 3 deletions

View File

@@ -58,13 +58,14 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
private SwitchCompat swRoaming;
private SwitchCompat swRlah;
private EditText etTimeout;
private SwitchCompat swPreferIp4;
private SwitchCompat swSslHarden;
private Button btnManage;
private TextView tvConnectionType;
private TextView tvConnectionRoaming;
private final static String[] RESET_OPTIONS = new String[]{
"metered", "download", "roaming", "rlah", "timeout", "ssl_harden"
"metered", "download", "roaming", "rlah", "timeout", "prefer_ip4", "ssl_harden"
};
@Override
@@ -82,6 +83,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
swRoaming = view.findViewById(R.id.swRoaming);
swRlah = view.findViewById(R.id.swRlah);
etTimeout = view.findViewById(R.id.etTimeout);
swPreferIp4 = view.findViewById(R.id.swPreferIp4);
swSslHarden = view.findViewById(R.id.swSslHarden);
btnManage = view.findViewById(R.id.btnManage);
@@ -153,6 +155,13 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
}
});
swPreferIp4.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
prefs.edit().putBoolean("prefer_ip4", checked).apply();
}
});
swSslHarden.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
@@ -266,6 +275,7 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
etTimeout.setText(timeout == 0 ? null : Integer.toString(timeout));
etTimeout.setHint(Integer.toString(EmailService.DEFAULT_CONNECT_TIMEOUT));
swPreferIp4.setChecked(prefs.getBoolean("prefer_ip4", false));
swSslHarden.setChecked(prefs.getBoolean("ssl_harden", false));
}