updating background sync function docs with more information

This commit is contained in:
Adam Brown 2021-10-22 10:49:36 +01:00
parent 56d5a38e80
commit c14ffefe7c
2 changed files with 7 additions and 5 deletions

View file

@ -120,9 +120,11 @@ interface Session :
fun requireBackgroundSync()
/**
* Launches infinite self rescheduling background syncs
* This does not work in doze mode :/
* If battery optimization is on it can work in app standby but that's all :/
* Launches infinite self rescheduling background syncs via the WorkManager
*
* While dozing, syncs will only occur during maintenance windows
* For reliability it's recommended to also start a long running foreground service
* along with disabling battery optimizations
*/
fun startAutomaticBackgroundSync(timeOutInSeconds: Long, repeatDelayInSeconds: Long)

View file

@ -25,8 +25,8 @@ import timber.log.Timber
import javax.inject.Inject
/**
* This no-op foreground service acts as a deterrent for the system
* to avoid eagerly killing the app process.
* This no-op foreground service acts as a deterrent to the system eagerly killing the app process.
*
* Keeping the app process alive avoids some OEMs ignoring scheduled WorkManager and AlarmManager tasks
* when the app is not in the foreground.
*/