mirror of
https://github.com/openharmony/miscservices_inputmethod.git
synced 2026-07-18 17:24:37 -04:00
Signed-off-by: GlaryCastle <yangpeng190@huawei.com>
Changes to be committed: modified: services/include/input_method_system_ability.h modified: services/src/input_method_system_ability.cpp
This commit is contained in:
@@ -56,7 +56,7 @@ namespace MiscServices {
|
||||
int32_t listInputMethod(std::vector<InputMethodProperty*> *properties) override;
|
||||
int32_t listInputMethodByUserId(int32_t userId, std::vector<InputMethodProperty*> *properties) override;
|
||||
int32_t listKeyboardType(const std::u16string& imeId, std::vector<KeyboardType*> *types) override;
|
||||
void GetInputMethodParam(std::vector<InputMethodProperty *> properties_, std::string ¶ms_);
|
||||
void GetInputMethodParam(std::vector<InputMethodProperty *> properties, std::string ¶ms);
|
||||
int Dump(int fd, const std::vector<std::u16string> &args) override;
|
||||
void DumpAllMethod(int fd);
|
||||
|
||||
|
||||
@@ -140,27 +140,27 @@ namespace MiscServices {
|
||||
}
|
||||
|
||||
void InputMethodSystemAbility::GetInputMethodParam(
|
||||
std::vector<InputMethodProperty *> properties_, std::string ¶ms_)
|
||||
std::vector<InputMethodProperty *> properties, std::string ¶ms)
|
||||
{
|
||||
std::string defaultIme = ParaHandle::GetDefaultIme(userId_);
|
||||
std::vector<InputMethodProperty *>::iterator it;
|
||||
for (it = properties_.begin(); it < properties_.end(); ++it) {
|
||||
if (it == properties_.begin()) {
|
||||
for (it = properties.begin(); it < properties.end(); ++it) {
|
||||
if (it == properties.begin()) {
|
||||
params_ += "{\"imeList\":[";
|
||||
} else {
|
||||
params_ += "},";
|
||||
params += "},";
|
||||
}
|
||||
InputMethodProperty *property = (InputMethodProperty *)*it;
|
||||
std::string imeId = Str16ToStr8(property->mPackageName) + "/" + Str16ToStr8(property->mAbilityName);
|
||||
params_ += "{\"ime\": \"" + imeId + "\",";
|
||||
params_ += "\"labelId\": \"" + std::to_string(property->labelId) + "\",";
|
||||
params_ += "\"descriptionId\": \"" + std::to_string(property->descriptionId) + "\",";
|
||||
params += "{\"ime\": \"" + imeId + "\",";
|
||||
params += "\"labelId\": \"" + std::to_string(property->labelId) + "\",";
|
||||
params += "\"descriptionId\": \"" + std::to_string(property->descriptionId) + "\",";
|
||||
std::string isDefaultIme = defaultIme == imeId ? "true" : "false";
|
||||
params_ += "\"isDefaultIme\": \"" + isDefaultIme + "\",";
|
||||
params_ += "\"label\": \"" + Str16ToStr8(property->label) + "\",";
|
||||
params_ += "\"description\": \"" + Str16ToStr8(property->description) + "\"";
|
||||
params += "\"isDefaultIme\": \"" + isDefaultIme + "\",";
|
||||
params += "\"label\": \"" + Str16ToStr8(property->label) + "\",";
|
||||
params += "\"description\": \"" + Str16ToStr8(property->description) + "\"";
|
||||
}
|
||||
params_ += "}]}";
|
||||
params += "}]}";
|
||||
}
|
||||
|
||||
void InputMethodSystemAbility::DumpAllMethod(int fd)
|
||||
|
||||
Reference in New Issue
Block a user