From b0d51059f8ce53e1e4987c3560d6e1bb15ecc869 Mon Sep 17 00:00:00 2001 From: jiangminsen Date: Thu, 14 Aug 2025 10:17:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E6=B1=82=E6=8E=A5=E5=8F=A3=E6=9B=B4?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: jiangminsen --- services/dbms/sa_profile/distributedbms.cfg | 1 + services/dbms/src/distributed_data_storage.cpp | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/services/dbms/sa_profile/distributedbms.cfg b/services/dbms/sa_profile/distributedbms.cfg index e104958..20a29d6 100644 --- a/services/dbms/sa_profile/distributedbms.cfg +++ b/services/dbms/sa_profile/distributedbms.cfg @@ -16,6 +16,7 @@ "permission": [ "ohos.permission.DISTRIBUTED_DATASYNC", "ohos.permission.GET_BUNDLE_INFO_PRIVILEGED", + "ohos.permission.GET_INSTALLED_BUNDLE_LIST", "ohos.permission.ACCESS_SERVICE_DM", "ohos.permission.MANAGE_LOCAL_ACCOUNTS", "ohos.permission.GET_BUNDLE_RESOURCES" diff --git a/services/dbms/src/distributed_data_storage.cpp b/services/dbms/src/distributed_data_storage.cpp index bbb411f..f7e4ff0 100644 --- a/services/dbms/src/distributed_data_storage.cpp +++ b/services/dbms/src/distributed_data_storage.cpp @@ -35,9 +35,10 @@ const int32_t MINIMUM_WAITING_TIME = 180; //3 mins const int32_t MAX_TIMES = 600; // 1min const int32_t PRINTF_LENGTH = 8; // print length of udid const int32_t SLEEP_INTERVAL = 100 * 1000; // 100ms -const int32_t FLAGS = BundleFlag::GET_BUNDLE_WITH_ABILITIES | - ApplicationFlag::GET_APPLICATION_INFO_WITH_DISABLE | - AbilityInfoFlag::GET_ABILITY_INFO_WITH_DISABLE; +const int32_t FLAGS = static_cast(GetBundleInfoFlag::GET_BUNDLE_INFO_WITH_ABILITY) | + static_cast(GetBundleInfoFlag::GET_BUNDLE_INFO_WITH_HAP_MODULE) | + static_cast(GetBundleInfoFlag::GET_BUNDLE_INFO_WITH_APPLICATION) | + static_cast(GetBundleInfoFlag::GET_BUNDLE_INFO_WITH_DISABLE); const uint32_t DEVICE_UDID_LENGTH = 65; const std::string EMPTY_DEVICE_ID = ""; } // namespace @@ -92,8 +93,8 @@ void DistributedDataStorage::SaveStorageDistributeInfo(const std::string &bundle return; } BundleInfo bundleInfo; - bool ret = bundleMgr->GetBundleInfo(bundleName, FLAGS, bundleInfo, currentUserId); - if (!ret) { + auto ret = bundleMgr->GetBundleInfoV9(bundleName, FLAGS, bundleInfo, currentUserId); + if (ret != ERR_OK) { APP_LOGW("GetBundleInfo:%{public}s userid:%{public}d failed", bundleName.c_str(), currentUserId); DeleteStorageDistributeInfo(bundleName, currentUserId); return; @@ -440,7 +441,7 @@ void DistributedDataStorage::UpdateDistributedData(int32_t userId) return; } std::vector bundleInfos; - if (!bundleMgr->GetBundleInfos(FLAGS, bundleInfos, userId)) { + if (bundleMgr->GetBundleInfosV9(FLAGS, bundleInfos, userId) != ERR_OK) { APP_LOGE("get bundleInfos failed"); return; } -- Gitee