modify code

Signed-off-by: zhaolinglan <zhaolinglan@huawei.com>
This commit is contained in:
zhaolinglan 2023-10-14 19:03:42 +08:00
parent 7b3847671c
commit 8544d4bd9c
3 changed files with 5 additions and 6 deletions

View File

@ -484,8 +484,7 @@ std::shared_ptr<Property> ImeInfoInquirer::GetImeByBundleName(int32_t userId, co
}
Property prop = { .name = extInfos[0].bundleName,
.id = extInfos[0].name,
.label =
GetStringById(extInfos[0].bundleName, extInfos[0].moduleName, extInfos[0].applicationInfo.labelId, userId),
.label = extInfos[0].applicationInfo.label,
.labelId = extInfos[0].applicationInfo.labelId,
.iconId = extInfos[0].applicationInfo.iconId };
return std::make_shared<Property>(prop);

View File

@ -163,10 +163,10 @@ bool InputTypeManager::ParseFromCustomSystem()
}
std::vector<InputTypeCfg> configs;
if (!GetCfgsFromFile(path, configs)) {
IMSA_HILOGE("failed to GetCfgsFromFile");
isSuccess = false;
continue;
}
isSuccess = true;
std::lock_guard<std::mutex> lock(typesLock_);
for (const auto &config : configs) {
inputTypes_[config.type] = config.ime;

View File

@ -70,14 +70,14 @@ void InputMethodPrivateMemberTest::SetUp(void)
{
IMSA_HILOGI("InputMethodPrivateMemberTest::SetUp");
ImeCfgManager::GetInstance().imeConfigs_.clear();
ImeInfoInquirer::GetInstance().SetCurrentInfo(nullptr);
ImeInfoInquirer::GetInstance().SetCurrentImeInfo(nullptr);
}
void InputMethodPrivateMemberTest::TearDown(void)
{
IMSA_HILOGI("InputMethodPrivateMemberTest::TearDown");
ImeCfgManager::GetInstance().imeConfigs_.clear();
ImeInfoInquirer::GetInstance().SetCurrentInfo(nullptr);
ImeInfoInquirer::GetInstance().SetCurrentImeInfo(nullptr);
}
sptr<InputMethodSystemAbility> InputMethodPrivateMemberTest::service_;
@ -368,7 +368,7 @@ HWTEST_F(InputMethodPrivateMemberTest, SA_SwitchByCombinationKey_001, TestSize.L
/**
* @tc.name: SA_SwitchByCombinationKey_002
* @tc.desc: SwitchLanguage()/SwitchMode():GetInfo failed
* @tc.desc: SwitchLanguage()/SwitchMode():GetImeInfo failed
* @tc.type: FUNC
* @tc.require:
* @tc.author: chenyu