FP Open OS: Clock resets after reboot

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, :angry:). 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

7 Likes

@Roboe any news about this?

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 :wink: ) 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.

DAVdroid failing because of invalid certificates is a common issue, too.

Nope, not any news. Eight months later, the bug is still unfixed. FP Open is a second-class citizen, from what we have seen.

Until your phone goes online and checks the time. If you never get online, then your phone is stuck at 1970.

1 Like

Hey, we are aware of this issue and hope to be able to work on a solution soon.
All persons in the team who use FP Open have the same issue…

I can’t say if the fix will come in 17.01 or 17.02, because we have some other stuff that needs to be done first.

Sorry to keep you waiting!

11 Likes

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 …”):
  • create createoffset.sh:
    #!/system/bin/sh
    expr `date +%s` - `cat /sys/class/rtc/rtc0/since_epoch` >> /data/media/rtc_offset
    chmod 644 /data/media/rtc_offset
  • copy to /sdcard1/<whatever_folder_you want>/TWRP/createoffset.sh
  • execute /sdcard1/<whatever_folder_you want>/createoffset.sh only one time (and every time after Hard Reset or Battery Removal)
  • create userinit.sh:
    #!/system/bin/sh
    [[ -f /data/media/rtc_offset ]] && /system/bin/toolbox date -s $(expr `cat /data/media/rtc_offset` + `cat /sys/class/rtc/rtc0/since_epoch` | awk ’ {print strftime("%Y%m%d.%H%M%S",$1)} ’ ) && exit 0
  • copy to /data/local/userinit.sh
  • chmod 755 /data/local/userinit.sh
  • chgrp root /data/local/userinit.sh

P.S.: Nice to hear that the bug will be fixed soon.

1 Like

A post was merged into an existing topic: FP2 - Change date “your fairphone since” lockscreen

2 posts were merged into an existing topic: FP2 - Change date “your fairphone since” lockscreen

This bug should be solved in todays update of Fairphone Open.

6 Likes

Cool, looking forward to that. :smiley: (As of now, it isn’t out yet, is it? The updater doesn’t display that release and I can’t see it on https://code.fairphone.com/projects/fp-osos/user/fairphone-open-source-os-downloads.html either.)

For the technically inclined :nerd: (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.

2 Likes

No hurry, I’m just curious.

3 Likes

It is out now :slight_smile:
https://code.fairphone.com/contentx/2017-02-21_fairphone-open-17.01_release.html

3 Likes

I confirm that. For me this issue is fixed since FP Open OS 17.01.
Thanks a lot!

3 Likes

Clock is still bugged.

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.

4 Likes

Douwe, what does all this mean?

CVE-2014-9420, CVE-2015-3288, CVE-2016-3911, CVE-2016-6710, CVE-2016-7042, CVE-2016-8422, CVE-2016-8444, CVE-2016-8450, CVE-2016-8452, CVE-2016-8458, CVE-2016-9754, CVE-2017-0381, CVE-2017-0382, CVE-2017-0384, CVE-2017-0385, CVE-2017-0386, CVE-2017-0387, CVE-2017-0390, CVE-2017-0392, CVE-2017-0393, CVE-2017-0394, CVE-2017-0395, CVE-2017-0396, CVE-2017-0397, CVE-2017-0398, CVE-2017-0399, CVE-2017-0400, CVE-2017-0402, CVE-2017-0403, CVE-2017-0404

This is a list of security fixes.

2 Likes

I also can confirm that the clock bug is fixed since 17.01. Thanks to the devs.
Please can devs inform us technically which solution finally works?

1 Like

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.

4 Likes

Clock bug fixed for me too :clap: :grin:

14.03.2017 13:46
Turn off wifi
Turn off cell data
Take out battery
Wait 15 Seconds
Put battery back in
Start phone
Boot successful
Time stays correct!

Thank you devs!

1 Like