modify bms dep

Signed-off-by: changzheng6 <hanfeng6@huawei.com>
This commit is contained in:
changzheng6 2022-03-20 11:12:52 +08:00
parent 5fd22150d5
commit 4157656419
8 changed files with 62 additions and 13 deletions

View File

@ -22,5 +22,15 @@ innerkits_path = "${appexecfwk_path}/interfaces/innerkits"
tools_path = "${appexecfwk_path}/tools"
declare_args() {
bundle_framework_graphics = true
hicollie_enable = true
if (defined(global_parts_info) &&
!defined(global_parts_info.hiviewdfx_hicollie_native)) {
hicollie_enable = false
}
print("bundle_framework_graphics = " + "$bundle_framework_graphics")
print("hicollie_enable = " + "$hicollie_enable")
print("support_jsapi = " + "$support_jsapi")
}

View File

@ -33,12 +33,10 @@
"distributeddatamgr",
"eventhandler",
"hiviewdfx_hilog_native",
"i18n_standard",
"init",
"ipc",
"napi",
"os_account_standard",
"permission_standard",
"safwk",
"resmgr_standard",
"samgr_standard",
@ -60,7 +58,6 @@
"//foundation/appexecfwk/standard/sa_profile:appexecfwk_sa_profile",
"//foundation/appexecfwk/standard/sa_profile:foundation.rc",
"//foundation/appexecfwk/standard/services/bundlemgr:bms_target",
"//foundation/appexecfwk/standard/kits/appkit/napi/bundlemgr:bundle",
"//foundation/appexecfwk/standard/kits/appkit/napi:napi_packages",
"//foundation/appexecfwk/standard/test/resource/bmssystemtestability/abilitySrc:bms_system_test_app",
"//foundation/appexecfwk/standard/tools/zip:tools_zip"

View File

@ -14,8 +14,12 @@
import("//build/ohos.gni")
group("napi_packages") {
deps = [
"//foundation/appexecfwk/standard/kits/appkit/napi/launchermgr:innerbundlemanager",
"//foundation/appexecfwk/standard/kits/appkit/napi/package:package",
]
deps = []
if (support_jsapi) {
deps += [
"bundlemgr:bundle",
"launchermgr:innerbundlemanager",
"package:package",
]
}
}

View File

@ -43,3 +43,11 @@ ohos_shared_library("distributedbundle") {
subsystem_name = "appexecfwk"
part_name = "distributed_bundle_framework"
}
group("jsapi_target") {
deps = []
if (support_jsapi) {
deps += [ ":distributedbundle" ]
}
}

View File

@ -175,7 +175,6 @@ ohos_shared_library("libbms") {
"device_manager_base:devicemanagersdk",
"distributeddatamgr:distributeddata_inner",
"eventhandler:libeventhandler",
"hicollie_native:libhicollie",
"hiviewdfx_hilog_native:libhilog",
"init:libbegetutil",
"ipc:ipc_core",
@ -190,6 +189,11 @@ ohos_shared_library("libbms") {
defines += [ "SUPPORT_GRAPHICS" ]
}
if (hicollie_enable) {
external_deps += [ "hicollie_native:libhicollie" ]
defines += [ "HICOLLIE_ENABLE" ]
}
subsystem_name = "appexecfwk"
part_name = "bundle_framework"
}

25
services/bundlemgr/src/bundle_installer_manager.cpp Executable file → Normal file
View File

