From ffed84f5bd8ed8c2847233f05a43c4dff69b11df Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Sun, 21 Jul 2024 09:27:40 +0000 Subject: [PATCH] add syncgenro Signed-off-by: dujingcheng Change-Id: Ic23c35ea9f5f8e5a41f4664cbf4081c982ccc974 --- .../security_session_wrapper_impl.cpp | 5 ++--- .../security_ui_extension_pattern.cpp | 19 ++++--------------- .../security_ui_extension_pattern.h | 3 +-- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/frameworks/core/components_ng/pattern/ui_extension/security_session_wrapper_impl.cpp b/frameworks/core/components_ng/pattern/ui_extension/security_session_wrapper_impl.cpp index 929dea5807a..3ebdf08d4fa 100644 --- a/frameworks/core/components_ng/pattern/ui_extension/security_session_wrapper_impl.cpp +++ b/frameworks/core/components_ng/pattern/ui_extension/security_session_wrapper_impl.cpp @@ -582,14 +582,13 @@ void SecuritySessionWrapperImpl::NotifyDisplayArea(const RectF& displayArea) CHECK_NULL_VOID(pipeline); auto curWindow = pipeline->GetCurrentWindowRect(); displayArea_ = displayArea + OffsetF(curWindow.Left(), curWindow.Top()); - PLATFORM_LOGD("The display area with '%{public}s' is notified to the provider.", - displayArea_.ToString().c_str()); std::shared_ptr transaction; auto parentSession = session_->GetParentSession(); auto reason = parentSession ? parentSession->GetSizeChangeReason() : session_->GetSizeChangeReason(); auto persistentId = parentSession ? parentSession->GetPersistentId() : session_->GetPersistentId(); ACE_SCOPED_TRACE("NotifyDisplayArea id: %d, reason [%d]", persistentId, reason); - PLATFORM_LOGD("NotifyDisplayArea id: %{public}d, reason = %{public}d", persistentId, reason); + PLATFORM_LOGI("DisplayArea: %{public}s, persistentId: %{public}d, reason: %{public}d", + displayArea_.ToString().c_str(), persistentId, reason); if (reason == Rosen::SizeChangeReason::ROTATION) { if (transaction_.lock()) { transaction = transaction_.lock(); diff --git a/frameworks/core/components_ng/pattern/ui_extension/security_ui_extension_pattern.cpp b/frameworks/core/components_ng/pattern/ui_extension/security_ui_extension_pattern.cpp index aab7f7c00da..8f06d70f7a1 100644 --- a/frameworks/core/components_ng/pattern/ui_extension/security_ui_extension_pattern.cpp +++ b/frameworks/core/components_ng/pattern/ui_extension/security_ui_extension_pattern.cpp @@ -281,20 +281,9 @@ void SecurityUIExtensionPattern::OnAreaChangedInner() void SecurityUIExtensionPattern::FireBindModalCallback() {} -bool SecurityUIExtensionPattern::OnDirtyLayoutWrapperSwap( - const RefPtr& dirty, const DirtySwapConfig& config) +void SecurityUIExtensionPattern::OnSyncGeometryNode(const DirtySwapConfig& config) { - CHECK_NULL_RETURN(sessionWrapper_, false); - CHECK_NULL_RETURN(dirty, false); - auto host = dirty->GetHostNode(); - CHECK_NULL_RETURN(host, false); - auto [displayOffset, err] = host->GetPaintRectGlobalOffsetWithTranslate(); - auto geometryNode = dirty->GetGeometryNode(); - CHECK_NULL_RETURN(geometryNode, false); - auto displaySize = geometryNode->GetFrameSize(); - displayArea_ = RectF(displayOffset, displaySize); - sessionWrapper_->NotifyDisplayArea(displayArea_); - return false; + DispatchDisplayArea(true); } void SecurityUIExtensionPattern::OnWindowShow() @@ -524,7 +513,7 @@ void SecurityUIExtensionPattern::SetSyncCallbacks( void SecurityUIExtensionPattern::FireSyncCallbacks() { - PLATFORM_LOGD("The size of sync callbacks = %{public}zu.", onSyncOnCallbackList_.size()); + PLATFORM_LOGI("The size of sync callbacks = %{public}zu.", onSyncOnCallbackList_.size()); ContainerScope scope(instanceId_); for (const auto& callback : onSyncOnCallbackList_) { if (callback) { @@ -541,7 +530,7 @@ void SecurityUIExtensionPattern::SetAsyncCallbacks( void SecurityUIExtensionPattern::FireAsyncCallbacks() { - PLATFORM_LOGD("The size of async callbacks = %{public}zu.", onSyncOnCallbackList_.size()); + PLATFORM_LOGI("The size of async callbacks = %{public}zu.", onSyncOnCallbackList_.size()); ContainerScope scope(instanceId_); for (const auto& callback : onAsyncOnCallbackList_) { if (callback) { diff --git a/frameworks/core/components_ng/pattern/ui_extension/security_ui_extension_pattern.h b/frameworks/core/components_ng/pattern/ui_extension/security_ui_extension_pattern.h index 2e5643f595b..ca56c205175 100644 --- a/frameworks/core/components_ng/pattern/ui_extension/security_ui_extension_pattern.h +++ b/frameworks/core/components_ng/pattern/ui_extension/security_ui_extension_pattern.h @@ -64,8 +64,7 @@ public: int32_t GetInstanceId(); void OnAreaChangedInner() override; - bool OnDirtyLayoutWrapperSwap( - const RefPtr& dirty, const DirtySwapConfig& config) override; + void OnSyncGeometryNode(const DirtySwapConfig& config) override; void OnWindowShow() override; void OnWindowHide() override; void OnAttachToFrameNode() override;