From e997610ef2e1111c758f440d2e4d94ce5ef7667d Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 11 Sep 2020 10:33:20 +0200 Subject: [PATCH] Add documentation from PR description --- .../app/features/settings/BackgroundSyncMode.kt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/vector/src/main/java/im/vector/app/features/settings/BackgroundSyncMode.kt b/vector/src/main/java/im/vector/app/features/settings/BackgroundSyncMode.kt index f266060053..2dcb663fc1 100644 --- a/vector/src/main/java/im/vector/app/features/settings/BackgroundSyncMode.kt +++ b/vector/src/main/java/im/vector/app/features/settings/BackgroundSyncMode.kt @@ -16,9 +16,26 @@ package im.vector.app.features.settings +/** + * Different strategies for Background sync, only applicable to F-Droid version of the app + */ enum class BackgroundSyncMode { + /** + * In this mode background syncs are scheduled via Workers, meaning that the system will have control on the periodicity + * of syncs when battery is low or when the phone is idle (sync will occur in allowed maintenance windows). After completion + * the sync work will schedule another one. + */ FDROID_BACKGROUND_SYNC_MODE_FOR_BATTERY, + + /** + * This mode requires the app to be exempted from battery optimization. Alarms will be launched and will wake up the app + * in order to perform the background sync as a foreground service. After completion the service will schedule another alarm + */ FDROID_BACKGROUND_SYNC_MODE_FOR_REALTIME, + + /** + * The app won't sync in background + */ FDROID_BACKGROUND_SYNC_MODE_DISABLED; companion object {