Sync from IntentService.

Set sync timeouts and add testcase for it.