diff --git a/services/dtbschedmgr/include/mission/dms_continue_recv_manager.h b/services/dtbschedmgr/include/mission/dms_continue_recv_manager.h index 3fed2180..53167280 100644 --- a/services/dtbschedmgr/include/mission/dms_continue_recv_manager.h +++ b/services/dtbschedmgr/include/mission/dms_continue_recv_manager.h @@ -48,10 +48,11 @@ struct currentIconInfo { } currentIconInfo(const std::string &source_device_id, const std::string &source_bundle_name, - const std::string &sink_bundle_name) + const std::string &sink_bundle_name, const std::string &continueType = "") : senderNetworkId(source_device_id), bundleName(sink_bundle_name), - sourceBundleName(source_bundle_name) { + sourceBundleName(source_bundle_name), + continueType(continueType) { } currentIconInfo() = default; @@ -102,8 +103,7 @@ private: std::string &continueType); int32_t DealOnBroadcastBusiness(const std::string& senderNetworkId, uint16_t bundleNameId, uint8_t continueTypeId, const int32_t state, const int32_t retry = 0); - void NotifyRecvBroadcast(const sptr& obj, const std::string& networkId, const std::string& srcBundleName, - const std::string& sinkBundleName, const int32_t state, const std::string& continueType = ""); + void NotifyRecvBroadcast(const sptr& obj, const currentIconInfo& continueInfo, const int32_t state); bool ContinueTypeCheck(const AppExecFwk::BundleInfo& bundleInfo, const std::string& continueType); void PushLatRecvCache(currentIconInfo &lastRecvInfo); private: diff --git a/services/dtbschedmgr/src/mission/dms_continue_recv_manager.cpp b/services/dtbschedmgr/src/mission/dms_continue_recv_manager.cpp index 54d8a472..ebeb5e82 100644 --- a/services/dtbschedmgr/src/mission/dms_continue_recv_manager.cpp +++ b/services/dtbschedmgr/src/mission/dms_continue_recv_manager.cpp @@ -370,7 +370,9 @@ int32_t DMSContinueRecvMgr::DealOnBroadcastBusiness(const std::string& senderNet } std::vector> objs = iterItem->second; for (auto iter : objs) { - NotifyRecvBroadcast(iter, senderNetworkId, bundleName, finalBundleName, state, continueType); + NotifyRecvBroadcast(iter, + currentIconInfo(senderNetworkId, bundleName, finalBundleName, continueType), + state); } HILOGI("DealOnBroadcastBusiness end"); return ERR_OK; @@ -385,8 +387,13 @@ void DMSContinueRecvMgr::PushLatRecvCache(currentIconInfo &lastRecvInfo) } void DMSContinueRecvMgr::NotifyRecvBroadcast(const sptr& obj, - const std::string& networkId, const std::string& srcBundleName, const std::string& sinkBundleName, const int32_t state, const std::string& continueType) + const currentIconInfo& continueInfo, const int32_t state) { + std::string networkId = continueInfo.senderNetworkId; + std::string srcBundleName = continueInfo.sourceBundleName; + std::string sinkBundleName = continueInfo.bundleName; + std::string continueType = continueInfo.continueType.empty() ? "" : continueInfo.continueType; + HILOGI("NotifyRecvBroadcast start"); if (obj == nullptr) { HILOGE("obj is null"); @@ -478,7 +485,9 @@ void DMSContinueRecvMgr::OnDeviceScreenOff() } std::vector> objs = iterItem->second; for (auto iter : objs) { - NotifyRecvBroadcast(iter, senderNetworkId, iconInfo_.sourceBundleName, bundleName, INACTIVE, continueType); + NotifyRecvBroadcast(iter, + currentIconInfo(senderNetworkId, iconInfo_.sourceBundleName, bundleName, continueType), + INACTIVE); } } }; @@ -520,7 +529,9 @@ void DMSContinueRecvMgr::OnContinueSwitchOff() } std::vector> objs = iterItem->second; for (auto iter : objs) { - NotifyRecvBroadcast(iter, senderNetworkId, iconInfo_.sourceBundleName, bundleName, INACTIVE, continueType); + NotifyRecvBroadcast(iter, + currentIconInfo(senderNetworkId, iconInfo_.sourceBundleName, bundleName, continueType), + INACTIVE); } } }; @@ -570,7 +581,9 @@ void DMSContinueRecvMgr::NotifyDeviceOffline(const std::string& networkId) } std::vector> objs = iterItem->second; for (auto iter : objs) { - NotifyRecvBroadcast(iter, senderNetworkId, iconInfo_.sourceBundleName, bundleName, INACTIVE, continueType); + NotifyRecvBroadcast(iter, + currentIconInfo(senderNetworkId, iconInfo_.sourceBundleName, bundleName, continueType), + INACTIVE); } } HILOGI("NotifyDeviceOffline end");