mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2025-02-17 05:38:18 +00:00
Signed-off-by: wangdongqi <wangdongqi2@huawei.com>
Changes to be committed:
This commit is contained in:
parent
73bbd8cbf0
commit
3a75b17e30
@ -267,16 +267,24 @@ int32_t EnableImeDataParser::GetEnableData(
|
||||
std::string EnableImeDataParser::GetGlobalTableUserId(const std::string &valueStr)
|
||||
{
|
||||
auto root = cJSON_Parse(valueStr.c_str());
|
||||
if (root == nullptr) {
|
||||
IMSA_HILOGE("valueStr content parse failed!");
|
||||
return "";
|
||||
}
|
||||
auto subNode = Serializable::GetSubNode(root, "enableImeList");
|
||||
if (subNode == nullptr || !cJSON_IsObject(subNode)) {
|
||||
IMSA_HILOGW("subNode is null or not object");
|
||||
cJSON_Delete(root);
|
||||
return "";
|
||||
}
|
||||
if (subNode->child == nullptr) {
|
||||
IMSA_HILOGW("subNode has not child");
|
||||
cJSON_Delete(root);
|
||||
return "";
|
||||
}
|
||||
return subNode->child->string;
|
||||
std::string userId = subNode->child->string;
|
||||
cJSON_Delete(root);
|
||||
return userId;
|
||||
}
|
||||
|
||||
bool EnableImeDataParser::ParseTempIme(const std::string &valueStr, int32_t userId,
|
||||
|
Loading…
x
Reference in New Issue
Block a user