1# Copyright (c) 2021-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("../thermalmgr.gni") 15 16config("thermalsrv_private_config") { 17 include_dirs = [ "${ability_runtime_services_path}/appmgr/include" ] 18} 19 20config("thermalsrv_public_config") { 21 include_dirs = [ 22 "native/include/", 23 "native/include/thermal_action", 24 "native/include/thermal_observer", 25 "native/include/thermal_policy", 26 "native/include/thermal_observer/state_machine", 27 "native/include/thermal_action/action", 28 "native/include/thermal_action/action/action_soc", 29 "${thermal_inner_api}/native/include", 30 ] 31} 32 33ohos_shared_library("thermalservice") { 34 sources = [ 35 "native/src/fan_callback.cpp", 36 "native/src/thermal_action/action/action_application_process.cpp", 37 "native/src/thermal_action/action/action_charger.cpp", 38 "native/src/thermal_action/action/action_display.cpp", 39 "native/src/thermal_action/action/action_popup.cpp", 40 "native/src/thermal_action/action/action_shutdown.cpp", 41 "native/src/thermal_action/action/action_soc/action_cpu_big.cpp", 42 "native/src/thermal_action/action/action_soc/action_cpu_boost.cpp", 43 "native/src/thermal_action/action/action_soc/action_cpu_isolate.cpp", 44 "native/src/thermal_action/action/action_soc/action_cpu_lit.cpp", 45 "native/src/thermal_action/action/action_soc/action_cpu_med.cpp", 46 "native/src/thermal_action/action/action_soc/action_gpu.cpp", 47 "native/src/thermal_action/action/action_soc/soc_action_base.cpp", 48 "native/src/thermal_action/action/action_thermal_level.cpp", 49 "native/src/thermal_action/action/action_voltage.cpp", 50 "native/src/thermal_action/action/action_volume.cpp", 51 "native/src/thermal_action/thermal_action_factory.cpp", 52 "native/src/thermal_action/thermal_action_manager.cpp", 53 "native/src/thermal_action/thermal_timer.cpp", 54 "native/src/thermal_callback.cpp", 55 "native/src/thermal_mgr_dumper.cpp", 56 "native/src/thermal_observer/state_machine/charger_state_collection.cpp", 57 "native/src/thermal_observer/state_machine/scene_state_collection.cpp", 58 "native/src/thermal_observer/state_machine/screen_state_collection.cpp", 59 "native/src/thermal_observer/state_machine/state_collection_factory.cpp", 60 "native/src/thermal_observer/state_machine/state_machine.cpp", 61 "native/src/thermal_observer/thermal_common_event_receiver.cpp", 62 "native/src/thermal_observer/thermal_observer.cpp", 63 "native/src/thermal_observer/thermal_sensor_info.cpp", 64 "native/src/thermal_observer/thermal_service_subscriber.cpp", 65 "native/src/thermal_policy/fan_fault_detect.cpp", 66 "native/src/thermal_policy/thermal_config_base_info.cpp", 67 "native/src/thermal_policy/thermal_config_sensor_cluster.cpp", 68 "native/src/thermal_policy/thermal_policy.cpp", 69 "native/src/thermal_policy/thermal_srv_config_parser.cpp", 70 "native/src/thermal_service.cpp", 71 ] 72 73 configs = [ 74 "${utils_path}:utils_config", 75 ":thermalsrv_private_config", 76 "${utils_path}:coverage_flags", 77 ] 78 79 defines = [] 80 81 public_configs = [ ":thermalsrv_public_config" ] 82 83 deps = [ 84 "${thermal_service_zidl}:thermalmgr_proxy", 85 "${thermal_service_zidl}:thermalmgr_stub", 86 "${utils_path}:thermal_utils", 87 "//third_party/libxml2:xml2", 88 ] 89 90 external_deps = [ "power_manager:power_permission" ] 91 external_deps += [ 92 "ability_base:want", 93 "ability_runtime:ability_manager", 94 "ability_runtime:app_manager", 95 "ability_runtime:wantagent_innerkits", 96 "appspawn:appspawn_socket_client", 97 "audio_framework:audio_client", 98 "battery_manager:batterysrv_client", 99 "bundle_framework:appexecfwk_core", 100 "c_utils:utils", 101 "common_event_service:cesfwk_innerkits", 102 "config_policy:configpolicy_util", 103 "display_manager:displaymgr", 104 "drivers_interface_battery:libbattery_proxy_1.2", 105 "drivers_interface_thermal:libthermal_proxy_1.1", 106 "ffrt:libffrt", 107 "hdf_core:libhdi", 108 "hdf_core:libpub_utils", 109 "hicollie:libhicollie", 110 "hilog:libhilog", 111 "hisysevent:libhisysevent", 112 "image_framework:image_native", 113 "init:libbegetutil", 114 "ipc:ipc_core", 115 "power_manager:power_ffrt", 116 "power_manager:power_sysparam", 117 "power_manager:powermgr_client", 118 "safwk:system_ability_fwk", 119 "time_service:time_client", 120 "window_manager:libdm", 121 ] 122 123 if (defined(global_parts_info) && 124 defined(global_parts_info.resourceschedule_soc_perf)) { 125 external_deps += [ "soc_perf:socperf_client" ] 126 defines += [ "SOC_PERF_ENABLE" ] 127 } 128 129 subsystem_name = "powermgr" 130 part_name = "thermal_manager" 131} 132 133group("service") { 134 deps = [ 135 ":thermalservice", 136 "${thermal_manager_path}/sa_profile:thermalmgr_sa_profile", 137 "native/profile:thermal_service_config", 138 ] 139} 140