子树在不同window下的场景代码同步

Signed-off-by: fanzexuan <fanzexuan@huawei.com>
This commit is contained in:
fanzexuan 2024-10-12 17:10:09 +08:00
parent 0bbe8a8442
commit f3ca838201

View File

@ -705,7 +705,7 @@ RetError AccessibleAbilityClientImpl::GetChildren(const AccessibilityElementInfo
std::vector<AccessibilityElementInfo> elementInfos {};
if (parent.GetChildWindowId() > 0 && (parent.GetChildWindowId() != windowId)) {
ret = channelClient_->SearchElementInfosByAccessibilityId(parent.GetChildWindowId(), ROOT_NONE_ID,
GET_SOURCE_MODE, elementInfos, ROOT_TREE_ID);
GET_SOURCE_MODE, elementInfos, parent.GetChildTreeId());
} else if (parent.GetChildTreeId() > 0) {
ret = channelClient_->SearchElementInfosByAccessibilityId(parent.GetWindowId(), ROOT_NONE_ID,
GET_SOURCE_MODE, elementInfos, parent.GetChildTreeId());
@ -838,7 +838,7 @@ RetError AccessibleAbilityClientImpl::SearchElementInfoRecursiveByContent(const
}
if (info.GetChildWindowId() > 0 && info.GetChildWindowId() != info.GetWindowId()) {
ret = SearchElementInfoRecursiveByContent(info.GetChildWindowId(),
elementId, mode, elementInfos, text, ROOT_TREE_ID, isFilter);
elementId, mode, elementInfos, text, info.GetChildTreeId(), isFilter);
} else if (info.GetChildTreeId() > 0) {
ret = SearchElementInfoRecursiveByContent(info.GetWindowId(),
elementId, mode, elementInfos, text, info.GetChildTreeId(), isFilter);
@ -1401,7 +1401,7 @@ RetError AccessibleAbilityClientImpl::SearchElementInfoRecursiveByWinid(const in
if ((elementInfos[i].GetChildWindowId() > 0) &&
(elementInfos[i].GetChildWindowId() != elementInfos[i].GetWindowId())) {
ret = SearchElementInfoRecursiveByWinid(elementInfos[i].GetChildWindowId(),
elementId, mode, elementInfos, ROOT_TREE_ID, isFilter, &elementInfos[i]);
elementId, mode, elementInfos, elementInfos[i].GetChildTreeId(), isFilter, &elementInfos[i]);
HILOG_DEBUG("ChildWindowId %{public}d}. ret:%{public}d", elementInfos[i].GetChildWindowId(), ret);
} else if (elementInfos[i].GetChildTreeId() > 0) {
ret = SearchElementInfoRecursiveByWinid(elementInfos[i].GetWindowId(),