From 64b256db0ca662735077f6235a45b326607e58a3 Mon Sep 17 00:00:00 2001 From: wangsen1994 Date: Fri, 27 Jun 2025 18:08:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E7=94=A8=E9=97=AD=E6=BA=90=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=EF=BC=8C=E5=A2=9E=E5=8A=A0deviceType=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangsen1994 --- ...ibuted_liveview_all_scenarios_extension_wrapper.h | 10 ++++++---- ...uted_liveview_all_scenarios_extension_wrapper.cpp | 12 ++++++------ .../src/soft_bus/distributed_publish_service_v2.cpp | 9 +++++++-- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/services/distributed/include/base/distributed_liveview_all_scenarios_extension_wrapper.h b/services/distributed/include/base/distributed_liveview_all_scenarios_extension_wrapper.h index 2e94610ef..6feac5deb 100644 --- a/services/distributed/include/base/distributed_liveview_all_scenarios_extension_wrapper.h +++ b/services/distributed/include/base/distributed_liveview_all_scenarios_extension_wrapper.h @@ -29,10 +29,11 @@ public: void InitExtentionWrapper(); void CloseExtentionWrapper(); typedef ErrCode (*UPDATE_LIVEVIEW_ENCODE_CONTENT)(const sptr &request, - std::vector &buffer); - ErrCode UpdateLiveviewEncodeContent(const sptr &request, std::vector &buffer); + std::vector &buffer, const std::string& deviceType); + ErrCode UpdateLiveviewEncodeContent(const sptr &request, std::vector &buffer, + const std::string& deviceType); typedef ErrCode (*UPDATE_LIVEVIEW_DECODE_CONTENT)(const sptr &request, - std::vector &buffer); + std::vector &buffer, const std::string& deviceType); typedef ErrCode (*TRIGGER_PUSH_WANT_AGENT)(const sptr &request, int32_t actionType, const AAFwk::WantParams extraInfo); typedef ErrCode (*SUBSCRIBE_ALL_CONNECT)(); @@ -40,7 +41,8 @@ public: typedef ErrCode (*LIVE_VIEW_MULTI_SCREEN_SYNC_OPER)( sptr &request, const int32_t operationType, const int32_t btnIndex); typedef ErrCode (*RESTORE_COLLABORATION_WINDOW)(const std::string &networkId); - ErrCode UpdateLiveviewDecodeContent(const sptr &request, std::vector &buffer); + ErrCode UpdateLiveviewDecodeContent(const sptr &request, std::vector &buffer, + const std::string& deviceType); ErrCode TriggerPushWantAgent(const sptr &request, int32_t actionType, const AAFwk::WantParams extraInfo); ErrCode SubscribeAllConnect(); diff --git a/services/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp b/services/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp index d06799a5b..599a7800f 100644 --- a/services/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp +++ b/services/distributed/src/base/distributed_liveview_all_scenarios_extension_wrapper.cpp @@ -39,7 +39,7 @@ void DistributedLiveviewAllScenariosExtensionWrapper::InitExtentionWrapper() } updateLiveviewEncodeContent_ = (UPDATE_LIVEVIEW_ENCODE_CONTENT)dlsym(ExtensionHandle_, - "UpdateLiveviewEncodeContent"); + "UpdateLiveviewEncodeTlv"); if (updateLiveviewEncodeContent_ == nullptr) { ANS_LOGE("distributed liveview all scenarios extension wrapper dlsym updateLiveviewEncodeContent_ failed, " "error: %{public}s", dlerror()); @@ -47,7 +47,7 @@ void DistributedLiveviewAllScenariosExtensionWrapper::InitExtentionWrapper() } updateLiveviewDecodeContent_ = (UPDATE_LIVEVIEW_DECODE_CONTENT)dlsym(ExtensionHandle_, - "UpdateLiveviewDecodeContent"); + "UpdateLiveviewDecodeTlv"); if (updateLiveviewDecodeContent_ == nullptr) { ANS_LOGE("distributed liveview all scenarios extension wrapper dlsym updateLiveviewDecodeContent_ failed, " "error: %{public}s", dlerror()); @@ -103,23 +103,23 @@ void DistributedLiveviewAllScenariosExtensionWrapper::CloseExtentionWrapper() } ErrCode DistributedLiveviewAllScenariosExtensionWrapper::UpdateLiveviewEncodeContent( - const sptr &request, std::vector &buffer) + const sptr &request, std::vector &buffer, const std::string& deviceType) { if (updateLiveviewEncodeContent_ == nullptr) { ANS_LOGE("distributed UpdateLiveviewEncodeContent wrapper symbol failed"); return 0; } - return updateLiveviewEncodeContent_(request, buffer); + return updateLiveviewEncodeContent_(request, buffer, deviceType); } ErrCode DistributedLiveviewAllScenariosExtensionWrapper::UpdateLiveviewDecodeContent( - const sptr &request, std::vector &buffer) + const sptr &request, std::vector &buffer, const std::string& deviceType) { if (updateLiveviewDecodeContent_ == nullptr) { ANS_LOGE("distributed UpdateLiveviewDecodeContent wrapper symbol failed"); return 0; } - return updateLiveviewDecodeContent_(request, buffer); + return updateLiveviewDecodeContent_(request, buffer, deviceType); } ErrCode DistributedLiveviewAllScenariosExtensionWrapper::TriggerPushWantAgent( diff --git a/services/distributed/src/soft_bus/distributed_publish_service_v2.cpp b/services/distributed/src/soft_bus/distributed_publish_service_v2.cpp index ecb538354..a58a02945 100644 --- a/services/distributed/src/soft_bus/distributed_publish_service_v2.cpp +++ b/services/distributed/src/soft_bus/distributed_publish_service_v2.cpp @@ -395,7 +395,9 @@ void DistributedPublishService::SendNotifictionRequest(const std::shared_ptrIsCommonLiveView()) { std::vector buffer; - DISTRIBUTED_LIVEVIEW_ALL_SCENARIOS_EXTENTION_WRAPPER->UpdateLiveviewEncodeContent(requestPoint, buffer); + std::string deviceType = DistributedDeviceService::DeviceTypeToTypeString(peerDevice.deviceType_); + DISTRIBUTED_LIVEVIEW_ALL_SCENARIOS_EXTENTION_WRAPPER->UpdateLiveviewEncodeContent( + requestPoint, buffer, deviceType); requestBox->SetCommonLiveView(buffer); } SetNotificationExtendInfo(requestPoint, peerDevice.deviceType_, requestBox); @@ -821,7 +823,10 @@ void DistributedPublishService::MakeNotificationContent(const NotificationReques request->SetContent(content); std::shared_ptr extraInfo = std::make_shared(); liveviewContent->SetExtraInfo(extraInfo); - DISTRIBUTED_LIVEVIEW_ALL_SCENARIOS_EXTENTION_WRAPPER->UpdateLiveviewDecodeContent(request, buffer); + auto localDevice = DistributedDeviceService::GetInstance().GetLocalDevice(); + std::string deviceType = DistributedDeviceService::DeviceTypeToTypeString(localDevice.deviceType_); + DISTRIBUTED_LIVEVIEW_ALL_SCENARIOS_EXTENTION_WRAPPER->UpdateLiveviewDecodeContent( + request, buffer, deviceType); } return; } -- Gitee