diff --git a/frameworks/bundle_lite/src/slite/bundlems_slite_client.cpp b/frameworks/bundle_lite/src/slite/bundlems_slite_client.cpp index 5aa81a6..add659c 100755 --- a/frameworks/bundle_lite/src/slite/bundlems_slite_client.cpp +++ b/frameworks/bundle_lite/src/slite/bundlems_slite_client.cpp @@ -27,6 +27,7 @@ #include "want_utils.h" namespace OHOS { +const unsigned int BMS_INSTALL_MSG = 100; const unsigned int ERROR_SLEEP_TIMES = 300; const unsigned int RETRY_TIMES = 10; Bmsbuff *g_bmsbuff = nullptr; diff --git a/services/bundlemgr_lite/include/bundle_mgr_service.h b/services/bundlemgr_lite/include/bundle_mgr_service.h index 7bbcc5a..fcddf8e 100755 --- a/services/bundlemgr_lite/include/bundle_mgr_service.h +++ b/services/bundlemgr_lite/include/bundle_mgr_service.h @@ -21,7 +21,6 @@ #include "nocopyable.h" namespace OHOS { -const unsigned int BMS_INSTALL_MSG = 100; const unsigned int BMS_UNINSTALL_MSG = 101; const unsigned int BMS_SCAN_PACKAGE_MSG = 102; const unsigned int BMS_REGISTER_CALLBACK_MSG = 103; diff --git a/services/bundlemgr_lite/include/bundle_mgr_slite_feature.h b/services/bundlemgr_lite/include/bundle_mgr_slite_feature.h index d9ff3bc..7e94047 100755 --- a/services/bundlemgr_lite/include/bundle_mgr_slite_feature.h +++ b/services/bundlemgr_lite/include/bundle_mgr_slite_feature.h @@ -40,6 +40,7 @@ public: static bool RegisterInstallerCallback(InstallerCallback installerCallback); static void UpdateBundleInfoList(); static uint8_t GetBundleInfosNoReplication(const int flags, BundleInfo **bundleInfos, int32_t *len); + static void Init(); static BundleMgrSliteFeature *GetInstance() { diff --git a/services/bundlemgr_lite/src/bundle_mgr_service.cpp b/services/bundlemgr_lite/src/bundle_mgr_service.cpp index 72c9676..475a288 100755 --- a/services/bundlemgr_lite/src/bundle_mgr_service.cpp +++ b/services/bundlemgr_lite/src/bundle_mgr_service.cpp @@ -17,6 +17,7 @@ #include "bundle_service_interface.h" #include "bundlems_log.h" +#include "bundle_mgr_slite_feature.h" #include "gt_bundle_manager_service.h" #include "ohos_init.h" #include "samgr_lite.h" @@ -40,6 +41,7 @@ static void Init() CHECK_NULLPTR_RETURN(sm, "BundleManagerService", "get samgr error"); #ifdef __LITEOS_M__ sm->RegisterService(BundleMgrService::GetInstance()); + BundleMgrSliteFeature::Init(); #else BOOL result = sm->RegisterService(BundleMgrService::GetInstance()); PRINTI("BundleManagerService", "bms starts %{public}s", result ? "successfully" : "unsuccessfully"); diff --git a/services/bundlemgr_lite/src/bundle_mgr_slite_feature.cpp b/services/bundlemgr_lite/src/bundle_mgr_slite_feature.cpp index 2e1d201..f9c234e 100755 --- a/services/bundlemgr_lite/src/bundle_mgr_slite_feature.cpp +++ b/services/bundlemgr_lite/src/bundle_mgr_slite_feature.cpp @@ -39,7 +39,7 @@ BundleMgrSliteFeatureImpl g_bmsSliteImpl = { DEFAULT_IUNKNOWN_ENTRY_END }; -static void Init() +void BundleMgrSliteFeature::Init() { SamgrLite *samgrLite = SAMGR_GetInstance(); CHECK_NULLPTR_RETURN(samgrLite, "BundleMgrSliteFeature", "get samgr error");