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)
| 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. |
no test coverage detected