移除节点检查

Signed-off-by: wangxinqiang007 <wangxinqiang2@huawei.com>
This commit is contained in:
wangxinqiang007 2023-12-19 17:03:14 +08:00
parent 5ed24b287a
commit dc061a9e38
3 changed files with 1 additions and 27 deletions

View File

@ -375,8 +375,6 @@ private:
const uint32_t mode, AccessibilityElementInfo &info);
bool InitAccessibilityServiceProxy();
static void OnParameterChanged(const char *key, const char *value, void *context);
RetError CheckElementInfo(int32_t windowId, int32_t elementId, int mode,
std::vector<AccessibilityElementInfo> &elementInfos);
sptr<IRemoteObject::DeathRecipient> deathRecipient_ = nullptr;
sptr<IRemoteObject::DeathRecipient> accessibilityServiceDeathRecipient_ = nullptr;

View File

@ -32,7 +32,6 @@ namespace Accessibility {
constexpr int WAIT_WINDOW_REGIST = 500;
namespace {
const std::string SYSTEM_PARAMETER_AAMS_NAME = "accessibility.config.ready";
const std::string SHELL_NAME = "com.huawei.shell_assistant";
constexpr int32_t CONFIG_PARAMETER_VALUE_SIZE = 10;
constexpr int32_t ROOT_NONE_ID = -1;
constexpr int32_t NODE_ID_MAX = 0x7FFFFFFE;
@ -1016,29 +1015,6 @@ RetError AccessibleAbilityClientImpl::SearchElementInfoRecursive(int32_t windowI
return RET_ERR_INVALID_ELEMENT_INFO_FROM_ACE;
}
ret = CheckElementInfo(windowId, elementId, mode, elementInfos);
if (ret != RET_OK) {
HILOG_ERROR("check element info failed. windowId %{public}d", windowId);
return ret;
}
return RET_OK;
}
RetError AccessibleAbilityClientImpl::CheckElementInfo(int32_t windowId, int32_t elementId, int mode,
std::vector<AccessibilityElementInfo> &elementInfos)
{
HILOG_DEBUG();
AccessibilityElementInfo element = elementInfos.front();
if (element.GetBundleName() == SHELL_NAME) {
int32_t tempWid = windowId - 1;
elementInfos.clear();
RetError ret = channelClient_->SearchElementInfosByAccessibilityId(tempWid, elementId, mode, elementInfos);
if (ret != RET_OK) {
tempWid = tempWid - 1;
elementInfos.clear();
return channelClient_->SearchElementInfosByAccessibilityId(tempWid, elementId, mode, elementInfos);
}
}
return RET_OK;
}

View File

@ -974,7 +974,7 @@ HWTEST_F(AccessibleAbilityClientImplTest, AddCacheByAce_001, TestSize.Level1)
/**
* @tc.number: GetByContent_003
* @tc.name: GetByContent
* @tc.desc: Test function GetByContent.
* @tc.desc: Test function GetByContent
*/
HWTEST_F(AccessibleAbilityClientImplTest, GetByContent_003, TestSize.Level1)
{