# Copyright (c) 2022 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//build/ohos_var.gni") import("//foundation/resourceschedule/memmgr/memmgr.gni") ## Install .rc or .cfg file to /system/etc/init/ ohos_prebuilt_etc("memmgrservice_init") { if (use_musl) { source = "memmgrservice.cfg" } else { source = "memmgrservice.rc" } relative_install_dir = "init" part_name = "${memmgr_part_name}" subsystem_name = "${memmgr_subsystem_name}" } config("memory_memmgr_config") { visibility = [ ":*" ] include_dirs = [ "include", "${memmgr_root_path}/common/include", "${memmgr_root_path}/common/include/config", "${memmgr_root_path}/common/src/", "${memmgr_root_path}/common/src/config", "${memgr_innerkits_path}/include", "include/event/", "include/memory_level_manager/", "include/nandlife_controller", "include/reclaim_priority_manager/", "include/kill_strategy_manager/", "include/reclaim_strategy_manager/", ] defines = [] if (memmgr_report_has_bg_task_mgr) { defines += [ "CONFIG_BGTASK_MGR" ] } } ohos_shared_library("memmgrservice") { install_enable = true use_exceptions = true sources = [ "${memmgr_common_path}/src/config/avail_buffer_config.cpp", "${memmgr_common_path}/src/config/kill_config.cpp", "${memmgr_common_path}/src/config/nand_life_config.cpp", "${memmgr_common_path}/src/config/reclaim_config.cpp", "${memmgr_common_path}/src/config/reclaim_priority_config.cpp", "${memmgr_common_path}/src/config/switch_config.cpp", "${memmgr_common_path}/src/config/system_memory_level_config.cpp", "${memmgr_common_path}/src/kernel_interface.cpp", "${memmgr_common_path}/src/memmgr_config_manager.cpp", "${memmgr_common_path}/src/xml_helper.cpp", "src/event/account_observer.cpp", "src/event/app_state_observer.cpp", "src/event/common_event_observer.cpp", "src/event/extension_connection_observer.cpp", "src/event/mem_mgr_event_center.cpp", "src/event/memory_pressure_observer.cpp", "src/kill_strategy_manager/low_memory_killer.cpp", "src/mem_mgr_service.cpp", "src/mem_mgr_stub.cpp", "src/memory_level_manager/memory_level_manager.cpp", "src/nandlife_controller/nandlife_controller.cpp", "src/reclaim_priority_manager/account_bundle_info.cpp", "src/reclaim_priority_manager/account_priority_info.cpp", "src/reclaim_priority_manager/bundle_priority_info.cpp", "src/reclaim_priority_manager/default_multi_account_priority.cpp", "src/reclaim_priority_manager/multi_account_manager.cpp", "src/reclaim_priority_manager/oom_score_adj_utils.cpp", "src/reclaim_priority_manager/process_priority_info.cpp", "src/reclaim_priority_manager/reclaim_priority_manager.cpp", "src/reclaim_strategy_manager/avail_buffer_manager.cpp", "src/reclaim_strategy_manager/memcg.cpp", "src/reclaim_strategy_manager/memcg_mgr.cpp", "src/reclaim_strategy_manager/reclaim_strategy_manager.cpp", ] configs = [ ":memory_memmgr_config" ] deps = [ "//third_party/libxml2:libxml2" ] include_dirs = [ "//foundation/ability/ability_runtime/interfaces/inner_api/wantagent/include", "//foundation/ability/ability_runtime/interfaces/kits/native/appkit/ability_runtime", "//base/global/resource_management/interfaces/inner_api/include", "//foundation/ability/ability_runtime/services/abilitymgr/include", ] external_deps = [ "ability_base:want", "ability_runtime:app_manager", "ability_runtime:connection_obs_manager", "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "common_event_service:cesfwk_core", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hiviewdfx_hilog_native:libhilog", "init:libbegetutil", "ipc:ipc_core", "memmgr:memmgrclient", "os_account:os_account_innerkits", "safwk:system_ability_fwk", "samgr:samgr_proxy", ] if (memmgr_report_has_bg_task_mgr) { sources += [ "src/event/bg_task_observer.cpp" ] external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] } part_name = "${memmgr_part_name}" subsystem_name = "${memmgr_subsystem_name}" }