codecheck

Signed-off-by: dujingcheng <dujingcheng@huawei.com>
Change-Id: I4c22075adaa0caa31192ad3f3d1b8f660f648de1
This commit is contained in:
dujingcheng 2024-09-24 01:51:19 +00:00
parent 354b8ff0b4
commit 221a3321e7
3 changed files with 15 additions and 4 deletions

View File

@ -556,9 +556,9 @@ void JsThirdProviderInteractionOperation::GetNodeConfig(NodeConfig& config)
auto [displayOffset, err] = host->GetPaintRectGlobalOffsetWithTranslate();
config.offset = displayOffset;
config.pageId = host->GetPageId();
config.windowId = context->GetRealHostWindowId();
config.windowId = static_cast<int32_t>(context->GetRealHostWindowId());
config.belongTreeId = belongTreeId_;
config.parentWindowId = context->GetRealHostWindowId();
config.parentWindowId = static_cast<int32_t>(context->GetRealHostWindowId());
config.bundleName = AceApplicationInfo::GetInstance().GetPackageName();
}
@ -639,8 +639,9 @@ bool JsThirdProviderInteractionOperation::HandleEventByFramework(
nativeAccessibilityEvent.GetElementInfo()->GetElementId(),
accessibilityEventInfo);
}
default:
break;
default:
TAG_LOGI(AceLogTag::ACE_ACCESSIBILITY, "Unsupported eventType");
}
return needSendEvent;
}

View File

@ -99,6 +99,11 @@ int32_t ArkUI_AccessibilityProvider::FindAccessibilityNodeInfosById(
ArkUI_AccessibilityElementInfoList* accessibilityElementInfoList
= new (std::nothrow) ArkUI_AccessibilityElementInfoList();
if (accessibilityElementInfoList == nullptr) {
TAG_LOGW(AceLogTag::ACE_ACCESSIBILITY, "info list is null");
return NOT_REGISTERED;
}
int32_t ret = accessibilityProviderCallbacks_->findAccessibilityNodeInfosById(
elementId, static_cast<ArkUI_AccessibilitySearchMode>(mode),
requestId, accessibilityElementInfoList);
@ -123,6 +128,11 @@ int32_t ArkUI_AccessibilityProvider::FindAccessibilityNodeInfosByText(
ArkUI_AccessibilityElementInfoList* accessibilityElementInfoList
= new (std::nothrow) ArkUI_AccessibilityElementInfoList();
if (accessibilityElementInfoList == nullptr) {
TAG_LOGW(AceLogTag::ACE_ACCESSIBILITY, "info list is null");
return NOT_REGISTERED;
}
int32_t ret = accessibilityProviderCallbacks_->findAccessibilityNodeInfosByText(
elementId, text.c_str(), requestId, accessibilityElementInfoList);
if (!accessibilityElementInfoList->CopyAccessibilityElementInfo(infos)) {

View File

@ -178,7 +178,7 @@ int32_t OH_ArkUI_AccessibilityElementInfoSetOperationActions(
if (operationCount <= 0) {
return ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER;
}
elementInfo->ClearChildNodeIds();
elementInfo->ClearOperationActions();
for (int32_t i = 0; i < operationCount; i++) {
elementInfo->AddOperationAction(operationActions[i]);
}