diff --git a/services/include/input_method_system_ability_stub.h b/services/include/input_method_system_ability_stub.h index ec836b2..3f1245a 100644 --- a/services/include/input_method_system_ability_stub.h +++ b/services/include/input_method_system_ability_stub.h @@ -37,7 +37,7 @@ namespace MiscServices { void setInputMethodCoreFromHap(MessageParcel& data); protected: int32_t getUserId(int32_t uid); - int USER_ID_CHANGE_VALUE = 1000000; + int USER_ID_CHANGE_VALUE = 200000; // user range }; } } diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index ec0e13a..e522c02 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -26,6 +26,7 @@ namespace MiscServices { using namespace MessageID; REGISTER_SYSTEM_ABILITY_BY_ID(InputMethodSystemAbility, INPUT_METHOD_SYSTEM_ABILITY_ID, true); const std::int32_t INIT_INTERVAL = 10000L; + const std::int32_t MAIN_USER_ID = 100; std::mutex InputMethodSystemAbility::instanceLock_; sptr InputMethodSystemAbility::instance_; @@ -162,10 +163,10 @@ namespace MiscServices { workThreadHandler = std::thread([this] { WorkThread(); }); - PerUserSetting *setting = new PerUserSetting(0); - PerUserSession *session = new PerUserSession(0); - userSettings.insert(std::pair(0, setting)); - userSessions.insert(std::pair(0, session)); + PerUserSetting *setting = new PerUserSetting(MAIN_USER_ID); + PerUserSession *session = new PerUserSession(MAIN_USER_ID); + userSettings.insert(std::pair(MAIN_USER_ID, setting)); + userSessions.insert(std::pair(MAIN_USER_ID, session)); setting->Initialize(); }