删除权限管理代码

Signed-off-by: guduhanyan <xuyanjun27@163.com>
This commit is contained in:
liulinna
2022-03-19 10:30:09 +08:00
committed by guduhanyan
parent 6e63aeb9de
commit 702286670b
4 changed files with 13 additions and 22 deletions
+11 -13
View File
@@ -64,20 +64,18 @@ void NtpUpdateTime::Init()
}
}
if (autoTimeInfo_.status == NETWORK_TIME_STATUS_ON) {
SetSystemTime();
}
std::thread([this] {
for (int i = 0; i < MAX_RETRY; i++) {
if (!this->ThreadSetSystemTime()) {
TIME_HILOGE(TIME_MODULE_SERVICE, "thread set ntp time failed, retry");
std::this_thread::sleep_for(seconds(MINUTES_TO_SECOND));
} else {
TIME_HILOGD(TIME_MODULE_SERVICE, "thread set ntp time success");
break;
std::thread([this] {
for (int i = 0; i < MAX_RETRY; i++) {
if (!this->ThreadSetSystemTime()) {
TIME_HILOGE(TIME_MODULE_SERVICE, "thread set ntp time failed, retry");
std::this_thread::sleep_for(seconds(MINUTES_TO_SECOND));
} else {
TIME_HILOGD(TIME_MODULE_SERVICE, "thread set ntp time success");
break;
}
}
}
}).detach();
}).detach();
}
int32_t timerType = ITimerManager::TimerType::ELAPSED_REALTIME;
auto callback = [this](uint64_t id) {
+1 -1
View File
@@ -345,7 +345,7 @@ unsigned int SNTPClient::GetNtpField32(int offset, char* buffer)
errno_t retValue = memcpy_s(&milliseconds, sizeof(int), valueRx, sizeof(int));
if (retValue != EOK) {
TIME_HILOGE(TIME_MODULE_SERVICE, "memcpy_s failed, err = %d\n", retValue);
return false; // 返回失败
return false;
}
TIME_HILOGD(TIME_MODULE_SERVICE, "end.");
return milliseconds;
@@ -306,14 +306,6 @@ bool TimeService::DestroyTimer(uint64_t timerId)
int32_t TimeService::SetTime(const int64_t time)
{
pid_t uid = IPCSkeleton::GetCallingUid();
if (uid != 0) {
auto hasPerm = DelayedSingleton<TimePermission>::GetInstance()->CheckCallingPermission(uid, setTimePermName_);
if (!hasPerm) {
TIME_HILOGE(TIME_MODULE_SERVICE, "Permission check failed, uid : %{public}d", uid);
return E_TIME_NO_PERMISSION;
}
}
TIME_HILOGI(TIME_MODULE_SERVICE, "Setting time of day to milliseconds: %{public}" PRId64 "", time);
if (time < 0 || time / 1000LL >= LONG_MAX) {
TIME_HILOGE(TIME_MODULE_SERVICE, "input param error");
+1
View File
@@ -408,6 +408,7 @@ bool TimerManager::TriggerTimersLocked(std::vector<std::shared_ptr<TimerInfo>> &
auto alarm = batch->Get(i);
alarm->count = 1;
triggerList.push_back(alarm);
TIME_HILOGI(TIME_MODULE_SERVICE, "alarm uid= %{public}d", alarm->uid);
if (alarm->repeatInterval > milliseconds::zero()) {
alarm->count += duration_cast<milliseconds>(nowElapsed -
alarm->expectedWhenElapsed) / alarm->repeatInterval;