element-hq / riot-android

A glossy Matrix collaboration client for Android
Apache License 2.0
1.4k stars 394 forks source link

Can you increase the sync timeout (to save energy)? #3470

Open mcg-matrix opened 4 years ago

mcg-matrix commented 4 years ago

I am using Riot.im 0.9.10 installed from F-Droid; it's the latest version currently offered to me for installation.

The app is configured use the "Background Sync Mode" called "Optimized for battery". (The other mode, called "Optimized for real time", doesn't work for me regarding notifications.)

Here's what I have observed:

If the value of the "timeout" argument was configurable in the "Optimized for battery" mode (and the 60-seconds-timeout adjusted accordingly), my phone should instantly use 80% less energy for Matrix while nothing happens: I would set the value to ~179 seconds, and the app would place 1 request instead of 6 for every 3 minutes.

For me, I'd expect zero disadvantages resulting from such change. I admit there's a risk that notifications will arrive with a delay of up to the adjusted 60-seconds-timeout in case of a TCP connection silently gone dead, but I'd be happy to take that small risk. :-)

mcg-matrix commented 3 years ago

If the value of the "timeout" argument was configurable in the "Optimized for battery" mode ...

The Matrix-client app "Element" supports this since its version 1.0.7 brought along vector-im/element-android#2080.

(and the 60-seconds-timeout adjusted accordingly), my phone should instantly use 80% less energy for Matrix while nothing happens ...

After a fix to the 60-seconds-timeout (vector-im/element-android#2169), my phone uses ~50% less energy for running "Element" in version 1.0.11 (with timeout 1777 seconds) compared to before 1.0.7.