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("../displaymgr.gni")
15
16config("brightness_manager_config") {
17  include_dirs = [ "include" ]
18}
19
20ohos_static_library("brightness_manager") {
21  sanitize = {
22    cfi = true
23    cfi_cross_dso = true
24    debug = false
25  }
26  branch_protector_ret = "pac_ret"
27
28  sources = [
29    "src/brightness_action.cpp",
30    "src/brightness_config_parser.cpp",
31    "src/brightness_dimming.cpp",
32    "src/brightness_manager.cpp",
33    "src/brightness_manager_ext.cpp",
34    "src/brightness_param_helper.cpp",
35    "src/brightness_service.cpp",
36    "src/brightness_setting_helper.cpp",
37    "src/calculation_config_parser.cpp",
38    "src/calculation_curve.cpp",
39    "src/calculation_manager.cpp",
40    "src/config_parser.cpp",
41    "src/config_parser_base.cpp",
42    "src/light_lux_buffer.cpp",
43    "src/light_lux_manager.cpp",
44    "src/lux_filter_config_parser.cpp",
45    "src/lux_threshold_config_parser.cpp",
46  ]
47
48  configs = [
49    ":brightness_manager_config",
50    "${displaymgr_utils_path}:utils_config",
51    "${displaymgr_inner_api}:displaymgr_public_config",
52  ]
53
54  external_deps = [
55    "ability_runtime:ability_manager",
56    "c_utils:utils",
57    "data_share:datashare_consumer",
58    "ffrt:libffrt",
59    "hicollie:libhicollie",
60    "hilog:libhilog",
61    "hisysevent:libhisysevent",
62    "image_framework:image_native",
63    "ipc:ipc_core",
64    "jsoncpp:jsoncpp",
65    "power_manager:power_ffrt",
66    "power_manager:power_setting",
67    "power_manager:power_sysparam",
68    "safwk:system_ability_fwk",
69    "window_manager:libdm_lite",
70  ]
71
72  defines = []
73  if (use_libfuzzer) {
74    defines += [ "FUZZ_TEST" ]
75  }
76
77  if (has_sensors_sensor_part) {
78    external_deps += [ "sensor:sensor_interface_native" ]
79    defines += [ "ENABLE_SENSOR_PART" ]
80  }
81  if (display_manager_feature_brightnessext != "") {
82    defines += [ "OHOS_BUILD_ENABLE_BRIGHTNESS_WRAPPER" ]
83  }
84
85  subsystem_name = "powermgr"
86  part_name = "${displaymgr_part_name}"
87}
88