summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaveen Kalla <mrnaveen@google.com>2017-05-31 17:18:13 -0700
committerNaveen Kalla <mrnaveen@google.com>2017-06-06 19:44:56 -0700
commitb9371ae2d0bb82c6475fe8ede7d58d45d2bcaa52 (patch)
tree67b3fb1f0ab6525a33068a626b6aeddadf7e3f0c
parenta097eda69da969bb021cbc0ec15813d130f65108 (diff)
downloadmarlin-b9371ae2d0bb82c6475fe8ede7d58d45d2bcaa52.tar.gz
Set system time early to get more accurate timezones
Zygote reads the system time and caches the timezone information. So start time_daemon early so that it can set the time before zygote starts up and reads the time. Bug: 62077986 Test: Manual: Check adb logs to ensure Zygote starts after system time is set. Change-Id: Icb4397adf1362d4b91f60711f71dee857b99d920
-rw-r--r--init.common.rc7
-rw-r--r--sepolicy/property.te1
-rw-r--r--sepolicy/property_contexts1
-rw-r--r--sepolicy/time.te3
4 files changed, 11 insertions, 1 deletions
diff --git a/init.common.rc b/init.common.rc
index e237bec1..9e6443e7 100644
--- a/init.common.rc
+++ b/init.common.rc
@@ -130,6 +130,9 @@ on late-fs
write /sys/block/dm-0/queue/read_ahead_kb 2048
write /sys/block/dm-1/queue/read_ahead_kb 2048
+ # Start time daemon early so that the system time can be set early
+ start time_daemon
+
on post-fs-data
# We can start netd here before in is launched in common init.rc on zygote-start
start netd
@@ -137,6 +140,8 @@ on post-fs-data
start mid_sh
# Restart qseecomd once we have /data/
restart qseecomd
+ # Wait until the system time is set
+ wait_for_prop sys.time.set true
# zygote need to be started after otapreopt which will be done on post-fs-data
on zygote-start
@@ -548,7 +553,7 @@ service thermal-engine /vendor/bin/thermal-engine -c ${sys.qcom.thermalcfg:-/ven
socket thermal-recv-passive-client stream 0666 system system
service time_daemon /vendor/bin/time_daemon
- class late_start
+ class core
user root
group root
diff --git a/sepolicy/property.te b/sepolicy/property.te
index 9c8a064d..8e8786b6 100644
--- a/sepolicy/property.te
+++ b/sepolicy/property.te
@@ -7,3 +7,4 @@ type ssr_prop, property_type;
type cnss_diag_prop, property_type;
type thermal_prop, property_type;
type ramdump_prop, property_type;
+type sys_time_prop, property_type;
diff --git a/sepolicy/property_contexts b/sepolicy/property_contexts
index 85276c4c..3a6b63ec 100644
--- a/sepolicy/property_contexts
+++ b/sepolicy/property_contexts
@@ -12,3 +12,4 @@ persist.sys.cnss. u:object_r:cnss_diag_prop:s0
persist.sys.crash_rcu u:object_r:ramdump_prop:s0
sys.qcom.thermalcfg u:object_r:thermal_prop:s0
ctl.thermal-engine u:object_r:thermal_prop:s0
+sys.time.set u:object_r:sys_time_prop:s0
diff --git a/sepolicy/time.te b/sepolicy/time.te
index e821733c..1b28d361 100644
--- a/sepolicy/time.te
+++ b/sepolicy/time.te
@@ -21,6 +21,9 @@ allow time time_data_file:dir rw_dir_perms;
allow time rtc_device:chr_file r_file_perms;
+# Set sys.time.set property
+set_prop(time, sys_time_prop)
+
userdebug_or_eng(`
allow time diag_device:chr_file rw_file_perms;
')