Open mcg-matrix opened 4 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.
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:
GET /_matrix/client/r0/sync?timeout=30000&filter=...
to the home-server. The home-server will reply as soon as something happened, latest after 30 seconds (presumably telling the app that nothing has happened).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. :-)