Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>

Changes to be committed:
This commit is contained in:
ma-shaoyin 2023-07-18 09:44:17 +08:00
parent 43a87392f1
commit 38b73b0310
3 changed files with 12 additions and 12 deletions

View File

@ -66,12 +66,12 @@ private:
std::mutex behaviourMutex_;
sptr<Utils::Timer> timer_ = nullptr;
int32_t timerId_ = 0;
int32_t userId_ = 0;
uint32_t timerId_ = 0;
std::mutex timerLock_;
inline constexpr int32_t ONE_DAY_IN_HOURS = 24;
inline constexpr int32_t ONE_HOUR_IN_SECONDS = 1 * 60 * 60; // 1 hour
inline constexpr int32_t SECONDS_TO_MILLISECONDS = 1000;
static inline constexpr int32_t ONE_DAY_IN_HOURS = 24;
static inline constexpr int32_t ONE_HOUR_IN_SECONDS = 1 * 60 * 60; // 1 hour
static inline constexpr int32_t SECONDS_TO_MILLISECONDS = 1000;
};
} // namespace MiscServices
} // namespace OHOS

View File

@ -154,17 +154,17 @@ bool InputMethodSysEvent::StartTimer(const TimerCallback &callback, uint32_t int
IMSA_HILOGD("run in");
if (timer_ == nullptr) {
timer_ = new Utils::Timer("imfTimer");
uint32_t ret = timer_.Setup();
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);
timerId_ = timer_->Register(callback, interval, true);
} else {
IMSA_HILOGD("timer_ is not nullptr, Update timer.");
timer_.Unregister(timerId_);
timerId_ = timer_.Register(callback, interval, false);
timer_->Unregister(timerId_);
timerId_ = timer_->Register(callback, interval, false);
}
return true;
}

View File

@ -251,8 +251,8 @@ HWTEST_F(InputMethodDfxTest, InputMethodDfxTest_Hisysevent_Attach, TestSize.Leve
*/
HWTEST_F(InputMethodDfxTest, InputMethodDfxTest_Hisysevent_HideTextInput, TestSize.Level0)
{
auto watcher = std::make_shared<Watcher>(
InputMethodSysEvent::GetInstance().GetOperateInfo(static_cast<int32_t>(OperateIMEInfoCode::IME_HIDE_UNEDITABLE)));
auto watcher = std::make_shared<Watcher>(InputMethodSysEvent::GetInstance().GetOperateInfo(
static_cast<int32_t>(OperateIMEInfoCode::IME_HIDE_UNEDITABLE)));
auto hideTextInput = []() { inputMethodController_->HideTextInput(); };
EXPECT_TRUE(InputMethodDfxTest::WriteAndWatch(watcher, hideTextInput));
}
@ -264,8 +264,8 @@ HWTEST_F(InputMethodDfxTest, InputMethodDfxTest_Hisysevent_HideTextInput, TestSi
*/
HWTEST_F(InputMethodDfxTest, InputMethodDfxTest_Hisysevent_ShowTextInput, TestSize.Level0)
{
auto watcher = std::make_shared<Watcher>(
InputMethodSysEvent::GetInstance().GetOperateInfo(static_cast<int32_t>(OperateIMEInfoCode::IME_SHOW_ENEDITABLE)));
auto watcher = std::make_shared<Watcher>(InputMethodSysEvent::GetInstance().GetOperateInfo(
static_cast<int32_t>(OperateIMEInfoCode::IME_SHOW_ENEDITABLE)));
auto showTextInput = []() { inputMethodController_->ShowTextInput(); };
EXPECT_TRUE(InputMethodDfxTest::WriteAndWatch(watcher, showTextInput));
}