1# Copyright (c) 2023 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14import("//build/ohos.gni") 15import("//foundation/resourceschedule/device_standby/standby_service.gni") 16 17config("standby_service_public_config") { 18 include_dirs = [ 19 "common/include", 20 "core/include", 21 "notification/include", 22 "${standby_plugins_path}/ext/include", 23 "//third_party/json/single_include", 24 ] 25} 26 27ohos_shared_library("standby_service") { 28 branch_protector_ret = "pac_ret" 29 sanitize = { 30 cfi = true 31 cfi_cross_dso = true 32 debug = false 33 } 34 if (!use_clang_coverage) { 35 shlib_type = "sa" 36 } 37 38 sources = [ 39 "common/src/background_task_helper.cpp", 40 "common/src/device_standby_switch.cpp", 41 "common/src/time_provider.cpp", 42 "common/src/timed_task.cpp", 43 "core/src/ability_manager_helper.cpp", 44 "core/src/allow_record.cpp", 45 "core/src/app_mgr_helper.cpp", 46 "core/src/app_state_observer.cpp", 47 "core/src/bundle_manager_helper.cpp", 48 "core/src/common_event_observer.cpp", 49 "core/src/standby_service.cpp", 50 "core/src/standby_service_impl.cpp", 51 "notification/src/standby_state_subscriber.cpp", 52 ] 53 54 public_configs = [ ":standby_service_public_config" ] 55 56 deps = [ 57 "${standby_innerkits_path}:standby_innerkits", 58 "${standby_service_frameworks_path}:standby_fwk", 59 "${standby_utils_common_path}:standby_utils_common", 60 "${standby_utils_policy_path}:standby_utils_policy", 61 ] 62 63 external_deps = [ 64 "ability_base:base", 65 "ability_base:want", 66 "ability_base:zuri", 67 "ability_runtime:app_manager", 68 "ability_runtime:wantagent_innerkits", 69 "access_token:libaccesstoken_sdk", 70 "access_token:libtokenid_sdk", 71 "bundle_framework:appexecfwk_base", 72 "bundle_framework:appexecfwk_core", 73 "c_utils:utils", 74 "common_event_service:cesfwk_innerkits", 75 "eventhandler:libeventhandler", 76 "hilog:libhilog", 77 "init:libbegetutil", 78 "ipc:ipc_single", 79 "power_manager:powermgr_client", 80 "safwk:system_ability_fwk", 81 "samgr:samgr_proxy", 82 "time_service:time_client", 83 ] 84 85 defines = [] 86 if (enable_background_task_mgr) { 87 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 88 defines += [ "ENABLE_BACKGROUND_TASK_MGR" ] 89 } 90 91 subsystem_name = "resourceschedule" 92 part_name = "${standby_service_part_name}" 93 94 version_script = "libstandby_service.versionscript" 95} 96 97ohos_static_library("standby_service_static") { 98 branch_protector_ret = "pac_ret" 99 sanitize = { 100 cfi = true 101 cfi_cross_dso = true 102 debug = false 103 } 104 cflags_cc = [ "-DSTANDBY_SERVICE_UNIT_TEST" ] 105 sources = [ 106 "common/src/background_task_helper.cpp", 107 "common/src/device_standby_switch.cpp", 108 "common/src/time_provider.cpp", 109 "common/src/timed_task.cpp", 110 "core/src/ability_manager_helper.cpp", 111 "core/src/allow_record.cpp", 112 "core/src/app_mgr_helper.cpp", 113 "core/src/app_state_observer.cpp", 114 "core/src/bundle_manager_helper.cpp", 115 "core/src/common_event_observer.cpp", 116 "core/src/standby_service.cpp", 117 "core/src/standby_service_impl.cpp", 118 "notification/src/standby_state_subscriber.cpp", 119 ] 120 121 public_configs = [ ":standby_service_public_config" ] 122 123 deps = [ 124 "${standby_innerkits_path}:standby_innerkits", 125 "${standby_service_frameworks_path}:standby_fwk", 126 "${standby_utils_common_path}:standby_utils_common", 127 "${standby_utils_policy_path}:standby_utils_policy", 128 ] 129 130 external_deps = [ 131 "ability_base:base", 132 "ability_base:want", 133 "ability_base:zuri", 134 "ability_runtime:app_manager", 135 "ability_runtime:wantagent_innerkits", 136 "access_token:libaccesstoken_sdk", 137 "access_token:libtokenid_sdk", 138 "bundle_framework:appexecfwk_base", 139 "bundle_framework:appexecfwk_core", 140 "c_utils:utils", 141 "common_event_service:cesfwk_innerkits", 142 "eventhandler:libeventhandler", 143 "hilog:libhilog", 144 "init:libbegetutil", 145 "ipc:ipc_single", 146 "power_manager:powermgr_client", 147 "safwk:system_ability_fwk", 148 "samgr:samgr_proxy", 149 "time_service:time_client", 150 ] 151 152 defines = [] 153 if (enable_background_task_mgr) { 154 external_deps += [ "background_task_mgr:bgtaskmgr_innerkits" ] 155 defines += [ "ENABLE_BACKGROUND_TASK_MGR" ] 156 } 157 158 subsystem_name = "resourceschedule" 159 part_name = "${standby_service_part_name}" 160} 161