From 495654e7c038d001fd1c4a6f8a6ec9f7f0fd7417 Mon Sep 17 00:00:00 2001 From: zhangjunxi Date: Thu, 9 Jun 2022 14:21:11 +0800 Subject: [PATCH 1/2] Signed-off-by: zhangjunxi Changes to be committed: modified: timeservice.cfg --- etc/init/timeservice.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/init/timeservice.cfg b/etc/init/timeservice.cfg index 49ae564..738aea1 100644 --- a/etc/init/timeservice.cfg +++ b/etc/init/timeservice.cfg @@ -2,8 +2,8 @@ "services" : [{ "name" : "time_service", "path" : ["/system/bin/sa_main", "/system/profile/time_service.xml"], - "uid" : "system", - "gid" : ["system", "time", "shell"], + "uid" : "time", + "gid" : ["time", "shell"], "caps" : ["SYS_TIME", "WAKE_ALARM"], "secon" : "u:r:time_service:s0" } From 2538518071d1aa2a05ce0b61e05d3c38ab7dfedf Mon Sep 17 00:00:00 2001 From: zhangjunxi Date: Thu, 9 Jun 2022 18:28:08 +0800 Subject: [PATCH 2/2] Signed-off-by: zhangjunxi Changes to be committed: modified: etc/init/timeservice.cfg modified: services/time_manager/src/ntp_update_time.cpp --- etc/init/timeservice.cfg | 9 +++++++++ services/time_manager/src/ntp_update_time.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/etc/init/timeservice.cfg b/etc/init/timeservice.cfg index 738aea1..f8894ec 100644 --- a/etc/init/timeservice.cfg +++ b/etc/init/timeservice.cfg @@ -1,4 +1,13 @@ { + "jobs" : [{ + "name" : "boot", + "cmds" : [ + "mkdir /data/service/el1/public/time 0770 time time", + "syncexec /system/bin/chown -R time:time /data/service/el1/public/time", + "start time_service" + ] + } + ], "services" : [{ "name" : "time_service", "path" : ["/system/bin/sa_main", "/system/profile/time_service.xml"], diff --git a/services/time_manager/src/ntp_update_time.cpp b/services/time_manager/src/ntp_update_time.cpp index 0a41ea5..3cc4408 100644 --- a/services/time_manager/src/ntp_update_time.cpp +++ b/services/time_manager/src/ntp_update_time.cpp @@ -40,7 +40,7 @@ namespace MiscServices { namespace { constexpr uint64_t NANO_TO_MILLISECOND = 1000000; constexpr uint64_t DAY_TO_MILLISECOND = 86400000; -const std::string AUTOTIME_FILE_PATH = "/data/misc/zoneinfo/autotime.json"; +const std::string AUTOTIME_FILE_PATH = "/data/service/el1/public/time/autotime.json"; const std::string NETWORK_TIME_STATUS_ON = "ON"; const std::string NETWORK_TIME_STATUS_OFF = "OFF"; const std::string NTP_CN_SERVER = "ntp.aliyun.com";