kill杀死后拉起的问题

Signed-off-by: h30051954 <hemenghao2@huawei.com>
This commit is contained in:
h30051954 2024-06-24 17:37:35 +08:00
parent bd72806bb1
commit 6c0d28718d
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