Lines Matching refs:clientInfo
71 int PerUserSession::AddClientInfo(sptr<IRemoteObject> inputClient, const InputClientInfo &clientInfo,
79 clientInfo.uiExtensionTokenId != IMF_INVALID_TOKENID) {
80 UpdateClientInfo(inputClient, { { UpdateFlag::UIEXTENSION_TOKENID, clientInfo.uiExtensionTokenId } });
82 UpdateClientInfo(inputClient, { { UpdateFlag::TEXT_CONFIG, clientInfo.config } });
84 UpdateClientInfo(inputClient, { { UpdateFlag::EVENTFLAG, clientInfo.eventFlag } });
88 auto info = std::make_shared<InputClientInfo>(clientInfo);
91 auto clientInfo = weakClientInfo.lock();
92 if (clientInfo == nullptr) {
93 IMSA_HILOGD("clientInfo is nullptr.");
96 this->OnClientDied(clientInfo->client);
116 auto clientInfo = GetClientInfo(client);
117 if (clientInfo == nullptr) {
122 if (clientInfo->eventFlag != NO_EVENT_ON && !isClientDied) {
130 if (clientInfo->deathRecipient != nullptr) {
132 client->RemoveDeathRecipient(clientInfo->deathRecipient);
135 IMSA_HILOGI("client[%{public}d] is removed.", clientInfo->pid);
185 auto clientInfo = GetClientInfo(currentClient->AsObject());
186 if (clientInfo == nullptr) {
190 auto data = GetReadyImeData(clientInfo->bindImeType);
192 IMSA_HILOGE("ime: %{public}d is not exist!", clientInfo->bindImeType);
209 auto clientInfo = GetClientInfo(currentClient->AsObject());
210 if (clientInfo == nullptr) {
214 auto data = GetReadyImeData(clientInfo->bindImeType);
216 IMSA_HILOGE("ime: %{public}d is not exist!", clientInfo->bindImeType);
238 auto clientInfo = GetClientInfo(remote->AsObject());
241 if (clientInfo != nullptr) {
242 StopImeInput(clientInfo->bindImeType, clientInfo->channel);
248 if (clientInfo != nullptr) {
249 StopImeInput(clientInfo->bindImeType, clientInfo->channel);
284 auto clientInfo = client != nullptr ? GetClientInfo(client->AsObject()) : nullptr;
285 if (clientInfo != nullptr && clientInfo->bindImeType == type) {
286 StopClientInput(clientInfo);
318 auto clientInfo = client != nullptr ? GetClientInfo(client->AsObject()) : nullptr;
319 if (clientInfo != nullptr && clientInfo->bindImeType == type) {
320 UnBindClientWithIme(clientInfo);
438 * @note the clientInfo pointer should not be freed by caller
467 int32_t PerUserSession::OnPrepareInput(const InputClientInfo &clientInfo)
470 return AddClientInfo(clientInfo.client->AsObject(), clientInfo, PREPARE_INPUT);
489 auto clientInfo = GetClientInfo(client->AsObject());
491 UnBindClientWithIme(clientInfo, isUnbindFromClient);
494 StopClientInput(clientInfo);
498 StopClientInput(clientInfo, isInactiveClient);
510 auto clientInfo = GetClientInfo(client->AsObject());
511 if (clientInfo == nullptr) {
514 IMSA_HILOGI("deactivate client[%{public}d].", clientInfo->pid);
525 auto data = GetReadyImeData(clientInfo->bindImeType);
527 IMSA_HILOGE("ime %{public}d doesn't exist!", clientInfo->bindImeType);
530 RequestIme(data, RequestType::NORMAL, [&data, &clientInfo] {
531 data->core->OnClientInactive(clientInfo->channel);
552 auto clientInfo = GetClientInfo(client->AsObject());
553 if (clientInfo == nullptr) {
557 if (IsSameClient(client, GetCurrentClient()) && IsImeBindChanged(clientInfo->bindImeType)) {
558 UnBindClientWithIme(clientInfo);
560 InputClientInfo infoTemp = *clientInfo;
579 int32_t PerUserSession::BindClientWithIme(const std::shared_ptr<InputClientInfo> &clientInfo, ImeType type,
582 if (clientInfo == nullptr) {
583 IMSA_HILOGE("clientInfo is nullptr!");
587 clientInfo->isShowKeyboard, isBindFromClient);
593 [&data, &clientInfo, isBindFromClient]() { return data->core->StartInput(*clientInfo, isBindFromClient); });
603 if (!isBindFromClient && clientInfo->client->OnInputReady(data->agent) != ErrorCode::NO_ERROR) {
607 UpdateClientInfo(clientInfo->client->AsObject(),
608 { { UpdateFlag::BINDIMETYPE, type }, { UpdateFlag::ISSHOWKEYBOARD, clientInfo->isShowKeyboard },
610 ReplaceCurrentClient(clientInfo->client);
627 void PerUserSession::StopClientInput(const std::shared_ptr<InputClientInfo> &clientInfo, bool isStopInactiveClient)
629 if (clientInfo == nullptr || clientInfo->client == nullptr) {
632 auto ret = clientInfo->client->OnInputStop(isStopInactiveClient);
634 clientInfo->pid, ret);
686 auto clientInfo = client != nullptr ? GetClientInfo(client->AsObject()) : nullptr;
687 if (clientInfo != nullptr && IsImeStartInBind(clientInfo->bindImeType, imeType)) {
688 BindClientWithIme(clientInfo, imeType);
704 auto clientInfo = client != nullptr ? GetClientInfo(client->AsObject()) : nullptr;
705 if (clientInfo != nullptr) {
706 if (IsProxyImeStartInBind(clientInfo->bindImeType, imeType)) {
707 BindClientWithIme(clientInfo, imeType);
709 if (IsProxyImeStartInImeBind(clientInfo->bindImeType, imeType)) {
710 UnBindClientWithIme(clientInfo);
711 BindClientWithIme(clientInfo, imeType);
727 auto clientInfo = client != nullptr ? GetClientInfo(client->AsObject()) : nullptr;
728 if (clientInfo == nullptr) {
732 if (clientInfo->bindImeType == ImeType::PROXY_IME) {
733 UnBindClientWithIme(clientInfo);
736 .client = clientInfo->client,
737 .channel = clientInfo->channel };
797 auto clientInfo = GetClientInfo(client->AsObject());
798 if (clientInfo == nullptr) {
805 if (replacedClientInfo != nullptr && replacedClientInfo->pid != clientInfo->pid) {
813 if (inactiveClientInfo != nullptr && inactiveClientInfo->pid != clientInfo->pid) {
838 auto clientInfo = client.second;
839 if (clientInfo == nullptr || !EventStatusManager::IsImeChangeOn(clientInfo->eventFlag)) {
843 IMSA_HILOGD("notify client: [%{public}d]", static_cast<int32_t>(clientInfo->pid));
844 int32_t ret = clientInfo->client->OnSwitchInput(property, subProperty);
846 IMSA_HILOGE("notify failed, ret: %{public}d, uid: %{public}d!", ret, static_cast<int32_t>(clientInfo->uid));
945 auto clientInfo = GetClientInfo(pid);
946 if (clientInfo == nullptr) {
949 RemoveClient(clientInfo->client);
965 auto clientInfo = GetCurClientInfo();
966 if (clientInfo == nullptr) {
971 if (clientInfo->uiExtensionTokenId != IMF_INVALID_TOKENID &&
972 identityChecker->IsFocusedUIExtension(clientInfo->uiExtensionTokenId)) {
976 return clientInfo->pid == pid && clientInfo->uid == uid;
981 auto clientInfo = GetCurClientInfo();
982 if (clientInfo == nullptr) {
987 if (clientInfo->uiExtensionTokenId != IMF_INVALID_TOKENID &&
988 !identityChecker->IsFocusedUIExtension(clientInfo->uiExtensionTokenId)) {
992 return clientInfo->pid == pid && clientInfo->uid == uid;
1096 auto clientInfo = GetClientInfo(client->AsObject());
1097 if (clientInfo == nullptr) {
1100 return clientInfo->pid;
1109 auto clientInfo = GetClientInfo(client->AsObject());
1110 if (clientInfo == nullptr) {
1113 return clientInfo->pid;
1120 auto clientInfo = client.second;
1121 if (clientInfo == nullptr) {
1125 if (status == InputWindowStatus::SHOW && !EventStatusManager::IsImeShowOn(clientInfo->eventFlag)) {
1129 if (status == InputWindowStatus::HIDE && !EventStatusManager::IsImeHideOn(clientInfo->eventFlag)) {
1133 int32_t ret = clientInfo->client->OnPanelStatusChange(status, info);
1142 int32_t PerUserSession::OnUpdateListenEventFlag(const InputClientInfo &clientInfo)
1144 auto remoteClient = clientInfo.client->AsObject();
1145 auto ret = AddClientInfo(remoteClient, clientInfo, START_LISTENING);
1268 auto clientInfo = client != nullptr ? GetClientInfo(client->AsObject()) : nullptr;
1269 if (clientInfo != nullptr) {
1270 return clientInfo->config.inputAttribute.GetSecurityFlag();
1589 auto clientInfo = client != nullptr ? GetClientInfo(client->AsObject()) : nullptr;
1590 if (clientInfo != nullptr && clientInfo->bindImeType == ImeType::IME) {
1591 StopClientInput(clientInfo);
1633 auto clientInfo = client != nullptr ? GetClientInfo(client->AsObject()) : nullptr;
1634 if (clientInfo != nullptr && clientInfo->bindImeType == ImeType::IME) {
1635 StopClientInput(clientInfo);