MCPcopy Create free account
hub / github.com/Odoo-mobile/framework / setSyncPeriodic

Method setSyncPeriodic

src/com/odoo/MainActivity.java:601–613  ·  view source on GitHub ↗

Sets the sync periodic. @param authority the authority @param interval_in_minute the interval_in_minute @param seconds_per_minute the seconds_per_minute @param milliseconds_per_second the milliseconds_per_second

(String authority, long interval_in_minute,
			long seconds_per_minute, long milliseconds_per_second)

Source from the content-addressed store, hash-verified

599 * the milliseconds_per_second
600 */
601 public void setSyncPeriodic(String authority, long interval_in_minute,
602 long seconds_per_minute, long milliseconds_per_second) {
603 Account account = OdooAccountManager.getAccount(this,
604 OEUser.current(mContext).getAndroidName());
605 Bundle extras = new Bundle();
606 this.setAutoSync(authority, true);
607 ContentResolver.setIsSyncable(account, authority, 1);
608 final long sync_interval = interval_in_minute * seconds_per_minute
609 * milliseconds_per_second;
610 ContentResolver.addPeriodicSync(account, authority, extras,
611 sync_interval);
612
613 }
614
615 /**
616 * Cancel sync.

Callers 1

updateSyncSettingsMethod · 0.95

Calls 4

getAccountMethod · 0.95
currentMethod · 0.95
setAutoSyncMethod · 0.95
getAndroidNameMethod · 0.80

Tested by

no test coverage detected