mirror of
https://github.com/openharmony/appexecfwk_standard.git
synced 2026-07-19 22:14:29 -04:00
+8
-1
@@ -28,6 +28,7 @@ declare_args() {
|
||||
account_enable = true
|
||||
configpolicy_enable = true
|
||||
device_manager_enable = true
|
||||
global_resmgr_enable = true
|
||||
hicollie_enable = true
|
||||
|
||||
if (defined(global_parts_info) &&
|
||||
@@ -52,9 +53,14 @@ declare_args() {
|
||||
device_manager_enable = false
|
||||
}
|
||||
|
||||
if (defined(global_parts_info) &&
|
||||
!defined(global_parts_info.global_resmgr_standard)) {
|
||||
device_manager_enable = false
|
||||
}
|
||||
|
||||
if (defined(global_parts_info) &&
|
||||
!defined(global_parts_info.hiviewdfx_hicollie_native)) {
|
||||
hicollie_enable = false
|
||||
global_resmgr_enable = false
|
||||
}
|
||||
|
||||
if (defined(global_parts_info) &&
|
||||
@@ -70,6 +76,7 @@ declare_args() {
|
||||
print("account_enable = " + "$account_enable")
|
||||
print("configpolicy_enable = " + "$configpolicy_enable")
|
||||
print("device_manager_enable = " + "$device_manager_enable")
|
||||
print("global_resmgr_enable = " + "$global_resmgr_enable")
|
||||
print("hicollie_enable = " + "$hicollie_enable")
|
||||
print("support_jsapi = " + "$support_jsapi")
|
||||
}
|
||||
|
||||
@@ -72,17 +72,20 @@ ohos_shared_library("appexecfwk_core") {
|
||||
"ces_standard:cesfwk_innerkits",
|
||||
"hiviewdfx_hilog_native:libhilog",
|
||||
"ipc:ipc_core",
|
||||
"resmgr_standard:global_resmgr",
|
||||
"samgr_standard:samgr_proxy",
|
||||
"utils_base:utils",
|
||||
]
|
||||
|
||||
if (bundle_framework_graphics) {
|
||||
defines += [ "SUPPORT_GRAPHICS" ]
|
||||
|
||||
external_deps += [ "multimedia_image_standard:image_native" ]
|
||||
}
|
||||
|
||||
if (global_resmgr_enable) {
|
||||
defines += [ "GLOBAL_RESMGR_ENABLE" ]
|
||||
external_deps += [ "resmgr_standard:global_resmgr" ]
|
||||
}
|
||||
|
||||
subsystem_name = "appexecfwk"
|
||||
part_name = "bundle_framework"
|
||||
}
|
||||
|
||||
@@ -22,7 +22,9 @@
|
||||
#include "bundle_mgr_interface.h"
|
||||
#include "extension_ability_info.h"
|
||||
#include "hap_module_info.h"
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
#include "resource_manager.h"
|
||||
#endif
|
||||
|
||||
namespace OHOS {
|
||||
namespace AppExecFwk {
|
||||
@@ -45,9 +47,11 @@ private:
|
||||
ErrCode Connect();
|
||||
bool GetResProfileByMetadata(const std::vector<Metadata> &metadata, const std::string &metadataName,
|
||||
const std ::string &resourcePath, std::vector<std::string> &profileInfos) const;
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
std::shared_ptr<Global::Resource::ResourceManager> InitResMgr(const std::string &resourcePath) const;
|
||||
bool GetResFromResMgr(const std::string &resName, const std::shared_ptr<Global::Resource::ResourceManager> &resMgr,
|
||||
std::vector<std::string> &profileInfos) const;
|
||||
#endif
|
||||
bool IsFileExisted(const std::string &filePath, const std::string &suffix) const;
|
||||
bool TransformFileToJsonString(const std::string &resPath, std::string &profile) const;
|
||||
|
||||
|
||||
@@ -26,7 +26,9 @@
|
||||
#include "nlohmann/json.hpp"
|
||||
#include "system_ability_definition.h"
|
||||
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
using namespace OHOS::Global::Resource;
|
||||
#endif
|
||||
|
||||
namespace OHOS {
|
||||
namespace AppExecFwk {
|
||||
@@ -146,6 +148,7 @@ std::vector<std::string> BundleMgrClientImpl::GetAccessibleAppCodePaths(int32_t
|
||||
bool BundleMgrClientImpl::GetResProfileByMetadata(const std::vector<Metadata> &metadata,
|
||||
const std::string &metadataName, const std ::string &resourcePath, std::vector<std::string> &profileInfos) const
|
||||
{
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
if (metadata.empty()) {
|
||||
APP_LOGE("GetResProfileByMetadata failed due to empty metadata");
|
||||
return false;
|
||||
@@ -176,8 +179,13 @@ bool BundleMgrClientImpl::GetResProfileByMetadata(const std::vector<Metadata> &m
|
||||
}
|
||||
|
||||
return true;
|
||||
#else
|
||||
APP_LOGW("GLOBAL_RESMGR_ENABLE is false");
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
std::shared_ptr<ResourceManager> BundleMgrClientImpl::InitResMgr(const std::string &resourcePath) const
|
||||
{
|
||||
APP_LOGD("InitResMgr begin");
|
||||
@@ -234,6 +242,7 @@ bool BundleMgrClientImpl::GetResFromResMgr(const std::string &resName, const std
|
||||
profileInfos.emplace_back(profile);
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool BundleMgrClientImpl::IsFileExisted(const std::string &filePath, const std::string &suffix) const
|
||||
{
|
||||
|
||||
@@ -187,7 +187,6 @@ ohos_shared_library("libbms") {
|
||||
"hiviewdfx_hilog_native:libhilog",
|
||||
"init:libbegetutil",
|
||||
"ipc:ipc_core",
|
||||
"resmgr_standard:global_resmgr",
|
||||
"safwk:system_ability_fwk",
|
||||
"samgr_standard:samgr_proxy",
|
||||
"startup_l2:syspara",
|
||||
@@ -234,6 +233,11 @@ ohos_shared_library("libbms") {
|
||||
defines += [ "DEVICE_MANAGER_ENABLE" ]
|
||||
}
|
||||
|
||||
if (global_resmgr_enable) {
|
||||
defines += [ "GLOBAL_RESMGR_ENABLE" ]
|
||||
external_deps += [ "resmgr_standard:global_resmgr" ]
|
||||
}
|
||||
|
||||
if (hicollie_enable) {
|
||||
external_deps += [ "hicollie_native:libhicollie" ]
|
||||
defines += [ "HICOLLIE_ENABLE" ]
|
||||
|
||||
@@ -41,7 +41,9 @@
|
||||
#include "pixel_map.h"
|
||||
#endif
|
||||
#include "preinstall_data_storage.h"
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
#include "resource_manager.h"
|
||||
#endif
|
||||
#include "target_ability_info.h"
|
||||
|
||||
namespace OHOS {
|
||||
@@ -818,8 +820,10 @@ private:
|
||||
std::vector<ExtensionAbilityInfo> &extensionInfos) const;
|
||||
void GetMatchExtensionInfos(const Want &want, int32_t flags, const int32_t &userId, const InnerBundleInfo &info,
|
||||
std::vector<ExtensionAbilityInfo> &einfos) const;
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
std::shared_ptr<Global::Resource::ResourceManager> GetResourceManager(
|
||||
const AppExecFwk::BundleInfo &bundleInfo) const;
|
||||
#endif
|
||||
#ifdef SUPPORT_GRAPHICS
|
||||
std::shared_ptr<Media::PixelMap> LoadImageFile(const std::string &path) const;
|
||||
#endif
|
||||
|
||||
@@ -1172,6 +1172,7 @@ bool BundleDataMgr::QueryKeepAliveBundleInfos(std::vector<BundleInfo> &bundleInf
|
||||
|
||||
std::string BundleDataMgr::GetAbilityLabel(const std::string &bundleName, const std::string &className) const
|
||||
{
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
std::lock_guard<std::mutex> lock(bundleInfoMutex_);
|
||||
if (bundleInfos_.empty()) {
|
||||
APP_LOGW("bundleInfos_ data is empty");
|
||||
@@ -1209,6 +1210,10 @@ std::string BundleDataMgr::GetAbilityLabel(const std::string &bundleName, const
|
||||
} else {
|
||||
return abilityLabel;
|
||||
}
|
||||
#else
|
||||
APP_LOGW("GLOBAL_RESMGR_ENABLE is false");
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool BundleDataMgr::GetHapModuleInfo(
|
||||
@@ -1606,6 +1611,7 @@ std::string BundleDataMgr::GetAbilityIcon(const std::string &bundleName, const s
|
||||
std::shared_ptr<Media::PixelMap> BundleDataMgr::GetAbilityPixelMapIcon(const std::string &bundleName,
|
||||
const std::string &abilityName) const
|
||||
{
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
std::lock_guard<std::mutex> lock(bundleInfoMutex_);
|
||||
if (bundleInfos_.empty()) {
|
||||
APP_LOGW("bundleInfos_ data is empty");
|
||||
@@ -1644,6 +1650,10 @@ std::shared_ptr<Media::PixelMap> BundleDataMgr::GetAbilityPixelMapIcon(const std
|
||||
return nullptr;
|
||||
}
|
||||
return pixelMapPtr;
|
||||
#else
|
||||
APP_LOGW("GLOBAL_RESMGR_ENABLE is false");
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2827,6 +2837,7 @@ void BundleDataMgr::GetAllUriPrefix(std::vector<std::string> &uriPrefixList, int
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef GLOBAL_RESMGR_ENABLE
|
||||
std::shared_ptr<Global::Resource::ResourceManager> BundleDataMgr::GetResourceManager(
|
||||
const AppExecFwk::BundleInfo &bundleInfo) const
|
||||
{
|
||||
@@ -2845,6 +2856,7 @@ std::shared_ptr<Global::Resource::ResourceManager> BundleDataMgr::GetResourceMan
|
||||
resourceManager->UpdateResConfig(*resConfig);
|
||||
return resourceManager;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef BUNDLE_FRAMEWORK_FREE_INSTALL
|
||||
bool BundleDataMgr::GetRemovableBundleNameVec(std::map<std::string, int>& bundlenameAndUids)
|
||||
|
||||
Reference in New Issue
Block a user