mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2024-11-27 00:41:04 +00:00
Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>
Changes to be committed:
This commit is contained in:
parent
1ea25b65c9
commit
d262ecff3c
@ -19,7 +19,8 @@
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
const char *ParaHandle::DEFAULT_IME_KEY = "persist.sys.default_ime";
|
||||
const char *ParaHandle::DEFAULT_IME_NAME = "com.example.kikakeyboard/ServiceExtAbility";
|
||||
const std::string ParaHandle::CURRENT_PACKAGE_NAME = "com.example.kikakeyboard";
|
||||
const std::string ParaHandle::CURRRET_ABILITY_NAME = "ServiceExtAbility";
|
||||
bool ParaHandle::SetDefaultIme(int32_t userId, const std::string &imeName)
|
||||
{
|
||||
if (userId != main_userId) {
|
||||
@ -41,9 +42,9 @@ namespace OHOS {
|
||||
if (code > 0) {
|
||||
return value;
|
||||
}
|
||||
|
||||
SetDefaultIme(userId, DEFAULT_IME_NAME);
|
||||
return DEFAULT_IME_NAME;
|
||||
std::string defaultName = CURRENT_PACKAGE_NAME + "/" + CURRRET_ABILITY_NAME;
|
||||
SetDefaultIme(userId, defaultName);
|
||||
return defaultName;
|
||||
}
|
||||
} // namespace MiscServices
|
||||
} // namespace OHOS
|
||||
|
@ -1198,9 +1198,7 @@ namespace MiscServices {
|
||||
std::string::size_type pos = defaultIme.find("/");
|
||||
std::string currentIme = defaultIme.substr(0, pos);
|
||||
if (packageName == currentIme) {
|
||||
std::string packageName = "com.example.kikakeyboard";
|
||||
std::string abilityName = "ServiceExtAbility";
|
||||
int32_t ret = OnSwitchInputMethod(packageName, abilityName);
|
||||
int32_t ret = OnSwitchInputMethod(ParaHandle::CURRENT_PACKAGE_NAME, ParaHandle::CURRRET_ABILITY_NAME);
|
||||
IMSA_HILOGI("InputMethodSystemAbility::OnPackageRemoved ret = %{public}d", ret);
|
||||
}
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user