mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-06 09:03:56 +02:00
Force update network state
This commit is contained in:
@@ -266,11 +266,6 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
start(current, current.accountState.isEnabled(current.enabled), false);
|
||||
}
|
||||
} else {
|
||||
TupleAccountNetworkState prev = accountStates.get(index);
|
||||
Core.State state = coreStates.get(current.accountState.id);
|
||||
if (state != null)
|
||||
state.setNetworkState(current.networkState);
|
||||
|
||||
boolean reload = false;
|
||||
boolean sync = current.command.getBoolean("sync", false);
|
||||
boolean force = current.command.getBoolean("force", false);
|
||||
@@ -280,6 +275,16 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
|
||||
break;
|
||||
}
|
||||
|
||||
if (reload && force) {
|
||||
Log.i("### update network state " + current);
|
||||
current.networkState = ConnectionHelper.getNetworkState(ServiceSynchronize.this);
|
||||
}
|
||||
|
||||
TupleAccountNetworkState prev = accountStates.get(index);
|
||||
Core.State state = coreStates.get(current.accountState.id);
|
||||
if (state != null)
|
||||
state.setNetworkState(current.networkState);
|
||||
|
||||
accountStates.remove(index);
|
||||
|
||||
// Some networks disallow email server connections:
|
||||
|
||||
Reference in New Issue
Block a user