diff --git a/interfaces/kits/js/AccessibilityExtensionContext.d.ts b/interfaces/kits/js/AccessibilityExtensionContext.d.ts index b8271bb4..a8e604d1 100644 --- a/interfaces/kits/js/AccessibilityExtensionContext.d.ts +++ b/interfaces/kits/js/AccessibilityExtensionContext.d.ts @@ -25,11 +25,14 @@ import { GesturePath } from "../@ohos.application.AccessibilityExtensionAbility" * @syscap SystemCapability.BarrierFree.Accessibility.Core */ export default class AccessibilityExtensionContext extends ExtensionContext { - setEventTypeFilter(type: Array, callback: AsyncCallback): boolean; - setEventTypeFilter(type: Array): Promise; - - setTargetBundleName(targetNames: Array, callback: AsyncCallback): boolean; - setTargetBundleName(targetNames: Array): Promise; + setEventTypeFilter(type: Array, callback: AsyncCallback): void; + setEventTypeFilter(type: Array): Promise; + /** + * Set the name of the bundle name that is interested in sending the event. + * @param targetNames + */ + setTargetBundleName(targetNames: Array): Promise; + setTargetBundleName(targetNames: Array, callback: AsyncCallback): void; /** * Get focus element. diff --git a/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp b/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp index 16514050..0d5d2a58 100644 --- a/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp +++ b/interfaces/kits/napi/accessibility_extension_module_loader/src/napi_accessibility_extension_context.cpp @@ -167,7 +167,7 @@ private: } bool ret = context->SetEventTypeFilter(filter); if (ret) { - task.Resolve(engine, engine.CreateBoolean(ret)); + task.Resolve(engine, engine.CreateUndefined()); } else { HILOG_ERROR("set event type failed. ret: %{public}d.", ret); task.Reject(engine, CreateJsError(engine, RESULT_ERROR, "set event type failed.")); @@ -208,7 +208,7 @@ private: bool ret = context->SetTargetBundleName(targetBundleNames); if (ret) { - task.Resolve(engine, engine.CreateBoolean(ret)); + task.Resolve(engine, engine.CreateUndefined()); } else { HILOG_ERROR("set target bundle name failed. ret: %{public}d.", ret); task.Reject(engine, CreateJsError(engine, RESULT_ERROR, "set target bundle name failed."));