Bugfix: add continuable check for sink

Signed-off-by: z00838083 <zhuhuixuan@huawei.com>
This commit is contained in:
z00838083 2024-10-18 18:42:30 +08:00
parent 597c3be32c
commit 55260c83ba
2 changed files with 15 additions and 0 deletions

View File

@ -105,6 +105,7 @@ private:
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<IRemoteObject>& obj, const currentIconInfo& continueInfo, const int32_t state);
bool IsBundleContinuable(const AppExecFwk::BundleInfo& bundleInfo);
private:
currentIconInfo iconInfo_;
sptr<DistributedMissionDiedListener> missionDiedListener_;

View File

@ -338,6 +338,10 @@ int32_t DMSContinueRecvMgr::DealOnBroadcastBusiness(const std::string& senderNet
HILOGE("The bundleType must be app, but it is %{public}d", localBundleInfo.applicationInfo.bundleType);
return INVALID_PARAMETERS_ERR;
}
if (!IsBundleContinuable(localBundleInfo)) {
HILOGE("Bundle %{public}s is not continuable", finalBundleName.c_str());
return INVALID_PARAMETERS_ERR;
}
int32_t ret = VerifyBroadcastSource(senderNetworkId, bundleName, finalBundleName, continueType, state);
if (ret != ERR_OK) {
@ -359,6 +363,16 @@ int32_t DMSContinueRecvMgr::DealOnBroadcastBusiness(const std::string& senderNet
return ERR_OK;
}
bool DMSContinueRecvMgr::IsBundleContinuable(const AppExecFwk::BundleInfo& bundleInfo)
{
for (auto abilityInfo : bundleInfo.abilityInfos) {
if (abilityInfo.continuable) {
return true;
}
}
return false;
}
void DMSContinueRecvMgr::NotifyRecvBroadcast(const sptr<IRemoteObject>& obj,
const currentIconInfo& continueInfo, const int32_t state)
{