diff --git a/services/dbms/sa_profile/distributedbms.cfg b/services/dbms/sa_profile/distributedbms.cfg index e104958651c1b2e0ac7ea54c65c417957eeda395..20a29d6d23db288ef66890f441040a168e3a43e4 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 bbb411f4be28ddfd14441646755f308e6009251d..f7e4ff09992111ca39a1fa49159aad6cca256e97 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; }