mirror of
https://gitee.com/openharmony/inputmethod_imf
synced 2024-11-23 06:40:06 +00:00
!1486 [Bug]: 修改callingWindowId传递判断
Merge pull request !1486 from 赵凌岚/master
This commit is contained in:
commit
f4a16f9d3a
@ -65,7 +65,6 @@ struct PanelAdjustInfo {
|
||||
class InputMethodPanel {
|
||||
public:
|
||||
static constexpr uint32_t INVALID_WINDOW_ID = 0;
|
||||
static constexpr uint32_t ANCO_INVALID_WINDOW_ID = INVALID_WINDOW_ID - 1;
|
||||
using CallbackFunc = std::function<void(uint32_t, PanelFlag)>;
|
||||
InputMethodPanel() = default;
|
||||
~InputMethodPanel();
|
||||
|
@ -488,9 +488,6 @@ int32_t InputMethodAbility::InvokeStartInputCallback(const TextTotalConfig &text
|
||||
textConfig.textSelection.newBegin, textConfig.textSelection.newEnd);
|
||||
}
|
||||
}
|
||||
if (textConfig.windowId == ANCO_INVALID_WINDOW_ID) {
|
||||
return ErrorCode::NO_ERROR;
|
||||
}
|
||||
auto task = [this, textConfig]() {
|
||||
panels_.ForEach([&textConfig](const PanelType &panelType, const std::shared_ptr<InputMethodPanel> &panel) {
|
||||
panel->SetCallingWindow(textConfig.windowId);
|
||||
@ -1187,7 +1184,7 @@ int32_t InputMethodAbility::GetCallingWindowInfo(CallingWindowInfo &windowInfo)
|
||||
}
|
||||
TextTotalConfig textConfig;
|
||||
int32_t ret = GetTextConfig(textConfig);
|
||||
if (ret != ErrorCode::NO_ERROR || textConfig.windowId == ANCO_INVALID_WINDOW_ID) {
|
||||
if (ret != ErrorCode::NO_ERROR) {
|
||||
IMSA_HILOGE("failed to get window id, ret: %{public}d!", ret);
|
||||
return ErrorCode::ERROR_GET_TEXT_CONFIG;
|
||||
}
|
||||
|
@ -26,7 +26,6 @@
|
||||
namespace OHOS {
|
||||
namespace MiscServices {
|
||||
constexpr uint32_t INVALID_WINDOW_ID = 0;
|
||||
constexpr uint32_t ANCO_INVALID_WINDOW_ID = INVALID_WINDOW_ID - 1;
|
||||
constexpr int32_t INVALID_VALUE = -1;
|
||||
constexpr size_t MAX_PRIVATE_COMMAND_SIZE = 32 * 1024; // 32K
|
||||
constexpr size_t MAX_PRIVATE_COMMAND_COUNT = 5;
|
||||
|
@ -270,12 +270,8 @@ int32_t InputMethodSystemAbility::ReleaseInput(sptr<IInputClient> client)
|
||||
int32_t InputMethodSystemAbility::StartInput(InputClientInfo &inputClientInfo, sptr<IRemoteObject> &agent)
|
||||
{
|
||||
AccessTokenID tokenId = IPCSkeleton::GetCallingTokenID();
|
||||
if (!identityChecker_->IsBroker(tokenId)) {
|
||||
if (!identityChecker_->IsFocused(IPCSkeleton::GetCallingPid(), tokenId)) {
|
||||
return ErrorCode::ERROR_CLIENT_NOT_FOCUSED;
|
||||
}
|
||||
} else {
|
||||
inputClientInfo.config.windowId = ANCO_INVALID_WINDOW_ID;
|
||||
if (!identityChecker_->IsBroker(tokenId) && !identityChecker_->IsFocused(IPCSkeleton::GetCallingPid(), tokenId)) {
|
||||
return ErrorCode::ERROR_CLIENT_NOT_FOCUSED;
|
||||
}
|
||||
auto userId = GetCallingUserId();
|
||||
auto session = UserSessionManager::GetInstance().GetUserSession(userId);
|
||||
|
Loading…
Reference in New Issue
Block a user