From b1f6542a572043c03b0a5190d2a5fc4ba7a8e18f Mon Sep 17 00:00:00 2001 From: caochunlei Date: Tue, 25 Jan 2022 13:08:14 +0000 Subject: [PATCH] fixed 4d7780b from https://gitee.com/ccllee/miscservices_inputmethod/pulls/44 caochunlei1@huawei.com Signed-off-by: caochunlei --- services/src/input_method_system_ability.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index ec0e13aac..8ce928e56 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -171,9 +171,9 @@ namespace MiscServices { } void InputMethodSystemAbility::StartInputService() { - PerUserSession *session = GetUserSession(0); + PerUserSession *session = GetUserSession(MAIN_USER_ID); - std::map::const_iterator it = msgHandlers.find(0); + std::map::const_iterator it = msgHandlers.find(MAIN_USER_ID); if (it == msgHandlers.end()) { IMSA_HILOGE("InputMethodSystemAbility::StartInputService() need start handler"); MessageHandler *handler = new MessageHandler(); @@ -181,7 +181,7 @@ namespace MiscServices { IMSA_HILOGE("InputMethodSystemAbility::OnPrepareInput session is nullptr"); } session->CreateWorkThread(*handler); - msgHandlers.insert(std::pair(0, handler)); + msgHandlers.insert(std::pair(MAIN_USER_ID, handler)); } if (!session->StartInputService()) { -- Gitee