!1262 杀死scb后输入法拉起后回收

Merge pull request !1262 from hemenghao/master
This commit is contained in:
openharmony_ci 2024-06-25 06:17:13 +00:00 committed by Gitee
commit 663fe38220
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 16 additions and 0 deletions

View File

@ -106,6 +106,7 @@ public:
bool CheckSecurityMode();
bool IsWmsReady();
int32_t OnConnectSystemCmd(const sptr<IRemoteObject> &channel, sptr<IRemoteObject> &agent);
int32_t RemoveCurrentClient();
private:
struct ResetManager {

View File

@ -200,6 +200,11 @@ void InputMethodSystemAbility::HandleWmsReady(int32_t userId)
if (userId != userId_) {
HandleUserChanged(userId);
}
//clear client
auto ret = userSession_->RemoveCurrentClient();
if (ret != ErrorCode::NO_ERROR) {
IMSA_HILOGE("RemoveCurrentClient failed");
}
RestartCurrentIme();
}

View File

@ -1277,5 +1277,15 @@ void PerUserSession::NotifyImeStopFinished()
isSwitching_.store(false);
imeStopCv_.notify_one();
}
int32_t PerUserSession::RemoveCurrentClient()
{
auto currentClient = GetCurrentClient();
if (currentClient == nullptr) {
IMSA_HILOGE("currentClient is null");
return ErrorCode::ERROR_CLIENT_NULL_POINTER;
}
return RemoveClient(currentClient, false);
}
} // namespace MiscServices
} // namespace OHOS