AOSPA-L/android_hardware_sony_timekeep

Name: android_hardware_sony_timekeep

Owner: AOSPAL (Lollipop)

Description: null

Created: 2015-11-20 09:08:27.0

Updated: 2015-11-20 09:09:42.0

Pushed: 2015-11-20 09:09:41.0

Homepage: null

Size: 8

Language: C

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

TimeKeep

TimeKeep is a small utility to keep track of time & date since the RTC driver on Qualcomm chipset is read-only.

It consist of two parts. A native tool, timekeep, to store and restore time and a Java part (com.sony.timekeep) consisting of a single broadcastreceiver that receives ACTION_TIME_CHANGED, ACTION_TIMEZONE_CHANGED and ACTION_SHUTDOWN and then calls timekeep.

When the Java broadcastreceiver gets one of the above intents, timekeep is called with store parameter and the time delta between the set date (in seconds) and /sys/class/rtc/rtc0/since_epoch is stored to a persistent property (persist.sys.timeadjust).

To restore the time timekeep is called with the restore parameter. The persistent property containing the time delta is then read together with the since_epoch value and settimeofday is set with the sum of the two. timekeep with the restore parameter needs CAP_SYS_TIME. The call to restore the time can for example be done in init as the example below.

init.example.rc:

on boot /system/bin/timekeep restore


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.