Force update network state

This commit is contained in:
M66B
2021-01-16 11:28:08 +01:00
parent dcf30b7c32
commit c8f653ef95

View File

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