Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Account syncing every minute

In my AccountAuthenticatorActivity I try setup sync-options for an Account after addAccountExplicitly with following lines:

ContentResolver.setIsSyncable(account, authority, 1);
ContentResolver.setSyncAutomatically(account, authority, true);
int seconds = getResources().getInteger(R.integer.syncFrequencySeconds);
ContentResolver.addPeriodicSync(account, authority, new Bundle(), seconds);

syncFrequencySeconds is set to 86400 (every 24 hours). But my sync-adapter is still triggered every minute. What am I doing wrong? (sync itselfs works without any problems)

like image 842
oleh Avatar asked Jun 30 '12 08:06

oleh


1 Answers

Solved it myself: the sync-adapter repeats when the SyncResult.stats do not match with the ContentResolver-Operations. As they matched, sync is triggered as expected.

Update: another issue was, that I called ContentResolver.notifyUpdate during sync-operation. removed that, and it was fine.

like image 75
oleh Avatar answered Sep 27 '22 00:09

oleh