Remember connection state (so you don't have to start a full node whenever you lost your WiFi connection)

This commit is contained in:
2017-05-07 13:39:30 +02:00
parent 5bc1bc2a47
commit 422c7ac803
9 changed files with 37 additions and 27 deletions

View File

@ -71,11 +71,11 @@ public class SyncAdapter extends AbstractThreadedSyncAdapter {
public void onPerformSync(Account account, Bundle extras, String authority,
ContentProviderClient provider, SyncResult syncResult) {
try {
if (account.equals(Authenticator.ACCOUNT_SYNC)) {
if (account.equals(ACCOUNT_SYNC)) {
if (Preferences.isConnectionAllowed(getContext())) {
syncData();
}
} else if (account.equals(Authenticator.ACCOUNT_POW)) {
} else if (account.equals(ACCOUNT_POW)) {
syncPOW();
} else {
syncResult.stats.numAuthExceptions++;