From d7dd524847746b37e2d87d7eeb9e8932e654d5f7 Mon Sep 17 00:00:00 2001 From: zhouyongfei Date: Sat, 12 Feb 2022 15:12:37 +0800 Subject: [PATCH] fix bugs Signed-off-by: zhouyongfei --- services/include/input_method_property.h | 2 ++ services/src/input_method_property.cpp | 10 +++++++++- services/src/input_method_system_ability.cpp | 3 ++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/services/include/input_method_property.h b/services/include/input_method_property.h index eed6bc1b..04f5f1d1 100644 --- a/services/include/input_method_property.h +++ b/services/include/input_method_property.h @@ -31,6 +31,8 @@ namespace MiscServices { bool isSystemIme; int32_t mDefaultImeId; std::vector mTypes; + std::u16string moduleName; + std::u16string description; InputMethodProperty(); ~InputMethodProperty(); diff --git a/services/src/input_method_property.cpp b/services/src/input_method_property.cpp index 349f8216..803fabf7 100644 --- a/services/src/input_method_property.cpp +++ b/services/src/input_method_property.cpp @@ -45,6 +45,8 @@ namespace MiscServices { mConfigurationPage = property.mConfigurationPage; isSystemIme = property.isSystemIme; mDefaultImeId = property.mDefaultImeId; + moduleName = property.moduleName; + description = property.description; for (int i = 0; i < (int)mTypes.size(); i++) { KeyboardType *type = new KeyboardType(*property.mTypes[i]); @@ -67,6 +69,8 @@ namespace MiscServices { mConfigurationPage = property.mConfigurationPage; isSystemIme = property.isSystemIme; mDefaultImeId = property.mDefaultImeId; + moduleName = property.moduleName; + description = property.description; for (int i = 0; i < (int)mTypes.size(); i++) { KeyboardType *type = new KeyboardType(*property.mTypes[i]); @@ -87,7 +91,9 @@ namespace MiscServices { && parcel.WriteString16(mAbilityName) && parcel.WriteString16(mConfigurationPage) && parcel.WriteBool(isSystemIme) - && parcel.WriteInt32(mDefaultImeId))) + && parcel.WriteInt32(mDefaultImeId) + && parcel.WriteString16(moduleName) + && parcel.WriteString16(description))) return false; int32_t size = (int32_t)mTypes.size(); parcel.WriteInt32(size); @@ -114,6 +120,8 @@ namespace MiscServices { info->mConfigurationPage = parcel.ReadString16(); info->isSystemIme = parcel.ReadBool(); info->mDefaultImeId = parcel.ReadInt32(); + info->moduleName = parcel.ReadString16(); + info->description = parcel.ReadString16(); int32_t size = parcel.ReadInt32(); if (size == 0) diff --git a/services/src/input_method_system_ability.cpp b/services/src/input_method_system_ability.cpp index c4ea21ef..3ec80bd9 100644 --- a/services/src/input_method_system_ability.cpp +++ b/services/src/input_method_system_ability.cpp @@ -373,6 +373,8 @@ namespace MiscServices { InputMethodProperty *property = new InputMethodProperty(); property->mPackageName = Str8ToStr16(extension.bundleName); property->mAbilityName = Str8ToStr16(extension.name); + property->moduleName = Str8ToStr16(extension.moduleName); + property->description = Str8ToStr16(extension.description); properties->push_back(property); } return ErrorCode::NO_ERROR; @@ -539,7 +541,6 @@ namespace MiscServices { userSettings.insert(std::pair(userId, setting)); userSessions.insert(std::pair(userId, session)); - IMSA_HILOGI("End...[%d]\n", userId); return ErrorCode::NO_ERROR; }