From 616b15257acc669c005ccce4450f3a0b117d4643 Mon Sep 17 00:00:00 2001 From: libo429 Date: Mon, 22 Jan 2024 16:30:14 +0800 Subject: [PATCH] add EmbeddedComponent Signed-off-by: libo429 --- frameworks/base/log/log_wrapper.h | 3 +- .../bridge/declarative_frontend/BUILD.gn | 2 + .../engine/jsEnumStyle.js | 7 +- .../engine/jsi/jsi_view_register_impl.cpp | 4 +- .../engine/jsi/jsi_view_register_impl_ng.cpp | 4 +- .../jsview/js_embedded_component.cpp | 133 ++++++++++++++++++ .../jsview/js_embedded_component.h | 33 +++++ .../pattern/ui_extension/ui_extension_model.h | 4 +- .../ui_extension/ui_extension_model_ng.cpp | 18 ++- .../ui_extension/ui_extension_model_ng.h | 4 +- .../ui_extension/ui_extension_pattern.cpp | 7 +- .../ui_extension/ui_extension_pattern.h | 11 +- .../pattern/mock_ui_extension_model_ng.cpp | 2 + 13 files changed, 219 insertions(+), 13 deletions(-) create mode 100644 frameworks/bridge/declarative_frontend/jsview/js_embedded_component.cpp create mode 100644 frameworks/bridge/declarative_frontend/jsview/js_embedded_component.h diff --git a/frameworks/base/log/log_wrapper.h b/frameworks/base/log/log_wrapper.h index ce7e5b1be7d..a277cff1851 100644 --- a/frameworks/base/log/log_wrapper.h +++ b/frameworks/base/log/log_wrapper.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -136,6 +136,7 @@ enum class AceLogTag : uint8_t { ACE_DYNAMIC_COMPONENT, // C0393E ACE_MARQUEE, // C0393F ACE_OBSERVER, // C03940 + ACE_EMBEDDED_COMPONENT, // C03941 FORM_RENDER = 255, // C039FF FormRenderer END = 256, // Last one, do not use diff --git a/frameworks/bridge/declarative_frontend/BUILD.gn b/frameworks/bridge/declarative_frontend/BUILD.gn index dd714f405ff..ab78c569ab5 100644 --- a/frameworks/bridge/declarative_frontend/BUILD.gn +++ b/frameworks/bridge/declarative_frontend/BUILD.gn @@ -603,6 +603,7 @@ template("declarative_js_engine") { if (defined(config.window_scene_support) && config.window_scene_support) { sources += [ + "jsview/js_embedded_component.cpp", "jsview/js_ui_extension.cpp", "jsview/window_scene/js_root_scene.cpp", "jsview/window_scene/js_screen.cpp", @@ -841,6 +842,7 @@ template("declarative_js_engine_ng") { if (defined(config.window_scene_support) && config.window_scene_support) { sources += [ + "jsview/js_embedded_component.cpp", "jsview/js_ui_extension.cpp", "jsview/window_scene/js_root_scene.cpp", "jsview/window_scene/js_screen.cpp", diff --git a/frameworks/bridge/declarative_frontend/engine/jsEnumStyle.js b/frameworks/bridge/declarative_frontend/engine/jsEnumStyle.js index 31d77c6a9e1..1283a8a7f59 100644 --- a/frameworks/bridge/declarative_frontend/engine/jsEnumStyle.js +++ b/frameworks/bridge/declarative_frontend/engine/jsEnumStyle.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2023 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -2397,6 +2397,11 @@ var FoldStatus; FoldStatus[FoldStatus["FOLD_STATUS_HALF_FOLDED"] = 3] = "FOLD_STATUS_HALF_FOLDED"; })(FoldStatus || (FoldStatus = {})); +var EmbeddedType; +(function (EmbeddedType) { + EmbeddedType[EmbeddedType["UIEXTENSION"] = 0] = "UIEXTENSION"; +})(EmbeddedType || (EmbeddedType = {})); + var OutlineStyle; (function (OutlineStyle) { OutlineStyle[OutlineStyle["SOLID"] = 0] = "SOLID"; diff --git a/frameworks/bridge/declarative_frontend/engine/jsi/jsi_view_register_impl.cpp b/frameworks/bridge/declarative_frontend/engine/jsi/jsi_view_register_impl.cpp index b6a6eacb654..eb4e0297371 100644 --- a/frameworks/bridge/declarative_frontend/engine/jsi/jsi_view_register_impl.cpp +++ b/frameworks/bridge/declarative_frontend/engine/jsi/jsi_view_register_impl.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -237,6 +237,7 @@ #endif #if defined(WINDOW_SCENE_SUPPORTED) +#include "bridge/declarative_frontend/jsview/js_embedded_component.h" #include "bridge/declarative_frontend/jsview/js_ui_extension.h" #include "bridge/declarative_frontend/jsview/window_scene/js_root_scene.h" #include "bridge/declarative_frontend/jsview/window_scene/js_screen.h" @@ -754,6 +755,7 @@ static const std::unordered_map> { "Component3D", JSSceneView::JSBind }, #endif #if defined(WINDOW_SCENE_SUPPORTED) + { "EmbeddedComponent", JSEmbeddedComponent::JSBind }, { "RootScene", JSRootScene::JSBind }, { "Screen", JSScreen::JSBind }, { "UIExtensionComponent", JSUIExtension::JSBind }, diff --git a/frameworks/bridge/declarative_frontend/engine/jsi/jsi_view_register_impl_ng.cpp b/frameworks/bridge/declarative_frontend/engine/jsi/jsi_view_register_impl_ng.cpp index 8f382dcc96b..34dda6f2bcb 100644 --- a/frameworks/bridge/declarative_frontend/engine/jsi/jsi_view_register_impl_ng.cpp +++ b/frameworks/bridge/declarative_frontend/engine/jsi/jsi_view_register_impl_ng.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2023 Huawei Device Co., Ltd. + * Copyright (c) 2022-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -165,6 +165,7 @@ #include "frameworks/bridge/declarative_frontend/jsview/js_video_controller.h" #endif #ifdef WINDOW_SCENE_SUPPORTED +#include "frameworks/bridge/declarative_frontend/jsview/js_embedded_component.h" #include "frameworks/bridge/declarative_frontend/jsview/js_ui_extension.h" #endif #ifdef ABILITY_COMPONENT_SUPPORTED @@ -448,6 +449,7 @@ void JsBindViews(BindingTarget globalObj, void* nativeEngine) JSSceneView::JSBind(globalObj); #endif #if defined(WINDOW_SCENE_SUPPORTED) + JSEmbeddedComponent::JSBind(globalObj); JSWindowScene::JSBind(globalObj); JSRootScene::JSBind(globalObj); JSScreen::JSBind(globalObj); diff --git a/frameworks/bridge/declarative_frontend/jsview/js_embedded_component.cpp b/frameworks/bridge/declarative_frontend/jsview/js_embedded_component.cpp new file mode 100644 index 00000000000..7ddbe75234e --- /dev/null +++ b/frameworks/bridge/declarative_frontend/jsview/js_embedded_component.cpp @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "bridge/declarative_frontend/jsview/js_embedded_component.h" + +#include +#include +#include + +#include "base/log/ace_scoring_log.h" +#include "base/log/log_wrapper.h" +#include "base/memory/ace_type.h" +#include "base/thread/task_executor.h" +#include "base/utils/utils.h" +#include "bridge/common/utils/engine_helper.h" +#include "bridge/declarative_frontend/engine/js_converter.h" +#include "bridge/declarative_frontend/engine/js_ref_ptr.h" +#include "bridge/declarative_frontend/engine/js_types.h" +#include "bridge/declarative_frontend/engine/jsi/jsi_ref.h" +#include "bridge/declarative_frontend/engine/jsi/jsi_types.h" +#include "bridge/declarative_frontend/jsview/js_utils.h" +#include "bridge/declarative_frontend/jsview/js_ui_extension.h" +#include "bridge/js_frontend/engine/jsi/js_value.h" +#include "core/common/container.h" +#include "core/common/container_scope.h" +#include "core/components_ng/pattern/ui_extension/ui_extension_model.h" +#include "core/components_ng/pattern/ui_extension/ui_extension_model_ng.h" + +namespace OHOS::Ace::Framework { + +void JSEmbeddedComponent::JSBind(BindingTarget globalObj) +{ + JSClass::Declare("EmbeddedComponent"); + MethodOptions opt = MethodOptions::NONE; + JSClass::StaticMethod("create", &JSEmbeddedComponent::Create, opt); + JSClass::StaticMethod("onTerminated", &JSEmbeddedComponent::OnTerminated); + JSClass::StaticMethod("onError", &JSEmbeddedComponent::OnError); + JSClass::InheritAndBind(globalObj); +} + +void JSEmbeddedComponent::Create(const JSCallbackInfo& info) +{ + if (info.Length() < 1 || !info[0]->IsObject()) { + TAG_LOGW(AceLogTag::ACE_EMBEDDED_COMPONENT, "EmbeddedComponent argument is invalid."); + return; + } + auto wantObj = JSRef::Cast(info[0]); + RefPtr want = CreateWantWrapFromNapiValue(wantObj); + + int32_t embeddedType = OHOS::Ace::NG::EmbeddedType::DEFAULT_TYPE; + if (info.Length() > 1 && info[1]->IsNumber()) { + int32_t type = info[1]->ToNumber(); + if (type >= OHOS::Ace::NG::EmbeddedType::DEFAULT_TYPE && + type <= OHOS::Ace::NG::EmbeddedType::UI_EXTENSION) { + embeddedType = type; + } + } + + UIExtensionModel::GetInstance()->Create(want, embeddedType); +} + +void JSEmbeddedComponent::OnTerminated(const JSCallbackInfo& info) +{ + if (!info[0]->IsFunction()) { + TAG_LOGW(AceLogTag::ACE_EMBEDDED_COMPONENT, "OnTerminated argument is invalid."); + return; + } + WeakPtr frameNode = NG::ViewStackProcessor::GetInstance()->GetMainFrameNode(); + auto jsFunc = AceType::MakeRefPtr(JSRef(), JSRef::Cast(info[0])); + auto instanceId = ContainerScope::CurrentId(); + auto onResult = [execCtx = info.GetExecutionContext(), func = std::move(jsFunc), instanceId, node = frameNode] + (int32_t code, const AAFwk::Want& want) { + ContainerScope scope(instanceId); + JAVASCRIPT_EXECUTION_SCOPE_WITH_CHECK(execCtx); + ACE_SCORING_EVENT("EmbeddedComponent.onTerminated"); + auto pipelineContext = PipelineContext::GetCurrentContext(); + CHECK_NULL_VOID(pipelineContext); + pipelineContext->UpdateCurrentActiveNode(node); + auto engine = EngineHelper::GetCurrentEngine(); + CHECK_NULL_VOID(engine); + NativeEngine* nativeEngine = engine->GetNativeEngine(); + CHECK_NULL_VOID(nativeEngine); + auto nativeWant = WantWrap::ConvertToNativeValue(want, reinterpret_cast(nativeEngine)); + auto wantJSVal = JsConverter::ConvertNapiValueToJsVal(nativeWant); + JSRef obj = JSRef::New(); + obj->SetProperty("code", code); + obj->SetPropertyObject("want", wantJSVal); + auto returnValue = JSRef::Cast(obj); + func->ExecuteJS(1, &returnValue); + }; + UIExtensionModel::GetInstance()->SetOnResult(std::move(onResult)); +} + +void JSEmbeddedComponent::OnError(const JSCallbackInfo& info) +{ + if (!info[0]->IsFunction()) { + TAG_LOGW(AceLogTag::ACE_EMBEDDED_COMPONENT, "OnError argument is invalid."); + return; + } + WeakPtr frameNode = NG::ViewStackProcessor::GetInstance()->GetMainFrameNode(); + auto jsFunc = AceType::MakeRefPtr(JSRef(), JSRef::Cast(info[0])); + auto instanceId = ContainerScope::CurrentId(); + auto onError = [execCtx = info.GetExecutionContext(), func = std::move(jsFunc), instanceId, node = frameNode] + (int32_t code, const std::string& name, const std::string& message) { + ContainerScope scope(instanceId); + JAVASCRIPT_EXECUTION_SCOPE_WITH_CHECK(execCtx); + ACE_SCORING_EVENT("EmbeddedComponent.onError"); + auto pipelineContext = PipelineContext::GetCurrentContext(); + CHECK_NULL_VOID(pipelineContext); + pipelineContext->UpdateCurrentActiveNode(node); + JSRef obj = JSRef::New(); + obj->SetProperty("code", code); + obj->SetProperty("name", name); + obj->SetProperty("message", message); + auto returnValue = JSRef::Cast(obj); + func->ExecuteJS(FUNC_ARGC_1, &returnValue); + }; + UIExtensionModel::GetInstance()->SetOnError(std::move(onError)); +} + +} // namespace OHOS::Ace::Framework diff --git a/frameworks/bridge/declarative_frontend/jsview/js_embedded_component.h b/frameworks/bridge/declarative_frontend/jsview/js_embedded_component.h new file mode 100644 index 00000000000..cfc75a095a0 --- /dev/null +++ b/frameworks/bridge/declarative_frontend/jsview/js_embedded_component.h @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_EMBEDDED_COMPONENT_H +#define FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_EMBEDDED_COMPONENT_H + +#include "bridge/declarative_frontend/jsview/js_interactable_view.h" +#include "bridge/declarative_frontend/jsview/js_view_abstract.h" + +namespace OHOS::Ace::Framework { +constexpr int32_t FUNC_ARGC_1 = 1; +class JSEmbeddedComponent : public JSViewAbstract, public JSInteractableView { +public: + static void JSBind(BindingTarget globalObj); + static void Create(const JSCallbackInfo& info); + static void OnTerminated(const JSCallbackInfo& info); + static void OnError(const JSCallbackInfo& info); +}; + +} // namespace OHOS::Ace::Framework +#endif // FRAMEWORKS_BRIDGE_DECLARATIVE_FRONTEND_JS_VIEW_JS_EMBEDDED_COMPONENT_H diff --git a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model.h b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model.h index 0c56bbde028..193fd7a8e91 100644 --- a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model.h +++ b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -40,6 +40,8 @@ public: virtual ~UIExtensionModel() = default; virtual void Create(const RefPtr& wantWrap, bool transferringCaller = false); + // for Embedded Component + virtual void Create(const RefPtr& wantWrap, int32_t embeddedType); // for DynamicComponent virtual void Create(); virtual void InitializeDynamicComponent(const RefPtr& frameNode, const std::string& hapPath, diff --git a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model_ng.cpp b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model_ng.cpp index 2263dde1774..92bb0f94631 100644 --- a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model_ng.cpp +++ b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model_ng.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -82,6 +82,22 @@ void UIExtensionModelNG::Create(const RefPtr& wantWrap, boo dragDropManager->AddDragFrameNode(nodeId, AceType::WeakClaim(AceType::RawPtr(frameNode))); } +// for EmbeddedComponent +void UIExtensionModelNG::Create(const RefPtr& wantWrap, int32_t embeddedType) +{ + auto* stack = ViewStackProcessor::GetInstance(); + auto nodeId = stack->ClaimNodeId(); + auto frameNode = FrameNode::GetOrCreateFrameNode(V2::UI_EXTENSION_COMPONENT_ETS_TAG, nodeId, + [embeddedType]() { return AceType::MakeRefPtr(false, false, false, embeddedType); }); + auto pattern = frameNode->GetPattern(); + CHECK_NULL_VOID(pattern); + pattern->UpdateWant(wantWrap); + stack->Push(frameNode); + auto pipeline = PipelineContext::GetCurrentContext(); + CHECK_NULL_VOID(pipeline); + pipeline->AddWindowStateChangedCallback(nodeId); +} + // for DynamicComponent void UIExtensionModelNG::Create() { diff --git a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model_ng.h b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model_ng.h index d61bfc8a8a7..a9a4f553528 100644 --- a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model_ng.h +++ b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_model_ng.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -36,6 +36,8 @@ public: bool isAsyncModalBinding = false); void Create(const RefPtr& wantWrap, bool transferringCaller = false) override; + // for Embedded Component + void Create(const RefPtr& wantWrap, int32_t embeddedType) override; // for dynamic component void Create() override; void InitializeDynamicComponent(const RefPtr& frameNode, const std::string& hapPath, diff --git a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_pattern.cpp b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_pattern.cpp index 68fc6fecc2f..306f8672c41 100644 --- a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_pattern.cpp +++ b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_pattern.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -44,8 +44,9 @@ #include "core/pipeline_ng/pipeline_context.h" namespace OHOS::Ace::NG { -UIExtensionPattern::UIExtensionPattern(bool isTransferringCaller, bool isModal, bool isAsyncModalBinding) - : isTransferringCaller_(isTransferringCaller), isModal_(isModal), isAsyncModalBinding_(isAsyncModalBinding) +UIExtensionPattern::UIExtensionPattern(bool isTransferringCaller, bool isModal, bool isAsyncModalBinding, + int32_t embeddedType) : isTransferringCaller_(isTransferringCaller), isModal_(isModal), + isAsyncModalBinding_(isAsyncModalBinding), embeddedType_(embeddedType) { sessionWrapper_ = SessionWrapperFactory::CreateSessionWrapper( SessionTye::UI_EXTENSION_ABILITY, AceType::WeakClaim(this), instanceId_, isTransferringCaller_); diff --git a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_pattern.h b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_pattern.h index 3a48f5b622e..233dfef8261 100644 --- a/frameworks/core/components_ng/pattern/ui_extension/ui_extension_pattern.h +++ b/frameworks/core/components_ng/pattern/ui_extension/ui_extension_pattern.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * Copyright (c) 2023-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -52,13 +52,17 @@ class AvoidArea; } // namespace OHOS::Rosen namespace OHOS::Ace::NG { +enum EmbeddedType : int32_t { + DEFAULT_TYPE = -1, + UI_EXTENSION = 0 +}; class UIExtensionProxy; class UIExtensionPattern : public Pattern { DECLARE_ACE_TYPE(UIExtensionPattern, Pattern); public: - explicit UIExtensionPattern( - bool isTransferringCaller = false, bool isModal = false, bool isAsyncModalBinding = false); + explicit UIExtensionPattern(bool isTransferringCaller = false, bool isModal = false, + bool isAsyncModalBinding = false, int32_t embeddedType = EmbeddedType::DEFAULT_TYPE); ~UIExtensionPattern() override; RefPtr CreateLayoutAlgorithm() override; @@ -215,6 +219,7 @@ private: int32_t uiExtensionId_ = 0; int32_t callbackId_ = 0; RectF displayArea_; + int32_t embeddedType_ = EmbeddedType::DEFAULT_TYPE; // for DynamicComponent ComponentType componentType_ = ComponentType::UI_EXTENSION; diff --git a/test/mock/core/pattern/mock_ui_extension_model_ng.cpp b/test/mock/core/pattern/mock_ui_extension_model_ng.cpp index 885dd67ef1d..d72d1867aa8 100644 --- a/test/mock/core/pattern/mock_ui_extension_model_ng.cpp +++ b/test/mock/core/pattern/mock_ui_extension_model_ng.cpp @@ -27,6 +27,8 @@ RefPtr UIExtensionModelNG::Create(const std::string& bundleName, cons void UIExtensionModelNG::Create(const RefPtr& wantWrap, bool transferringCaller) {} +void UIExtensionModelNG::Create(const RefPtr& wantWrap, int32_t embeddedType) {} + void UIExtensionModelNG::Create() {} void UIExtensionModelNG::InitializeDynamicComponent(const RefPtr& frameNode, const std::string& hapPath, -- Gitee