Hide keep alive option

This commit is contained in:
M66B
2020-11-18 08:25:20 +01:00
parent bcbdf6dfdb
commit 42f27ccf03
2 changed files with 17 additions and 9 deletions

View File

@@ -89,15 +89,6 @@ 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", false);
System.setProperty("fairemail.tcp_keep_alive", Boolean.toString(tcp_keep_alive));
} catch (Throwable ex) {
Log.e(ex);
}
prefs.registerOnSharedPreferenceChangeListener(this);
prev = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
@@ -123,6 +114,15 @@ public class ApplicationEx extends Application implements SharedPreferences.OnSh
upgrade(this);
try {
boolean tcp_keep_alive = prefs.getBoolean("tcp_keep_alive", false);
System.setProperty("fairemail.tcp_keep_alive", Boolean.toString(tcp_keep_alive));
} catch (Throwable ex) {
Log.e(ex);
}
prefs.registerOnSharedPreferenceChangeListener(this);
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O)
NotificationHelper.createNotificationChannels(this);
@@ -384,6 +384,8 @@ public class ApplicationEx extends Application implements SharedPreferences.OnSh
editor.putBoolean("beige", false);
} else if (version < 1385)
editor.remove("parse_classes");
else if (version < 1401)
editor.remove("tcp_keep_alive");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && !BuildConfig.DEBUG)
editor.remove("background_service");