1# Copyright (C) 2021 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.
13import("//build/ohos.gni")
14import("../../../powermgr.gni")
15
16## Install power_mode_config.xml to /system/etc/power_config/power_mode_config.xml
17ohos_prebuilt_etc("power_mode_config") {
18  source = "power_mode_config.xml"
19  relative_install_dir = "power_config"
20  part_name = "${powermgr_part_name}"
21  subsystem_name = "powermgr"
22}
23
24## Install power_suspend.json to /system/etc/power_config/power_suspend.json
25ohos_prebuilt_etc("power_suspend_config") {
26  source = "power_suspend.json"
27  relative_install_dir = "power_config"
28  install_images = [ system_base_dir ]
29  part_name = "${powermgr_part_name}"
30  subsystem_name = "powermgr"
31}
32
33## Install power_wakeup.json to /system/etc/power_config/power_wakeup.json
34ohos_prebuilt_etc("power_wakeup_config") {
35  source = "power_wakeup.json"
36  relative_install_dir = "power_config"
37  install_images = [ system_base_dir ]
38  part_name = "${powermgr_part_name}"
39  subsystem_name = "powermgr"
40}
41
42## Install power_vibrator.json to /system/etc/power_config/power_vibrator.json
43ohos_prebuilt_etc("power_vibrator_config") {
44  source = "power_vibrator.json"
45  relative_install_dir = "power_config"
46  install_images = [ system_base_dir ]
47  part_name = "${powermgr_part_name}"
48  subsystem_name = "powermgr"
49}
50
51if (power_manager_feature_wakeup_action) {
52  ## Install power_wakeup_action.json to /system/etc/power_config/power_wakeup_action.json
53  ohos_prebuilt_etc("power_wakeup_action_config") {
54    source = "power_wakeup_action.json"
55    relative_install_dir = "power_config"
56    install_images = [ system_base_dir ]
57    part_name = "${powermgr_part_name}"
58    subsystem_name = "powermgr"
59  }
60}
61
62group("power_service_config") {
63  deps = [
64    ":power_mode_config",
65    ":power_suspend_config",
66    ":power_vibrator_config",
67    ":power_wakeup_config",
68  ]
69
70  if (power_manager_feature_wakeup_action) {
71    deps += [ ":power_wakeup_action_config" ]
72  }
73}
74