• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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/config/components/ets_frontend/ets2abc_config.gni")
15import("//build/ohos.gni")
16import("//build/ohos/taihe_idl/taihe.gni")
17import("../../../../../displaymgr.gni")
18
19copy_taihe_idl("copy_display_manager") {
20  sources = [ "idl/ohos.brightness.taihe" ]
21}
22
23ohos_taihe("run_taihe") {
24  taihe_generated_file_path = "$taihe_generated_file_path"
25  deps = [ ":copy_display_manager" ]
26  outputs = [
27    "$taihe_generated_file_path/src/ohos.brightness.ani.cpp",
28    "$taihe_generated_file_path/src/ohos.brightness.abi.c",
29  ]
30}
31
32taihe_shared_library("display_manager_brightness_taihe_native") {
33  branch_protector_ret = "pac_ret"
34  sanitize = {
35    cfi = true
36    cfi_cross_dso = true
37    debug = false
38  }
39  taihe_generated_file_path = "$taihe_generated_file_path"
40  sources = get_target_outputs(":run_taihe")
41  include_dirs = [ "./include" ]
42  configs = [
43    "${displaymgr_utils_path}:utils_config",
44    "${displaymgr_utils_path}:coverage_flags",
45  ]
46  sources += [
47    "src/ani_constructor.cpp",
48    "src/ohos.brightness.impl.cpp",
49  ]
50  deps = [
51    ":run_taihe",
52    "${displaymgr_inner_api}:displaymgr",
53  ]
54  external_deps = [
55    "c_utils:utils",
56    "hilog:libhilog",
57    "ipc:ipc_core",
58    "power_manager:powermgr_client",
59  ]
60
61  subsystem_name = "powermgr"
62  part_name = "${displaymgr_part_name}"
63}
64
65generate_static_abc("brightness_abc") {
66  base_url = "$taihe_generated_file_path"
67  files = [ "$taihe_generated_file_path/@ohos.brightness.ets" ]
68  is_boot_abc = "True"
69  device_dst_file = "/system/framework/brightness_abc.abc"
70  dependencies = [ ":run_taihe" ]
71}
72
73ohos_prebuilt_etc("brightness_etc") {
74  source = "$target_out_dir/brightness_abc.abc"
75  module_install_dir = "framework"
76  subsystem_name = "powermgr"
77  part_name = "${displaymgr_part_name}"
78  deps = [ ":brightness_abc" ]
79}