From 38c66656cec8b9e11aa9a38d449f3e15b987f93c Mon Sep 17 00:00:00 2001 From: yangjun Date: Mon, 12 May 2025 22:06:02 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=E5=85=A8=E5=9C=BA=E6=99=AF=E5=AE=9E?= =?UTF-8?q?=E5=86=B5so=E5=8A=A0=E8=BD=BD=E8=B5=84=E6=BA=90=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangjun Change-Id: I9c8b60172f9b60cbcb62667347d0984985746af2 Signed-off-by: yangjun --- .../src/advanced_notification_service_ability.cpp | 1 - .../liveview_all_scenarios_extension_wrapper.cpp | 13 +++++++++++-- ...d_liveview_all_scenarios_extension_wrapper.cpp | 15 +++++++++++++-- .../src/soft_bus/distributed_manager.cpp | 2 -- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/services/ans/src/advanced_notification_service_ability.cpp b/services/ans/src/advanced_notification_service_ability.cpp index b0e410cb3..da5f6496c 100644 --- a/services/ans/src/advanced_notification_service_ability.cpp +++ b/services/ans/src/advanced_notification_service_ability.cpp @@ -64,7 +64,6 @@ void AdvancedNotificationServiceAbility::OnStart() TEL_EXTENTION_WRAPPER->InitTelExtentionWrapper(); #endif AddSystemAbilityListener(DISTRIBUTED_HARDWARE_DEVICEMANAGER_SA_ID); - LIVEVIEW_ALL_SCENARIOS_EXTENTION_WRAPPER->InitExtentionWrapper(); } void AdvancedNotificationServiceAbility::OnStop() diff --git a/services/ans/src/liveview_all_scenarios_extension_wrapper.cpp b/services/ans/src/liveview_all_scenarios_extension_wrapper.cpp index b5cb419d4..392d5335c 100644 --- a/services/ans/src/liveview_all_scenarios_extension_wrapper.cpp +++ b/services/ans/src/liveview_all_scenarios_extension_wrapper.cpp @@ -20,8 +20,14 @@ namespace OHOS::Notification { const std::string EXTENTION_LIVEVIEW_ALL_SCENARIOS_PATH = "libliveview.z.so"; -LiveviewAllScenariosExtensionWrapper::LiveviewAllScenariosExtensionWrapper() = default; -LiveviewAllScenariosExtensionWrapper::~LiveviewAllScenariosExtensionWrapper() = default; +LiveviewAllScenariosExtensionWrapper::LiveviewAllScenariosExtensionWrapper() +{ + InitExtentionWrapper(); +} +LiveviewAllScenariosExtensionWrapper::~LiveviewAllScenariosExtensionWrapper() +{ + CloseExtentionWrapper(); +} void LiveviewAllScenariosExtensionWrapper::InitExtentionWrapper() { @@ -55,7 +61,10 @@ void LiveviewAllScenariosExtensionWrapper::CloseExtentionWrapper() if (ExtensionHandle_ != nullptr) { dlclose(ExtensionHandle_); ExtensionHandle_ = nullptr; + updateLiveviewReminderFlags_ = nullptr; + updateLiveviewVoiceContent_ = nullptr; } + ANS_LOGI("liveview all scenarios extension wrapper close success"); } ErrCode LiveviewAllScenariosExtensionWrapper::UpdateLiveviewReminderFlags(const sptr &request) diff --git a/services/distributed/src/soft_bus/distributed_liveview_all_scenarios_extension_wrapper.cpp b/services/distributed/src/soft_bus/distributed_liveview_all_scenarios_extension_wrapper.cpp index 7d4112e56..944310a1b 100644 --- a/services/distributed/src/soft_bus/distributed_liveview_all_scenarios_extension_wrapper.cpp +++ b/services/distributed/src/soft_bus/distributed_liveview_all_scenarios_extension_wrapper.cpp @@ -20,8 +20,15 @@ namespace OHOS::Notification { const std::string DISTRIBUTED_EXTENTION_LIVEVIEW_ALL_SCENARIOS_PATH = "libliveview.z.so"; -DistributedLiveviewAllScenariosExtensionWrapper::DistributedLiveviewAllScenariosExtensionWrapper() = default; -DistributedLiveviewAllScenariosExtensionWrapper::~DistributedLiveviewAllScenariosExtensionWrapper() = default; +DistributedLiveviewAllScenariosExtensionWrapper::DistributedLiveviewAllScenariosExtensionWrapper() +{ + InitExtentionWrapper(); +} + +DistributedLiveviewAllScenariosExtensionWrapper::~DistributedLiveviewAllScenariosExtensionWrapper() +{ + CloseExtentionWrapper(); +} void DistributedLiveviewAllScenariosExtensionWrapper::InitExtentionWrapper() { @@ -60,7 +67,11 @@ void DistributedLiveviewAllScenariosExtensionWrapper::CloseExtentionWrapper() if (ExtensionHandle_ != nullptr) { dlclose(ExtensionHandle_); ExtensionHandle_ = nullptr; + triggerHandler_ = nullptr; + updateLiveviewEncodeContent_ = nullptr; + updateLiveviewDecodeContent_ = nullptr; } + ANS_LOGI("distributed liveview all scenarios extension wrapper close success"); } ErrCode DistributedLiveviewAllScenariosExtensionWrapper::UpdateLiveviewEncodeContent( diff --git a/services/distributed/src/soft_bus/distributed_manager.cpp b/services/distributed/src/soft_bus/distributed_manager.cpp index ba9e3910d..b5af3472e 100644 --- a/services/distributed/src/soft_bus/distributed_manager.cpp +++ b/services/distributed/src/soft_bus/distributed_manager.cpp @@ -45,7 +45,6 @@ int32_t DistributedManager::InitLocalDevice(const std::string &deviceId, uint16_ const DistributedDeviceConfig config) { ANS_LOGI("InitLocalDevice %{public}s %{public}d.", StringAnonymous(deviceId).c_str(), (int32_t)(deviceType)); - DISTRIBUTED_LIVEVIEW_ALL_SCENARIOS_EXTENTION_WRAPPER->InitExtentionWrapper(); DistributedLocalConfig::GetInstance().SetLocalDevice(config); return DistributedService::GetInstance().InitService(deviceId, deviceType); } @@ -63,7 +62,6 @@ void DistributedManager::AddDevice(const std::string &deviceId, uint16_t deviceT void DistributedManager::ReleaseDevice(const std::string &deviceId, uint16_t deviceType) { ANS_LOGI("ReleaseDevice %{public}s %{public}d.", StringAnonymous(deviceId).c_str(), (int32_t)(deviceType)); - DISTRIBUTED_LIVEVIEW_ALL_SCENARIOS_EXTENTION_WRAPPER->CloseExtentionWrapper(); DistributedClient::GetInstance().ReleaseDevice(deviceId, deviceType); DistributedService::GetInstance().UnSubscribeNotifictaion(deviceId, deviceType); } -- Gitee