mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-06 11:39:49 +00:00
Small improvement
This commit is contained in:
parent
df891acc75
commit
9db9d1cd0b
2 changed files with 6 additions and 3 deletions
|
@ -136,7 +136,7 @@ public class ApplicationEx extends Application
|
||||||
});
|
});
|
||||||
|
|
||||||
if (BuildConfig.DEBUG &&
|
if (BuildConfig.DEBUG &&
|
||||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && false) {
|
||||||
StrictMode.VmPolicy policy = new StrictMode.VmPolicy.Builder(StrictMode.getVmPolicy())
|
StrictMode.VmPolicy policy = new StrictMode.VmPolicy.Builder(StrictMode.getVmPolicy())
|
||||||
.detectNonSdkApiUsage()
|
.detectNonSdkApiUsage()
|
||||||
.penaltyListener(getMainExecutor(), new StrictMode.OnVmViolationListener() {
|
.penaltyListener(getMainExecutor(), new StrictMode.OnVmViolationListener() {
|
||||||
|
@ -204,7 +204,10 @@ public class ApplicationEx extends Application
|
||||||
|
|
||||||
try {
|
try {
|
||||||
boolean tcp_keep_alive = prefs.getBoolean("tcp_keep_alive", false);
|
boolean tcp_keep_alive = prefs.getBoolean("tcp_keep_alive", false);
|
||||||
|
if (tcp_keep_alive)
|
||||||
System.setProperty("fairemail.tcp_keep_alive", Boolean.toString(tcp_keep_alive));
|
System.setProperty("fairemail.tcp_keep_alive", Boolean.toString(tcp_keep_alive));
|
||||||
|
else
|
||||||
|
System.clearProperty("fairemail.tcp_keep_alive");
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,11 +286,11 @@ public class FragmentOptionsConnection extends FragmentBase implements SharedPre
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||||
try {
|
try {
|
||||||
|
prefs.edit().putBoolean("tcp_keep_alive", checked).apply();
|
||||||
if (checked)
|
if (checked)
|
||||||
System.setProperty("fairemail.tcp_keep_alive", Boolean.toString(checked));
|
System.setProperty("fairemail.tcp_keep_alive", Boolean.toString(checked));
|
||||||
else
|
else
|
||||||
System.clearProperty("fairemail.tcp_keep_alive");
|
System.clearProperty("fairemail.tcp_keep_alive");
|
||||||
prefs.edit().putBoolean("tcp_keep_alive", checked).apply();
|
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue