I found another work to adjust this delay (this can lead to other side effects, check the step below carefully)
This is using a combination of ContentObserver and AccountManager api. Following are the steps:
- Register ContentObserver in the contact database.
- Whenever db contacts change, onChange of your contentObserver will be launched. Inside this function, cancel the pending syncRequests, as shown below. `ContentResolver.cancelSync (account, ContactsContract.AUTHORITY);
- Now schedule the synchronization according to the required delay.
The above will have a side effect of allowing ContentObserver to be alive all the time, and this is not recommended.
Sukumar
source share