[Feature][ZK-90] sync rtc with UTC zone using hwclock command
Only Configure: No
Affected branch: master
Affected module: rtc
Is it affected on both ZXIC and MTK: only MTK
Self-test: Yes
Doc Update: No
Change-Id: I428833892f42503945023edbd5ae3b90c25bd112
diff --git a/IC_meta/mtk/2735/suspend-service/files/autosuspend_wakeup_count.c b/IC_meta/mtk/2735/suspend-service/files/autosuspend_wakeup_count.c
index 76c9a86..4a7757c 100755
--- a/IC_meta/mtk/2735/suspend-service/files/autosuspend_wakeup_count.c
+++ b/IC_meta/mtk/2735/suspend-service/files/autosuspend_wakeup_count.c
@@ -257,7 +257,7 @@
if (systemtime_sync_flag == 0)
{
ALOGI("suspend_ctrl need sync time to rtc\n");
- if (system("timedatectl status | grep -E \"Universal time|RTC time\" | awk -F\": \" '{print \"date -d \\\"\"$2\"\\\" +%s\"}' | sh | tr '\n' ' ' | awk '{print \"[ \"$1\" -gt \"$2 \" ] && hwclock -w\"}' | sh") == 0)
+ if (system("timedatectl status | grep -E \"Universal time|RTC time\" | awk -F\": \" '{print \"date -d \\\"\"$2\"\\\" +%s\"}' | sh | tr '\n' ' ' | awk '{print \"[ $((\"$1\"- \"$2 \")) -gt 1 ] && hwclock -w --utc\"}' | sh") == 0)
{
ALOGI("suspend_ctrl sync time to rtc success\n");
systemtime_sync_flag = 1;
@@ -328,7 +328,7 @@
void wakeup_feedback(bool success)
{
char buf[80];
- system("hwclock -s");
+ system("hwclock -s --utc");
RLOGD("TIME: rtc to sys\n");
if (!success)
{
diff --git a/common_src/framework/lynq-ril-service/src/common.cpp b/common_src/framework/lynq-ril-service/src/common.cpp
index 402aad1..b87b051 100755
--- a/common_src/framework/lynq-ril-service/src/common.cpp
+++ b/common_src/framework/lynq-ril-service/src/common.cpp
@@ -944,7 +944,7 @@
return ;
stime(&t);
- system("hwclock -w -f /dev/rtc0");
+ system("hwclock -w --utc -f /dev/rtc0");
return;
}
void notifyDataSignal() {
diff --git a/common_src/lib/liblynq-systime/src/lynq_systime.c b/common_src/lib/liblynq-systime/src/lynq_systime.c
index 46ec442..2ba6693 100755
--- a/common_src/lib/liblynq-systime/src/lynq_systime.c
+++ b/common_src/lib/liblynq-systime/src/lynq_systime.c
@@ -66,7 +66,7 @@
system(date);
system(time);
- system("hwclock -w -f /dev/rtc0");
+ system("hwclock -w --utc -f /dev/rtc0");
return 0;
}