From 0616de2fba25f7423da1a77cf81688a0af72f14c Mon Sep 17 00:00:00 2001 From: yangzk Date: Fri, 21 Apr 2023 11:48:07 +0800 Subject: [PATCH] =?UTF-8?q?Description:=20=E4=BF=AE=E6=AD=A3LITEOS=5FM?= =?UTF-8?q?=E4=B8=8A=E7=9A=84=E5=AE=8F=E5=BC=80=E5=85=B3=20IssueNo:=20#I6X?= =?UTF-8?q?LE2=20Sig:=20SIG=5FApplicationFramework=20Feature=20or=20Bugfix?= =?UTF-8?q?:=20Bugfix=20Binary=20Source:=20No?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: yangzk Change-Id: I135ed4311b12edb1c81d8658f0c977deeebd079f --- frameworks/abilitymgr_lite/src/ability_kit.cpp | 4 ++-- services/abilitymgr_lite/BUILD.gn | 7 +++++++ services/abilitymgr_lite/include/util/abilityms_log.h | 2 +- .../src/slite/ability_mgr_service_slite.cpp | 6 +++--- .../abilitymgr_lite/src/slite/ability_record_manager.cpp | 2 +- 5 files changed, 14 insertions(+), 7 deletions(-) diff --git a/frameworks/abilitymgr_lite/src/ability_kit.cpp b/frameworks/abilitymgr_lite/src/ability_kit.cpp index b220232..b892daa 100644 --- a/frameworks/abilitymgr_lite/src/ability_kit.cpp +++ b/frameworks/abilitymgr_lite/src/ability_kit.cpp @@ -55,7 +55,7 @@ int32_t AbilityKit::SendMsgResourceRelease() } } // namespace OHOS -#ifdef APP_PLATFORM_WATCHGT +#ifdef __LITEOS_M__ extern "C" { int32_t RegisterReceiver(const char *bundleName, SuccessCallback success, FailCallback fail) { @@ -73,4 +73,4 @@ int32_t SendMsgToPeerApp(bool isLocalMsg, const char *callingPkgName, const char return OHOS::AbilityKit::SendMsgToPeerApp(isLocalMsg, callingPkgName, calledPkgName, msgBody, length, 0, 0, 0); } } -#endif // APP_PLATFORM_WATCHGT +#endif // __LITEOS_M__ diff --git a/services/abilitymgr_lite/BUILD.gn b/services/abilitymgr_lite/BUILD.gn index bf48124..740ae0e 100644 --- a/services/abilitymgr_lite/BUILD.gn +++ b/services/abilitymgr_lite/BUILD.gn @@ -12,6 +12,8 @@ # limitations under the License. import("//build/lite/config/component/lite_component.gni") import("//build/lite/config/subsystem/aafwk/config.gni") +import( + "//foundation/bundlemanager/bundle_framework_lite/bundle_framework_lite.gni") lite_library("abilityms") { if (ohos_kernel_type == "liteos_m") { @@ -43,6 +45,11 @@ lite_library("abilityms") { [ "TASK_STACK_SIZE=$config_ohos_aafwk_aafwk_lite_task_stack_size" ] } + if (defined(enable_ohos_bundle_manager_service) && + enable_ohos_bundle_manager_service == true) { + defines += [ "_MINI_BMS_" ] + } + deps = [ "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_static", "//foundation/arkui/ace_engine_lite/frameworks:ace_lite", diff --git a/services/abilitymgr_lite/include/util/abilityms_log.h b/services/abilitymgr_lite/include/util/abilityms_log.h index 97ae61f..7cd5677 100644 --- a/services/abilitymgr_lite/include/util/abilityms_log.h +++ b/services/abilitymgr_lite/include/util/abilityms_log.h @@ -24,7 +24,7 @@ namespace OHOS { #undef LOG_DOMAIN #define LOG_DOMAIN 0xD001300 -#ifdef APP_PLATFORM_WATCHGT +#ifdef __LITEOS_M__ #ifndef HILOG_DEBUG #define HILOG_DEBUG(mod, format, ...) #endif diff --git a/services/abilitymgr_lite/src/slite/ability_mgr_service_slite.cpp b/services/abilitymgr_lite/src/slite/ability_mgr_service_slite.cpp index 11f2112..bb8f332 100755 --- a/services/abilitymgr_lite/src/slite/ability_mgr_service_slite.cpp +++ b/services/abilitymgr_lite/src/slite/ability_mgr_service_slite.cpp @@ -53,7 +53,7 @@ static void InitService() SamgrLite *sm = SAMGR_GetInstance(); CHECK_NULLPTR_RETURN(sm, "AbilityManagerService", "get samgr error"); BOOL result = sm->RegisterService(AbilityMgrServiceSlite::GetInstance()); - PRINTI("AbilityManagerService", "ams starts %{public}s", result ? "successfully" : "unsuccessfully"); + HILOG_INFO(HILOG_MODULE_AAFWK, "ams starts %{public}s", result ? "successfully" : "unsuccessfully"); } SYSEX_SERVICE_INIT(InitService); @@ -64,14 +64,14 @@ static void InitFeature() CHECK_NULLPTR_RETURN(samgrLite, "AbilityMgrServiceSlite", "get samgr error"); BOOL result = samgrLite->RegisterFeature(AMS_SERVICE, AbilityMgrServiceSlite::GetInstance()); if (result == FALSE) { - PRINTE("AbilityMgrServiceSlite", "ams register feature failure"); + HILOG_ERROR(HILOG_MODULE_AAFWK, "ams register feature failure"); return; } g_amsSliteImpl.ams = AbilityMgrServiceSlite::GetInstance(); auto publicApi = GET_IUNKNOWN(g_amsSliteImpl); CHECK_NULLPTR_RETURN(publicApi, "AbilityMgrServiceSlite", "publicApi is nullptr"); BOOL apiResult = samgrLite->RegisterFeatureApi(AMS_SERVICE, AMS_SLITE_FEATURE, publicApi); - PRINTI("AbilityMgrServiceSlite", "ams feature init %{public}s", apiResult ? "success" : "failure"); + HILOG_INFO(HILOG_MODULE_AAFWK, "ams feature init %{public}s", apiResult ? "success" : "failure"); } SYSEX_FEATURE_INIT(InitFeature); diff --git a/services/abilitymgr_lite/src/slite/ability_record_manager.cpp b/services/abilitymgr_lite/src/slite/ability_record_manager.cpp index c777d6b..1c406e0 100644 --- a/services/abilitymgr_lite/src/slite/ability_record_manager.cpp +++ b/services/abilitymgr_lite/src/slite/ability_record_manager.cpp @@ -167,7 +167,7 @@ int32_t AbilityRecordManager::StartAbility(const Want *want) info->path = nullptr; } else { // JS APP -#if ((defined OHOS_APPEXECFWK_BMS_BUNDLEMANAGER) || (defined APP_PLATFORM_WATCHGT)) +#ifdef _MINI_BMS_ AbilityInfo abilityInfo = { nullptr, nullptr }; QueryAbilityInfo(want, &abilityInfo); if (!(BMSHelper::GetInstance().IsNativeApp(bundleName) || IsValidAbility(&abilityInfo))) { -- Gitee