diff --git a/interfaces/inner_api/BUILD.gn b/interfaces/inner_api/BUILD.gn index ac2199a79b2fc02305d542ee95dd918a2de26a00..99e6f549b210f1502126fdc626ba186a3eca6b14 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 4569cd562f0d26cffc537aca15ba309e4494aa0d..c1da5b0745db0eb7e5718195265ca6c6f102a077 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 14dea297691f15f93f3a6d2ae7e30bc543e25c2a..6bb8a57a2c76624a03e469e7350e4e089077602d 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; }