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 2e94610ef7a171bde3b12ce47abf0b4b5518d333..6feac5debe299a3e592dd29c60fe649fbdcefca7 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 d06799a5ba6632f41fb62c298b3d3e84435c198b..599a7800fea7678db4ea89dfd00161014d5a0298 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 ecb5383544718b64cf148f61acacb5038a110fe6..a58a02945fcbbe3bc7e1128989d48ccd414fe5a5 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; }