!1146 优化代码逻辑

Merge pull request !1146 from dingxiaochen/master
This commit is contained in:
openharmony_ci 2023-03-20 07:57:40 +00:00 committed by Gitee
commit ff7944a9b6
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -178,7 +178,7 @@ void NitzUpdate::ProcessTime(NetworkTime &networkTime)
struct tm t;
(void)memset_s(&t, sizeof(t), 0, sizeof(t));
t.tm_year = networkTime.year - CST_YEAR;
t.tm_year = networkTime.year - static_cast<int32_t>(CST_YEAR);
t.tm_mon = networkTime.month - 1;
t.tm_mday = networkTime.day;
t.tm_hour = networkTime.hour;
@ -216,8 +216,7 @@ bool NitzUpdate::IsValidTime(int64_t networkTime)
if (abs(networkTimeInterval - systemElapsedTime) > TIME_THRESHOLD) {
TELEPHONY_LOGE(
"NitzUpdate::IsInvalidTime The gap between the network time interval and the system elapsed time interval "
"is large and will not be processed, slotId:%{public}d",
slotId_);
"is large and will not be processed, slotId:%{public}d", slotId_);
return false;
}