From 2a2d5a5bd87c94df1c9ef8da16b0acd4b6f1d05e Mon Sep 17 00:00:00 2001 From: zzlion Date: Tue, 24 Dec 2024 16:50:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=B7=B2=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=97=B6=EF=BC=8CupdateFormComponent?= =?UTF-8?q?=E5=88=B7=E6=96=B0wantCache=5F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zzlion --- .../core/components/form/resource/form_manager_delegate.h | 4 +++- .../core/components_ng/pattern/form/form_pattern.cpp | 7 +++++++ .../core/pattern/form/mock/mock_form_manager_delegate.cpp | 2 ++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/frameworks/core/components/form/resource/form_manager_delegate.h b/frameworks/core/components/form/resource/form_manager_delegate.h index 762f9f6c76..d512e5f4ab 100644 --- a/frameworks/core/components/form/resource/form_manager_delegate.h +++ b/frameworks/core/components/form/resource/form_manager_delegate.h @@ -43,6 +43,9 @@ class FormManagerDelegate : public FormManagerResource { DECLARE_ACE_TYPE(FormManagerDelegate, FormManagerResource); public: +#ifdef OHOS_STANDARD_SYSTEM + void SetParamForWant(const RequestFormInfo& info, const AppExecFwk::FormInfo& formInfo); +#endif using onFormAcquiredCallbackForJava = std::function; using OnFormUpdateCallbackForJava = std::function; @@ -193,7 +196,6 @@ private: std::vector> pointerEventCache_; NotifySurfaceChangeFailedRecord notifySurfaceChangeFailedRecord_; #ifdef OHOS_STANDARD_SYSTEM - void SetParamForWant(const RequestFormInfo& info, const AppExecFwk::FormInfo& formInfo); void OnRouterActionEvent(const std::string& action); void OnCallActionEvent(const std::string& action); int64_t runningCardId_ = -1; diff --git a/frameworks/core/components_ng/pattern/form/form_pattern.cpp b/frameworks/core/components_ng/pattern/form/form_pattern.cpp index fac5f4fcf3..7c1849d9d6 100644 --- a/frameworks/core/components_ng/pattern/form/form_pattern.cpp +++ b/frameworks/core/components_ng/pattern/form/form_pattern.cpp @@ -778,6 +778,13 @@ void FormPattern::AddFormComponentUI(bool isTransparencyEnabled, const RequestFo void FormPattern::UpdateFormComponent(const RequestFormInfo& info) { + if (formManagerBridge_) { +#if OHOS_STANDARD_SYSTEM + AppExecFwk::FormInfo formInfo; + FormManagerDelegate::GetFormInfo(info.bundleName, info.moduleName, info.cardName, formInfo); + formManagerBridge_->SetParamForWant(info, formInfo); +#endif + } auto host = GetHost(); CHECK_NULL_VOID(host); auto layoutProperty = host->GetLayoutProperty(); diff --git a/test/unittest/core/pattern/form/mock/mock_form_manager_delegate.cpp b/test/unittest/core/pattern/form/mock/mock_form_manager_delegate.cpp index 7ec839e267..8c0be8af2e 100644 --- a/test/unittest/core/pattern/form/mock/mock_form_manager_delegate.cpp +++ b/test/unittest/core/pattern/form/mock/mock_form_manager_delegate.cpp @@ -115,6 +115,8 @@ bool FormManagerDelegate::GetFormInfo(const std::string& bundleName, const std:: { return true; } + +void FormManagerDelegate::SetParamForWant(const RequestFormInfo& info, const AppExecFwk::FormInfo& formInfo) {} #endif bool FormManagerDelegate::CheckFormBundleForbidden(const std::string& bundleName) -- Gitee