-
Notifications
You must be signed in to change notification settings - Fork 857
Description
The F-Droid version of Element periodically tries to perform a background sync no matter whether a network connection is available or not. To reduce battery usage #536 the background sync should be stopped when no network connection is available. As far as I can see there are at least two ways to achieve this:
-
Using aEdit: APeriodicWorkRequestwithNetworkType.CONNECTEDas constraint. https://developer.android.com/topic/libraries/architecture/workmanager/how-to/define-workPeriodicWorkRequestcannot run more often then every 15 minutes. -
Using a
ConnectivityManager.NetworkCallbackto be informed when a network connection is available or a network connection is lost. https://developer.android.com/reference/android/net/ConnectivityManager.NetworkCallback