mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2025-02-18 22:28:38 +00:00
Signed-off-by: ma-shaoyin <mashaoyin1@huawei.com>
Changes to be committed:
This commit is contained in:
parent
2541ac461d
commit
74141b6515
@ -183,9 +183,10 @@ private:
|
||||
bool IsRestartIme(uint32_t index);
|
||||
void ClearImeData(uint32_t index);
|
||||
void SetCurrentClient(sptr<IInputClient> client);
|
||||
sptr<IInputMethodCore> GetImsCore(int32_t index);
|
||||
void SetImsCore(int32_t index, sptr<IInputMethodCore> &core);
|
||||
sptr<IInputClient> GetCurrentClient();
|
||||
void SetImsCore(int32_t index, sptr<IInputMethodCore> &core);
|
||||
sptr<IInputMethodCore> GetImsCore(int32_t index);
|
||||
bool CompareCore(int32_t index);
|
||||
|
||||
std::mutex propertyLock_;
|
||||
SubProperty currentSubProperty;
|
||||
|
@ -665,15 +665,13 @@ namespace MiscServices {
|
||||
KeyboardType *type = GetKeyboardType(index, currentKbdIndex[index]);
|
||||
if (type) {
|
||||
sptr<IInputClient> client = GetCurrentClient();
|
||||
sptr<IInputMethodCore> core = GetImsCore(index);
|
||||
sptr<IInputMethodCore> core_ = GetImsCore((1 - index));
|
||||
if (client != nullptr) {
|
||||
int ret = core->setKeyboardType(*type);
|
||||
if (ret != ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGE("setKeyboardType ret: %{public}s [%{public}d]\n", ErrorCode::ToString(ret), userId_);
|
||||
}
|
||||
}
|
||||
if (core == core_) {
|
||||
if (CompareCore(index)) {
|
||||
inputMethodSetting->SetCurrentKeyboardType(type->getHashCode());
|
||||
inputMethodSetting->SetCurrentSysKeyboardType(type->getHashCode());
|
||||
currentKbdIndex[1 - index] = currentKbdIndex[index];
|
||||
@ -1304,5 +1302,15 @@ namespace MiscServices {
|
||||
std::lock_guard<std::mutex> lock(imsCoreLock_);
|
||||
imsCore[index] = core;
|
||||
}
|
||||
|
||||
bool PerUserSession::CompareCore(int32_t index)
|
||||
{
|
||||
sptr<IInputMethodCore> core = GetImsCore(index);
|
||||
sptr<IInputMethodCore> core_ = GetImsCore((1 - index));
|
||||
if (core == core_) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} // namespace MiscServices
|
||||
} // namespace OHOS
|
||||
|
Loading…
x
Reference in New Issue
Block a user