Power consumption increased significantly in the background since the introduction of presence indicator
Environment
- Jami version: 20240308-01
- Device model: Xiaomi Mi 10T Lite
- Android version: 12
- What build you are using: F-Droid
Description
Since recent versions (version 20240308-01), message delivery became much more reliable. However, I've also observed a significant increase in power consumption of Jami background service. In my phone's battery usage statistics page, Jami drains 940 mAh within 3 hours, surpassing every single other applications, even including the ones I was actively using in foreground, the battery life is also much shorter than before, from an average of 5 hours of active usage down to only around 2 hours.
This is observed on both of my Xiaomi phones (different models with different Android versions: 12 and 13).
Steps to reproduce
Can you reproduce the bug: always
- Jami -> Advanced Settings -> Disable Push
- Jami -> Advanced Settings -> Enable Start Jami on startup
- Jami -> Advanced Settings -> Enable Run in background
- Refer to https://dontkillmyapp.com/ for disabling OEM background app killer mechanism
- Use your phone normally
Expected result
Idle consumption would be higher than a typical instant messenger due to the way Jami works, but not by several orders of magnitude.
Observed result
The phone overheats continuously and the battery drains very quickly, it heavily impacts the battery life in both active usage and idle time negatively.
Additional information
I'm not familiar with Jami code base, but one of the thing coming into my mind is this: https://github.com/simplex-chat/simplex-chat/issues/1821 , SimpleX Chat suffers from battery drain as well.
Perhaps the frequency of keep-alive packet and reconnect attempt needs to be reduced, or some talky metadata transfer needs to be deferred and grouped when Jami client isn't on foreground (similar to XMPP).