# Copyright (c) 2023 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("//foundation/resourceschedule/device_standby/standby_service.gni") config("standby_service_public_config") { include_dirs = [ "common/include", "core/include", "notification/include", "${standby_plugins_path}/ext/include", ] } ohos_shared_library("standby_service") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } if (!use_clang_coverage) { shlib_type = "sa" } sources = [ "common/src/device_standby_switch.cpp", "common/src/time_provider.cpp", "common/src/timed_task.cpp", "core/src/ability_manager_helper.cpp", "core/src/allow_record.cpp", "core/src/app_mgr_helper.cpp", "core/src/app_state_observer.cpp", "core/src/bundle_manager_helper.cpp", "core/src/common_event_observer.cpp", "core/src/standby_service.cpp", "core/src/standby_service_impl.cpp", "notification/src/standby_state_subscriber.cpp", ] public_configs = [ ":standby_service_public_config" ] deps = [ "${standby_innerkits_path}:standby_innerkits", "${standby_service_frameworks_path}:standby_fwk", "${standby_utils_common_path}:standby_utils_common", "${standby_utils_policy_path}:standby_utils_policy", ] external_deps = [ "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "bundle_framework:appexecfwk_base", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "json:nlohmann_json_static", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] defines = [] if (enable_background_task_mgr) { external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] sources += [ "common/src/background_task_helper.cpp" ] defines += [ "ENABLE_BACKGROUND_TASK_MGR" ] } if (standby_power_manager_enable) { external_deps += [ "power_manager:powermgr_client" ] defines += [ "STANDBY_POWER_MANAGER_ENABLE" ] } subsystem_name = "resourceschedule" part_name = "${standby_service_part_name}" version_script = "libstandby_service.versionscript" } ohos_static_library("standby_service_static") { branch_protector_ret = "pac_ret" sanitize = { cfi = true cfi_cross_dso = true debug = false } cflags_cc = [ "-DSTANDBY_SERVICE_UNIT_TEST" ] sources = [ "common/src/device_standby_switch.cpp", "common/src/time_provider.cpp", "common/src/timed_task.cpp", "core/src/ability_manager_helper.cpp", "core/src/allow_record.cpp", "core/src/app_mgr_helper.cpp", "core/src/app_state_observer.cpp", "core/src/bundle_manager_helper.cpp", "core/src/common_event_observer.cpp", "core/src/standby_service.cpp", "core/src/standby_service_impl.cpp", "notification/src/standby_state_subscriber.cpp", ] public_configs = [ ":standby_service_public_config" ] deps = [ "${standby_innerkits_path}:standby_innerkits", "${standby_service_frameworks_path}:standby_fwk", "${standby_utils_common_path}:standby_utils_common", "${standby_utils_policy_path}:standby_utils_policy", ] external_deps = [ "ability_base:want", "ability_runtime:app_manager", "ability_runtime:wantagent_innerkits", "access_token:libaccesstoken_sdk", "access_token:libtokenid_sdk", "bundle_framework:appexecfwk_base", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", "init:libbegetutil", "ipc:ipc_single", "json:nlohmann_json_static", "safwk:system_ability_fwk", "samgr:samgr_proxy", "time_service:time_client", ] defines = [] if (enable_background_task_mgr) { external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] sources += [ "common/src/background_task_helper.cpp" ] defines += [ "ENABLE_BACKGROUND_TASK_MGR" ] } if (standby_power_manager_enable) { external_deps += [ "power_manager:powermgr_client" ] defines += [ "STANDBY_POWER_MANAGER_ENABLE" ] } subsystem_name = "resourceschedule" part_name = "${standby_service_part_name}" }