@ -20,17 +20,22 @@
#include "appexecfwk_errors.h"
#include "app_log_wrapper.h"
#include "datetime_ex.h"
#ifdef HICOLLIE_ENABLE
#include "xcollie/xcollie.h"
#include "xcollie/xcollie_define.h"
#endif
namespace OHOS {
namespace AppExecFwk {
namespace {
const std::string ADD_INSTALLER_FAIL = "fail to add installer in bundle installer manager";
#ifdef HICOLLIE_ENABLE
const std::string INSTALL_TASK = "Install_Task";
const std::string UNINSTALL_TASK = "Uninstall_Task";
const std::string RECOVER_TASK = "Recover_Task";
const unsigned int TIME_OUT_SECONDS = 60 * 5;
#endif
}
BundleInstallerManager::BundleInstallerManager(const std::shared_ptr<EventRunner> &runner) : EventHandler(runner)
@ -67,10 +72,14 @@ void BundleInstallerManager::CreateInstallTask(
return;
}
auto task = [installer, bundleFilePath, installParam] {
#ifdef HICOLLIE_ENABLE
int timerId = HiviewDFX::XCollie::GetInstance().SetTimer(INSTALL_TASK, TIME_OUT_SECONDS,
nullptr, nullptr, HiviewDFX::XCOLLIE_FLAG_LOG);
#endif
installer->Install(bundleFilePath, installParam);
#ifdef HICOLLIE_ENABLE
HiviewDFX::XCollie::GetInstance().CancelTimer(timerId);
#endif
};
installersPool_.AddTask(task);
}
@ -84,10 +93,14 @@ void BundleInstallerManager::CreateRecoverTask(
return;
}
auto task = [installer, bundleName, installParam] {
#ifdef HICOLLIE_ENABLE
int timerId = HiviewDFX::XCollie::GetInstance().SetTimer(RECOVER_TASK, TIME_OUT_SECONDS,
nullptr, nullptr, HiviewDFX::XCOLLIE_FLAG_LOG);
#endif
installer->Recover(bundleName, installParam);
#ifdef HICOLLIE_ENABLE
HiviewDFX::XCollie::GetInstance().CancelTimer(timerId);
#endif
};
installersPool_.AddTask(task);
}
@ -101,10 +114,14 @@ void BundleInstallerManager::CreateInstallTask(const std::vector<std::string> &b
return;
}
auto task = [installer, bundleFilePaths, installParam] {
#ifdef HICOLLIE_ENABLE
int timerId = HiviewDFX::XCollie::GetInstance().SetTimer(INSTALL_TASK, TIME_OUT_SECONDS,
nullptr, nullptr, HiviewDFX::XCOLLIE_FLAG_LOG);
#endif
installer->Install(bundleFilePaths, installParam);
#ifdef HICOLLIE_ENABLE
HiviewDFX::XCollie::GetInstance().CancelTimer(timerId);
#endif
};
installersPool_.AddTask(task);
}
@ -118,10 +135,14 @@ void BundleInstallerManager::CreateUninstallTask(
return;
}
auto task = [installer, bundleName, installParam] {
#ifdef HICOLLIE_ENABLE
int timerId = HiviewDFX::XCollie::GetInstance().SetTimer(UNINSTALL_TASK, TIME_OUT_SECONDS,
nullptr, nullptr, HiviewDFX::XCOLLIE_FLAG_LOG);
#endif
installer->Uninstall(bundleName, installParam);
#ifdef HICOLLIE_ENABLE
HiviewDFX::XCollie::GetInstance().CancelTimer(timerId);
#endif
};
installersPool_.AddTask(task);
}
@ -135,10 +156,14 @@ void BundleInstallerManager::CreateUninstallTask(const std::string &bundleName,
return;
}
auto task = [installer, bundleName, modulePackage, installParam] {
#ifdef HICOLLIE_ENABLE
int timerId = HiviewDFX::XCollie::GetInstance().SetTimer(UNINSTALL_TASK, TIME_OUT_SECONDS,
nullptr, nullptr, HiviewDFX::XCOLLIE_FLAG_LOG);
#endif
installer->Uninstall(bundleName, modulePackage, installParam);
#ifdef HICOLLIE_ENABLE
HiviewDFX::XCollie::GetInstance().CancelTimer(timerId);
#endif
};
installersPool_.AddTask(task);
}

View File

@ -38,7 +38,7 @@
},
"build": {
"sub_component": [
"//foundation/appexecfwk/standard/kits/appkit/napi/distributebundlemgr:distributedbundle",
"//foundation/appexecfwk/standard/kits/appkit/napi/distributebundlemgr:jsapi_target",
"//foundation/appexecfwk/standard/services/dbms:dbms_target",
"//foundation/appexecfwk/standard/services/dbms/sa_profile:distributedbms"
],

9
tools/zip/BUILD.gn Executable file → Normal file
View File

@ -80,8 +80,9 @@ ohos_shared_library("z") {
}
group("tools_zip") {
deps = [
":z",
":zlib",
]
deps = [ ":z" ]
if (support_jsapi) {
deps += [ ":zlib" ]
}
}