mirror of
https://gitee.com/openharmony/ability_dmsfwk
synced 2024-11-27 00:20:44 +00:00
Bugfix: add continuable check for sink
Signed-off-by: z00838083 <zhuhuixuan@huawei.com>
This commit is contained in:
parent
597c3be32c
commit
55260c83ba
@ -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_;
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user