Added option to enable TCP keep alive

This commit is contained in:
M66B
2020-11-08 20:51:44 +01:00
parent da35152457
commit af01f4173d
6 changed files with 57 additions and 7 deletions

View File

@@ -88,6 +88,14 @@ public class ApplicationEx extends Application implements SharedPreferences.OnSh
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);
final boolean crash_reports = prefs.getBoolean("crash_reports", false);
try {
boolean tcp_keep_alive = prefs.getBoolean("tcp_keep_alive", true);
System.setProperty("fairemail.tcp_keep_alive", Boolean.toString(tcp_keep_alive));
} catch (Throwable ex) {
Log.e(ex);
}
prefs.registerOnSharedPreferenceChangeListener(this);
prev = Thread.getDefaultUncaughtExceptionHandler();