rk,mtk修改方案:
diff --git a/frameworks/base/services/java/com/android/server/SystemServer.java b/frameworks/base/services/java/com/android/server/SystemServer.java
index 8d23101f55..a0f4bbe553 100755
--- a/frameworks/base/services/java/com/android/server/SystemServer.java
+++ b/frameworks/base/services/java/com/android/server/SystemServer.java
@@ -145,7 +145,7 @@ public final class SystemServer {
// The earliest supported time. We pick one day into 1970, to
// give any timezone code room without going into negative time.
- private static final long EARLIEST_SUPPORTED_TIME = 86400 * 1000;
+ private static final long EARLIEST_SUPPORTED_TIME = 1535846400 * 1000;
/*
* Implementation class names. TODO: Move them to a codegen class or load
--
高通代码的修改方案:
diff --git a/vendor/qcom/proprietary/time-services/time_daemon_qmi.c b/vendor/qcom/proprietary/time-services/time_daemon_qmi.c
index 2e1ba1f..feb1b36 100755
--- a/vendor/qcom/proprietary/time-services/time_daemon_qmi.c
+++ b/vendor/qcom/proprietary/time-services/time_daemon_qmi.c
@@ -6,6 +6,7 @@
* ---------------------------------------------------------------------------
*
*/
+#define DEFAULT_TIME 1
#include <stdio.h>
#include <stdlib.h>
@@ -204,7 +205,11 @@ static int genoff_post_init(time_genoff_ptr time_genoff)
if (rc) {
TIME_LOGD("Daemon:%s:Error in accessing storage\n",
__func__);
- time_genoff->generic_offset = 0;
+ #if DEFAULT_TIME ///force system time = 2019/1/1=1546272000(date +%s --date 20190101)
+ time_genoff->generic_offset = (uint64_t)SEC_TO_MSEC (1546272000) - time_genoff->generic_offset;
+ #else
+ time_genoff->generic_offset = 0;
+ #endif
}
}
其中数值1546272000是通过命令"date +%s --date 20190101"生成的。