diff --git a/services/bundlemgr_lite/BUILD.gn b/services/bundlemgr_lite/BUILD.gn index b57e5184bcbe0a0d6ae7cf3180c1858eeca1e23d..0c5917d91dbf6b4982eb0f8553cbec001baf7edc 100644 --- a/services/bundlemgr_lite/BUILD.gn +++ b/services/bundlemgr_lite/BUILD.gn @@ -19,6 +19,7 @@ config("bundle_config") { declare_args() { enable_ohos_bundle_manager_service = false + enable_ohos_bundle_manager_service_permission = false } if (ohos_kernel_type == "liteos_m") { @@ -40,6 +41,10 @@ if (ohos_kernel_type == "liteos_m") { defines += [ "_MINI_BMS_" ] } + if (enable_ohos_bundle_manager_service_permission == true) { + defines += [ "_MINI_BMS_PERMISSION_" ] + } + deps = [ "${appexecfwk_lite_path}/frameworks/bundle_lite:bundle", "//base/global/resource_management_lite/frameworks/resmgr_lite:global_resmgr", diff --git a/services/bundlemgr_lite/src/gt_bundle_installer.cpp b/services/bundlemgr_lite/src/gt_bundle_installer.cpp index 1361b6309107a394de976f95f47ff70fa6cf8a9c..2d2e743a78ecdecedc3a7c4c340552096c181aee 100644 --- a/services/bundlemgr_lite/src/gt_bundle_installer.cpp +++ b/services/bundlemgr_lite/src/gt_bundle_installer.cpp @@ -590,7 +590,7 @@ uint8_t GtBundleInstaller::Uninstall(const char *bundleName) if (sprintf_s(bundleJsonPath, PATH_LENGTH, "%s%s%s", JSON_PATH, bundleName, JSON_SUFFIX) < 0) { return ERR_APPEXECFWK_UNINSTALL_FAILED_INTERNAL_ERROR; } -#ifdef _MINI_BMS_ +#ifdef _MINI_BMS_PERMISSION_ if (DeletePermissions(const_cast(bundleName)) < 0) { return ERR_APPEXECFWK_UNINSTALL_FAILED_DELETE_PERMISSIONS_ERROR; } @@ -747,7 +747,7 @@ uint8_t GtBundleInstaller::StorePermissions(const char *bundleName, PermissionTr bool isUpdate) { if (permNum == 0) { -#ifdef _MINI_BMS_ +#ifdef _MINI_BMS_PERMISSION_ if (isUpdate) { int32_t ret = DeletePermissions(bundleName); HILOG_INFO(HILOG_MODULE_AAFWK, "[BMS] delete permissions, result is %d", ret); @@ -763,7 +763,7 @@ uint8_t GtBundleInstaller::StorePermissions(const char *bundleName, PermissionTr if (!BundleUtil::IsDir(PERMISSIONS_PATH)) { BundleUtil::MkDirs(PERMISSIONS_PATH); } -#ifdef _MINI_BMS_ +#ifdef _MINI_BMS_PERMISSION_ if (SaveOrUpdatePermissions(const_cast(bundleName), permissions, permNum, static_cast(isUpdate)) != 0) { return ERR_APPEXECFWK_INSTALL_FAILED_STORE_PERMISSIONS_ERROR;