修改日志打印

Signed-off-by: cy7717 <chenyu301@huawei.com>
This commit is contained in:
cy7717 2023-03-10 15:00:51 +08:00
parent 849a9ff6a9
commit 2745e56468

View File

@ -791,15 +791,17 @@ std::string InputMethodSystemAbility::GetStartedIme(int32_t userId)
bool InputMethodSystemAbility::BlockRetry(uint32_t interval, uint32_t maxRetryTimes, Function func)
{
IMSA_HILOGI("start");
uint32_t times = 0;
do {
times++;
IMSA_HILOGI("Retry times: %{public}d", times);
if (func()) {
IMSA_HILOGI("success, retry times: %{public}d", times);
return true;
}
std::this_thread::sleep_for(std::chrono::milliseconds(interval));
} while (times < maxRetryTimes);
IMSA_HILOGI("failed");
return false;
}