diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt index fb425399d0..dfe43aed6f 100644 --- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt +++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/api/session/Session.kt @@ -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) diff --git a/vector/src/fdroid/java/im/vector/app/fdroid/service/GuardService.kt b/vector/src/fdroid/java/im/vector/app/fdroid/service/GuardService.kt index 631efdbc51..612f78eb0b 100644 --- a/vector/src/fdroid/java/im/vector/app/fdroid/service/GuardService.kt +++ b/vector/src/fdroid/java/im/vector/app/fdroid/service/GuardService.kt @@ -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. */