Ok, I’ve pushed the investigation forward. time_daemon and TimeService.apk are included in the build, as well as calling time_daemon restore on the init.qcom.rc (boot process). So, why are they not working?
I took a look at the system apps list and, surprise, TimeService (com.qualcomm.timeservice) is not installed. WTF! But it is on the system! Check it, /system/app/TimeService/TimeService.apk!
So I tried to debug by installing it manually. I opened Termux, and ran:
$ su
# pm install /system/app/TimeService/TimeService.apk
pkg: /system/app/TimeService/TimeService.apk
Failure [INSTALL_FAILED_SHARED_USER_INCOMPATIBLE]
¡Ahá! There’s the problem. A permission/signing key issue. But I cannot investigate further because, as you now, closed source code is not reviewable (I can’t see what the AndroidManifest.xml says, ). All this Qcom time thingies are part of the FP2 blobs.
PD: there’s useful Android permissions information at /data/system/packages.xml, FYI. Time info seems to be saved on a binary file at /data/time/ats_13
I don’t won’t to follow the workaround with the non open spource app as well.
But the issue is there and I think it very annoying (especially while setting up a phone).
E.g.
certificate issue with e-MailI-providers and K9-Mail (any possibility to tell K9 to wait a bit before trying to get new mails the first time after reboot)
I would like to go on using my Pebble (/“Fibit”) Smartwatch (as long as it still works ) but the watch switch to factory mode because of this issue after each reboot.
For me it feels like that it takes about half a minut until the time is corrected.
Many Thanks for the solution. I have successfully quickfixed the problem without using the closed source app Clock_Offset_Fix_2.2.apk like you mentioned in your later post https://forum.fairphone.com/t/fp-open-os-clock-resets-after-reboot/17635/70.
Here is my short description for building the two necessary scripts manually as alternative to the second point of your description:
Alternative replacement of second point (“Open the “Clock Offset Fix” app …”):
For the technically inclined (and as diverse approaches have been discussed in this thread), can you give some insight on how this was fixed? (Maybe with a link to the relevant source changes.) That’d be much appreciated.
I’ll ask the devs. If it is not to much work, I am sure they will post it here. But it might be a while because they are really, seriously very busy at the moment.
22.02.2017
Updated the phone to security patch 05.01.2017
23.02.2017, 09:22
Turned off wifi
Turned off cell data
Turned off phone
Took out battery
Wait 5 seconds
Put battery back in
Start phone
Boot successful
aaaand:
@%&#!
EDIT 23.02.2017 09:57
Turn off wifi
Turn off cell data
Reboot without taking out the battery It works!
Learning: Clock forgets time if you take out the phone battery and cannot get it from the cell network. Clock requires an internet connection to set itself automatically."
My first phone was an Ericsson SH-888, from 1998, I believe. It was able to set its clock just by network radio.
It’s fixed for me now on 17.02. I skipped 17.01 because my FP2 was headless and lying in my furniture.
I guess they fixed the certificate/permissions issue I looked into some time ago. The app package was one of the Qualcomm’s blobs, so they might had to contact them (as blobs are closed-source). I don’t know.