Force update network state

pull/191/head
M66B 4 years ago
parent dcf30b7c32
commit c8f653ef95

@ -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:

Loading…
Cancel
Save