Implemented option to only use WiFi

This commit is contained in:
2015-12-27 20:04:17 +01:00
parent 1c5aed0f6c
commit fdc2277324
8 changed files with 110 additions and 25 deletions

View File

@ -52,12 +52,15 @@ public class SyncAdapter extends AbstractThreadedSyncAdapter {
@Override
public void onPerformSync(Account account, Bundle extras, String authority,
ContentProviderClient provider, SyncResult syncResult) {
if (account.equals(Authenticator.ACCOUNT_SYNC))
syncData();
else if (account.equals(Authenticator.ACCOUNT_POW))
if (account.equals(Authenticator.ACCOUNT_SYNC)) {
if (Preferences.isConnectionAllowed(getContext())) {
syncData();
}
} else if (account.equals(Authenticator.ACCOUNT_POW)) {
syncPOW();
else
} else {
throw new RuntimeException("Unknown " + account);
}
}
private void syncData() {