mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2024-11-24 07:09:58 +00:00
Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>
Changes to be committed:
This commit is contained in:
parent
38b73b0310
commit
4c8d8e0bbc
@ -65,7 +65,7 @@ private:
|
||||
static std::map<int32_t, int32_t> inputmethodBehaviour_;
|
||||
std::mutex behaviourMutex_;
|
||||
|
||||
sptr<Utils::Timer> timer_ = nullptr;
|
||||
std::shared_ptr<Utils::Timer> timer_ = nullptr;
|
||||
int32_t userId_ = 0;
|
||||
uint32_t timerId_ = 0;
|
||||
std::mutex timerLock_;
|
||||
|
@ -153,11 +153,10 @@ bool InputMethodSysEvent::StartTimer(const TimerCallback &callback, uint32_t int
|
||||
{
|
||||
IMSA_HILOGD("run in");
|
||||
if (timer_ == nullptr) {
|
||||
timer_ = new Utils::Timer("imfTimer");
|
||||
timer_ = std::make_shared<Utils::Timer>("imfTimer");
|
||||
uint32_t ret = timer_->Setup();
|
||||
if (ret != Utils::TIMER_ERR_OK) {
|
||||
IMSA_HILOGE("Create Timer error");
|
||||
isTimerStart_ = false;
|
||||
return false;
|
||||
}
|
||||
timerId_ = timer_->Register(callback, interval, true);
|
||||
@ -172,7 +171,7 @@ bool InputMethodSysEvent::StartTimer(const TimerCallback &callback, uint32_t int
|
||||
bool InputMethodSysEvent::StartTimerForReport()
|
||||
{
|
||||
IMSA_HILOGD("run in");
|
||||
auto reportCallback = []() { ImeUsageBehaviourReporter(); };
|
||||
auto reportCallback = [this]() { ImeUsageBehaviourReporter(); };
|
||||
std::lock_guard<std::mutex> lock(timerLock_);
|
||||
StartTimer(reportCallback, ONE_DAY_IN_HOURS * ONE_HOUR_IN_SECONDS * SECONDS_TO_MILLISECONDS);
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user