Fixed FTS when connect unmetered only

pull/208/head
M66B 2 years ago
parent 7e12919862
commit 8dd1ff69ec

@ -291,7 +291,7 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
accounts++; accounts++;
} }
if (current.accountState.synchronize) if (current.accountState.synchronize)
operations += current.accountState.operations; operations += current.getOperations();
long account = current.command.getLong("account", -1); long account = current.command.getLong("account", -1);
if (account > 0 && !current.accountState.id.equals(account)) if (account > 0 && !current.accountState.id.equals(account))

@ -69,6 +69,14 @@ public class TupleAccountNetworkState {
return (this.networkState.isSuitable() && this.accountState.shouldRun(enabled)); return (this.networkState.isSuitable() && this.accountState.shouldRun(enabled));
} }
public int getOperations() {
boolean unmetered = jconditions.optBoolean("unmetered");
if (unmetered && !this.networkState.isUnmetered())
return 0;
return accountState.operations;
}
@Override @Override
public boolean equals(@Nullable Object obj) { public boolean equals(@Nullable Object obj) {
if (obj instanceof TupleAccountNetworkState) { if (obj instanceof TupleAccountNetworkState) {

Loading…
Cancel
Save