mirror of
https://github.com/openharmony/miscservices_time.git
synced 2026-07-19 20:03:38 -04:00
@@ -31,12 +31,12 @@
|
||||
#include <linux/rtc.h>
|
||||
|
||||
#include "pthread.h"
|
||||
#include "time_service.h"
|
||||
#include "time_zone_info.h"
|
||||
#include "time_common.h"
|
||||
#include "system_ability.h"
|
||||
#include "system_ability_definition.h"
|
||||
#include "iservice_registry.h"
|
||||
#include "time_service.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
@@ -64,8 +64,8 @@ std::shared_ptr<MiscServices::TimeServiceNotify> TimeService::timeServiceNotify_
|
||||
std::shared_ptr<TimerManager> TimeService::timerManagerHandler_ = nullptr;
|
||||
|
||||
TimeService::TimeService(int32_t systemAbilityId, bool runOnCreate)
|
||||
: SystemAbility(systemAbilityId, runOnCreate),
|
||||
state_(ServiceRunningState::STATE_NOT_START),
|
||||
: SystemAbility(systemAbilityId, runOnCreate),
|
||||
state_(ServiceRunningState::STATE_NOT_START),
|
||||
rtc_id(get_wall_clock_rtc_id())
|
||||
{
|
||||
TIME_HILOGI(TIME_MODULE_SERVICE, " TimeService Start.");
|
||||
@@ -240,7 +240,7 @@ uint64_t TimeService::CreateTimer(int32_t type, bool repeat, uint64_t interval,
|
||||
0);
|
||||
}
|
||||
|
||||
bool TimeService::StartTimer(uint64_t timerId, uint64_t triggerTimes)
|
||||
bool TimeService::StartTimer(uint64_t timerId, uint64_t triggerTimes)
|
||||
{
|
||||
uint64_t triggerTimesIn = (triggerTimes < MIN_TRIGGER_TIMES) ? MIN_TRIGGER_TIMES : triggerTimes;
|
||||
if (timerManagerHandler_ == nullptr) {
|
||||
@@ -275,7 +275,7 @@ bool TimeService::StopTimer(uint64_t timerId)
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool TimeService::DestroyTimer(uint64_t timerId)
|
||||
bool TimeService::DestroyTimer(uint64_t timerId)
|
||||
{
|
||||
if (timerManagerHandler_ == nullptr) {
|
||||
TIME_HILOGE(TIME_MODULE_SERVICE, "Timer manager nullptr.");
|
||||
|
||||
@@ -390,7 +390,7 @@ bool TimerManager::TriggerTimersLocked(std::vector<std::shared_ptr<TimerInfo>> &
|
||||
break;
|
||||
}
|
||||
alarmBatches_.erase(alarmBatches_.begin());
|
||||
TIME_HILOGI(TIME_MODULE_SERVICE, "after erase alarmBatches_.size= %{public}d",
|
||||
TIME_HILOGI(TIME_MODULE_SERVICE, "after erase alarmBatches_.size= %{public}d",
|
||||
static_cast<int>(alarmBatches_.size()));
|
||||
|
||||
const auto n = batch->Size();
|
||||
|
||||
Reference in New Issue
Block a user