From 5f45bd679fd13f0e13d4fca2eee762e17e1e09dc Mon Sep 17 00:00:00 2001 From: zhangyuhang72 Date: Wed, 3 Apr 2024 10:04:58 +0800 Subject: [PATCH] =?UTF-8?q?memmgr=5Fclient=E9=83=A8=E4=BB=B6=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhangyuhang72 Change-Id: Idfed187e113ad73c445e4766f06a3b790ad8f135 --- ability_runtime.gni | 12 ++++++++++++ services/appmgr/BUILD.gn | 7 ++++++- .../ams_ability_running_record_test/BUILD.gn | 7 ++++++- test/unittest/ams_app_life_cycle_test/BUILD.gn | 7 ++++++- test/unittest/ams_app_workflow_test/BUILD.gn | 7 ++++++- test/unittest/ams_recent_app_list_test/BUILD.gn | 7 ++++++- .../ams_service_app_spawn_client_test/BUILD.gn | 7 ++++++- test/unittest/ams_service_event_drive_test/BUILD.gn | 7 ++++++- .../ams_service_load_ability_process_test/BUILD.gn | 7 ++++++- test/unittest/ams_service_startup_test/BUILD.gn | 7 ++++++- .../app_mgr_service_event_handler_test/BUILD.gn | 7 ++++++- .../app_running_processes_info_test/BUILD.gn | 7 ++++++- 12 files changed, 78 insertions(+), 11 deletions(-) diff --git a/ability_runtime.gni b/ability_runtime.gni index 42971ff590..e70ad0a1da 100644 --- a/ability_runtime.gni +++ b/ability_runtime.gni @@ -89,6 +89,8 @@ declare_args() { "com.ohos.passwordbox/entry/AutoFillAbility" ability_runtime_smart_auto_fill_ability = "com.ohos.textautofill/entry/TextAutoFillAbility" + ability_runtime_use_memmgr_plugin = false + ability_runtime_use_memmgr = false if (!defined(global_parts_info) || defined(global_parts_info.account_os_account)) { @@ -112,6 +114,16 @@ declare_args() { efficiency_manager = false } + if (defined(global_parts_info) && + defined(global_parts_info.resourceschedule_memmgr_plugin)) { + ability_runtime_use_memmgr_plugin = true + } + + if (defined(global_parts_info) && + defined(global_parts_info.resourceschedule_memmgr)) { + ability_runtime_use_memmgr = true + } + if (defined(global_parts_info) && !defined(global_parts_info.distributeddatamgr_relational_store)) { ability_runtime_relational = false diff --git a/services/appmgr/BUILD.gn b/services/appmgr/BUILD.gn index 5325a1406c..5802a4a4d7 100644 --- a/services/appmgr/BUILD.gn +++ b/services/appmgr/BUILD.gn @@ -115,7 +115,6 @@ ohos_shared_library("libappms") { "ipc:ipc_core", "kv_store:distributeddata_inner", "kv_store:distributeddata_mgr", - "memmgr:memmgrclient", "memory_utils:libmeminfo", "safwk:system_ability_fwk", "samgr:samgr_proxy", @@ -140,6 +139,12 @@ ohos_shared_library("libappms") { external_deps += [ "efficiency_manager:suspend_manager_client" ] } + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } + if (background_task_mgr_continuous_task_enable) { defines += [ "BGTASKMGR_CONTINUOUS_TASK_ENABLE" ] } diff --git a/test/unittest/ams_ability_running_record_test/BUILD.gn b/test/unittest/ams_ability_running_record_test/BUILD.gn index 1a9f9b3a55..ab75c20de6 100644 --- a/test/unittest/ams_ability_running_record_test/BUILD.gn +++ b/test/unittest/ams_ability_running_record_test/BUILD.gn @@ -77,13 +77,18 @@ ohos_unittest("AmsAbilityRunningRecordTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] if (ability_runtime_graphics) { external_deps += [ "window_manager:libwm" ] } + + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } } group("unittest") { diff --git a/test/unittest/ams_app_life_cycle_test/BUILD.gn b/test/unittest/ams_app_life_cycle_test/BUILD.gn index 9e6917be4c..dfb211c19e 100644 --- a/test/unittest/ams_app_life_cycle_test/BUILD.gn +++ b/test/unittest/ams_app_life_cycle_test/BUILD.gn @@ -73,9 +73,14 @@ ohos_unittest("AmsAppLifeCycleTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] + + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } } group("unittest") { diff --git a/test/unittest/ams_app_workflow_test/BUILD.gn b/test/unittest/ams_app_workflow_test/BUILD.gn index ea54619b09..521048b343 100644 --- a/test/unittest/ams_app_workflow_test/BUILD.gn +++ b/test/unittest/ams_app_workflow_test/BUILD.gn @@ -72,7 +72,6 @@ ohos_unittest("AmsWorkFlowTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] @@ -82,6 +81,12 @@ ohos_unittest("AmsWorkFlowTest") { "window_manager:libwsutils", ] } + + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } } group("unittest") { diff --git a/test/unittest/ams_recent_app_list_test/BUILD.gn b/test/unittest/ams_recent_app_list_test/BUILD.gn index 296b0599a0..e404921944 100644 --- a/test/unittest/ams_recent_app_list_test/BUILD.gn +++ b/test/unittest/ams_recent_app_list_test/BUILD.gn @@ -87,7 +87,6 @@ ohos_unittest("AmsRecentAppListTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] @@ -97,6 +96,12 @@ ohos_unittest("AmsRecentAppListTest") { "window_manager:libwsutils", ] } + + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } } group("unittest") { diff --git a/test/unittest/ams_service_app_spawn_client_test/BUILD.gn b/test/unittest/ams_service_app_spawn_client_test/BUILD.gn index 7729675cdd..46c4b70bc2 100644 --- a/test/unittest/ams_service_app_spawn_client_test/BUILD.gn +++ b/test/unittest/ams_service_app_spawn_client_test/BUILD.gn @@ -83,7 +83,6 @@ ohos_unittest("AmsServiceAppSpawnClientTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] @@ -91,6 +90,12 @@ ohos_unittest("AmsServiceAppSpawnClientTest") { external_deps += [ "window_manager:libwm" ] } + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } + subsystem_name = "ability" part_name = "ability_runtime" } diff --git a/test/unittest/ams_service_event_drive_test/BUILD.gn b/test/unittest/ams_service_event_drive_test/BUILD.gn index 96ba2403f6..41c2e0ab91 100644 --- a/test/unittest/ams_service_event_drive_test/BUILD.gn +++ b/test/unittest/ams_service_event_drive_test/BUILD.gn @@ -87,10 +87,15 @@ ohos_unittest("AmsServiceEventDriveTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } + if (ability_runtime_graphics) { external_deps += [ "window_manager:libwm" ] } diff --git a/test/unittest/ams_service_load_ability_process_test/BUILD.gn b/test/unittest/ams_service_load_ability_process_test/BUILD.gn index cd4c6f1e39..2b99a878a9 100644 --- a/test/unittest/ams_service_load_ability_process_test/BUILD.gn +++ b/test/unittest/ams_service_load_ability_process_test/BUILD.gn @@ -89,7 +89,6 @@ ohos_unittest("AmsServiceLoadAbilityProcessTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] @@ -99,6 +98,12 @@ ohos_unittest("AmsServiceLoadAbilityProcessTest") { "window_manager:libwsutils", ] } + + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } } group("unittest") { diff --git a/test/unittest/ams_service_startup_test/BUILD.gn b/test/unittest/ams_service_startup_test/BUILD.gn index 2943166853..459b614f3f 100644 --- a/test/unittest/ams_service_startup_test/BUILD.gn +++ b/test/unittest/ams_service_startup_test/BUILD.gn @@ -83,13 +83,18 @@ ohos_unittest("AmsServiceStartupTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] if (ability_runtime_graphics) { external_deps += [ "window_manager:libwm" ] } + + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } } group("unittest") { diff --git a/test/unittest/app_mgr_service_event_handler_test/BUILD.gn b/test/unittest/app_mgr_service_event_handler_test/BUILD.gn index 158ce6c7fd..c4150f749b 100644 --- a/test/unittest/app_mgr_service_event_handler_test/BUILD.gn +++ b/test/unittest/app_mgr_service_event_handler_test/BUILD.gn @@ -84,7 +84,6 @@ ohos_unittest("AMSEventHandlerTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] @@ -94,6 +93,12 @@ ohos_unittest("AMSEventHandlerTest") { "window_manager:libwsutils", ] } + + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } } group("unittest") { diff --git a/test/unittest/app_running_processes_info_test/BUILD.gn b/test/unittest/app_running_processes_info_test/BUILD.gn index fa17f184d3..d6126bbb48 100644 --- a/test/unittest/app_running_processes_info_test/BUILD.gn +++ b/test/unittest/app_running_processes_info_test/BUILD.gn @@ -80,13 +80,18 @@ ohos_unittest("AppRunningProcessesInfoTest") { "init:libbeget_proxy", "ipc:ipc_core", "kv_store:distributeddata_inner", - "memmgr:memmgrclient", "memory_utils:libmeminfo", ] if (ability_runtime_graphics) { external_deps += [ "window_manager:libwm" ] } + + if (ability_runtime_use_memmgr_plugin) { + external_deps += [ "memmgr_plugin:memmgrclient" ] + } else if (ability_runtime_use_memmgr) { + external_deps += [ "memmgr:memmgrclient" ] + } } group("unittest") {