From 29910cc0f3a8bc2503d2a77b726e1cdd0a300906 Mon Sep 17 00:00:00 2001 From: xujunyang Date: Tue, 1 Apr 2025 15:18:48 +0800 Subject: [PATCH] =?UTF-8?q?5.1.0=E4=BB=A3=E7=A0=81=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xujunyang --- interfaces/inner_api/BUILD.gn | 2 -- services/BUILD.gn | 1 + services/time/src/ntp_trusted_time.cpp | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/interfaces/inner_api/BUILD.gn b/interfaces/inner_api/BUILD.gn index ac2199a7..99e6f549 100644 --- a/interfaces/inner_api/BUILD.gn +++ b/interfaces/inner_api/BUILD.gn @@ -42,8 +42,6 @@ ohos_shared_library("time_client") { ] deps = [ "${time_service_path}:timeservice_proxy" ] external_deps = [ - "ability_runtime:abilitykit_native", - "ability_runtime:extensionkit_native", "ability_runtime:wantagent_innerkits", "c_utils:utils", "hilog:libhilog", diff --git a/services/BUILD.gn b/services/BUILD.gn index 4569cd56..c1da5b07 100755 --- a/services/BUILD.gn +++ b/services/BUILD.gn @@ -67,6 +67,7 @@ ohos_source_set("timeservice_proxy") { "ipc:ipc_single", "samgr:samgr_proxy", ] + branch_protector_ret = "pac_ret" subsystem_name = "time" part_name = "time_service" } diff --git a/services/time/src/ntp_trusted_time.cpp b/services/time/src/ntp_trusted_time.cpp index 14dea297..6bb8a57a 100644 --- a/services/time/src/ntp_trusted_time.cpp +++ b/services/time/src/ntp_trusted_time.cpp @@ -25,7 +25,7 @@ namespace { constexpr int64_t TIME_RESULT_UNINITED = -1; constexpr int64_t HALF = 2; constexpr int NANO_TO_SECOND = 1000000000; -constexpr uint64_t ONE_DAY = 86400000; +constexpr int64_t ONE_DAY = 86400000; } // namespace NtpTrustedTime &NtpTrustedTime::GetInstance() @@ -115,7 +115,7 @@ int64_t NtpTrustedTime::TimeResult::CurrentTimeMillis() } auto bootTime = std::chrono::duration_cast( NtpTrustedTime::GetInstance().GetBootTimeNs().time_since_epoch()).count(); - if (bootTime - mElapsedRealtimeMillis > ONE_DAY) { + if (static_cast(bootTime) - mElapsedRealtimeMillis > ONE_DAY) { Clear(); return TIME_RESULT_UNINITED; } -- Gitee