Battery drain / cpu sleep
From the following of SFOS on my Nexus 4, I have seen only msyncd (from buteo packages) to cause the condition at which the phone is not sleeping for longer periods of time. So, if you wish to debug your battery drain issues, you could test as follows:
Use the SysMon unofficial (
https://openrepos.net/content/rinigus/system-monitor-unofficial-edition or
https://github.com/rinigus/harbour-systemmonitor) or check periodically with mcetool whether your phone CPU goes into deep sleep. mcetool should be relatively recent for this.
When not in sleep for an hour or more, its good to investigate the reason. For that, run wakelock.py (attached) in the terminal (or inspect /proc/wakelocks for wakelocks that are active manually). wakelock.py would check /proc/wakelocks for you and list the wakelocks that have been active for all time period between the checks (marked by *** in the beginnig of corresponding wakelock). The scripts sorts wakelocks according to the activity with the most active ones listed LAST (so it's easy to check it in the terminal). The script sleeps for 2 minutes between the checks and, if all is OK and phone sleeps as well, these 2 minutes can take significantly longer. Don't be alarmed, its a sign of the phone sleeping. When sleep is blocked, it will be refreshing every 2 minutes.
The script output would be (for each wakelock): number of times the wakelock has been allocated, number of times per minute the wakelock has been allocated between two last checks (reported as rate), the longest and the current active period of a same wakelock being active as observed by script. If the wakelock is stuck, these times will be increasing (reported in seconds).
If wakelock.py identifies mce_cpu_keepalive as a stuck wakelock (with ***), check the logs and look for the lines like these:
run in devel-su: journalctl | grep mce
...
Jolla mce[571]: modules/cpu-keepalive.c: cka_session_renew(): long session active after 239802 ms; id=359/BlockSuspend-2 name=:1.22 pid=1282 cmd=/usr/bin/msyncd
...
In this example, wakelock was caused by msyncd (from buteo packages). Notice, that in normal operation, it should be followed by
Jolla mce[571]: modules/cpu-keepalive.c: cka_session_finish(): long session lasted 655828 ms; id=318/BlockSuspend-2 name=:1.22 pid=1282 cmd=/usr/bin/msyncd
If its not then you have the same problem as me.
Please, when reporting, specify which accounts do you have (google, caldav, carddav, ...). The list is under Settings/Accounts.
I wouldn't be surprised if the issue is general SFOS one and its just more visible in N4 port. Its possible that N4 has the same bug as in
https://together.jolla.com/question/126892/release-notes-201taalojarvi-released/ : Google contact sync may sometimes hang up and drain the battery . If true, for me, "sometimes" is 1-2 times a day for me. By reboot of the phone (maybe just some services would do) you could get the phone to sleep again.
There is a possibility that the issue has been resolved in newer buteo versions and I just don't know it.