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("//base/powermgr/power_manager/powermgr.gni") 14import("//build/ohos.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 vendor power_mode_config.xml to /vendor/etc/power_config/power_mode_config.xml 25ohos_prebuilt_etc("power_mode_config_vendor") { 26 source = "//vendor/${product_company}/${product_name}/power_config/power_mode_config.xml" 27 relative_install_dir = "power_config" 28 install_images = [ chipset_base_dir ] 29 part_name = "${powermgr_part_name}" 30 subsystem_name = "powermgr" 31} 32 33group("power_service_config") { 34 deps = [ ":power_mode_config" ] 35 36 VENDOR_CONFIG_PATH = rebase_path( 37 "//vendor/${product_company}/${product_name}/power_config/power_mode_config.xml") 38 CMD = "if [ -f ${VENDOR_CONFIG_PATH} ]; then echo true; else echo false; fi" 39 vendor_config_exist = 40 exec_script("//build/lite/run_shell_cmd.py", [ CMD ], "value") 41 if (vendor_config_exist) { 42 deps += [ ":power_mode_config_vendor" ] 43 } 44} 45