Small improvement

This commit is contained in:
M66B
2023-09-08 19:54:17 +02:00
parent df891acc75
commit 9db9d1cd0b
2 changed files with 6 additions and 3 deletions

View File

@@ -286,11 +286,11 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
@Override
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
try {
prefs.edit().putBoolean("tcp_keep_alive", checked).apply();
if (checked)
System.setProperty("fairemail.tcp_keep_alive", Boolean.toString(checked));
else
System.clearProperty("fairemail.tcp_keep_alive");
prefs.edit().putBoolean("tcp_keep_alive", checked).apply();
} catch (Throwable ex) {
Log.e(ex);
}