My sync adapter does work perfectly well except for one little thing which bugs the sh*t out of me for the last few hours... For my app i want the sync adapter to run with a
It seems to be that it is not possible to add a period sync with an interval lesser than 60 seconds. (Or least from 4.4 and higher.)
https://android.googlesource.com/platform/frameworks/base/+/kitkat-mr1-release/services/java/com/android/server/content/ContentService.java
if (request.isPeriodic()) {
mContext.enforceCallingOrSelfPermission(
Manifest.permission.WRITE_SYNC_SETTINGS,
"no permission to write the sync settings");
if (runAtTime < 60) {
Slog.w(TAG, "Requested poll frequency of " + runAtTime
+ " seconds being rounded up to 60 seconds.");
runAtTime = 60;
}
PeriodicSync syncToAdd =
new PeriodicSync(account, provider, extras, runAtTime, flextime);
getSyncManager().getSyncStorageEngine().addPeriodicSync(syncToAdd, userId);
}