diff --git a/services/bundlemgr/src/bundle_mgr_host_impl.cpp b/services/bundlemgr/src/bundle_mgr_host_impl.cpp index 9b871b7ecb3b1008ab5ce9515ef67aada02db275..ae17b05957b1fcfc854c7a4b82facf9526491649 100644 --- a/services/bundlemgr/src/bundle_mgr_host_impl.cpp +++ b/services/bundlemgr/src/bundle_mgr_host_impl.cpp @@ -817,7 +817,8 @@ bool BundleMgrHostImpl::DumpAllBundleInfos(int32_t userId, std::string &result) if (!GetBundleInfos( BundleFlag::GET_BUNDLE_WITH_ABILITIES | BundleFlag::GET_BUNDLE_WITH_EXTENSION_INFO | - BundleFlag::GET_BUNDLE_WITH_HASH_VALUE, + BundleFlag::GET_BUNDLE_WITH_HASH_VALUE | + BundleFlag::GET_BUNDLE_WITH_EXTENSION_INFO, bundleInfos, userId)) { APP_LOGE("get bundleInfos failed."); return false; @@ -840,10 +841,50 @@ bool BundleMgrHostImpl::DumpAllBundleInfos(int32_t userId, std::string &result) result.append(info.name); result.append(":\n"); - nlohmann::json jsonObject = info; - jsonObject["hapModuleInfos"] = info.hapModuleInfos; - jsonObject["userInfo"] = innerBundleUserInfos; - result.append(jsonObject.dump(Constants::DUMP_INDENT)); + nlohmann::json jsonObject; + jsonObject["bundleName"] = info.name; + jsonObject["accessible"] = info.applicationInfo.accessible; + jsonObject["userDataClearable"] = info.applicationInfo.userDataClearable; + jsonObject["keepAlive"] = info.applicationInfo.keepAlive; + jsonObject["removable"] = info.applicationInfo.removable; + jsonObject["singleton"] = info.applicationInfo.singleton; + std::string ability; + if (!info.abilityInfos.empty()) { + for (auto abilityInfo : info.abilityInfos) { + ability + .append("AA") + .append(abilityInfo.name) + .append("-") + .append(std::to_string(abilityInfo.priority)) + .append(", "); + } + + + } + + if (!info.extensionInfos.empty()) { + std::string extensionAbility; + for (auto extensionInfo : info.extensionInfos) { + extensionAbility + .append(extensionInfo.bundleName) + .append("-") + .append(std::to_string(static_cast(extensionInfo.type))) + .append(", "); + + ability + .append("EA") + .append(extensionInfo.name) + .append("-") + .append(std::to_string(extensionInfo.priority)) + .append(", "); + } + + jsonObject["extensionAbilityType"] = extensionAbility; + } + + jsonObject["priority"] = ability; + + result.append(jsonObject.dump()); result.append("\n"); } APP_LOGD("DumpAllBundleInfos successfully");