!1035 通过GetBundleInfosForContinuation接口只查询支持接续的包信息

Merge pull request !1035 from liuhongjie/master
This commit is contained in:
openharmony_ci 2024-08-16 09:58:44 +00:00 committed by Gitee
commit 977ff50780
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -692,24 +692,21 @@ void DmsBmStorage::UpdateDistributedData()
return;
}
std::vector<AppExecFwk::BundleInfo> bundleInfos;
if (!bundleMgr->GetBundleInfos(FLAGS, bundleInfos, AppExecFwk::Constants::ALL_USERID)) {
if (!bundleMgr->GetBundleInfosForContinuation(FLAGS, bundleInfos, AppExecFwk::Constants::ALL_USERID)) {
HILOGE("get bundleInfos failed");
return;
}
HILOGI("bundleInfos size: %{public}zu", bundleInfos.size());
std::vector<std::string> bundleNames;
for (const auto &bundleInfo : bundleInfos) {
if (IsContinuable(bundleInfo)) {
bundleNames.push_back(bundleInfo.name);
}
bundleNames.push_back(bundleInfo.name);
}
std::map<std::string, DmsBundleInfo> oldDistributedBundleInfos =
GetAllOldDistributionBundleInfo(bundleNames);
std::vector<DmsBundleInfo> dmsBundleInfos;
for (const auto &bundleInfo : bundleInfos) {
if (bundleInfo.singleton || !IsContinuable(bundleInfo)) {
continue;
}
if (oldDistributedBundleInfos.find(bundleInfo.name) != oldDistributedBundleInfos.end()) {
int64_t updateTime = oldDistributedBundleInfos[bundleInfo.name].updateTime;
if (updateTime != bundleInfo.updateTime) {