158ec469eSopenharmony_ci# Copyright (c) 2023 Huawei Device Co., Ltd.
258ec469eSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
358ec469eSopenharmony_ci# you may not use this file except in compliance with the License.
458ec469eSopenharmony_ci# You may obtain a copy of the License at
558ec469eSopenharmony_ci#
658ec469eSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
758ec469eSopenharmony_ci#
858ec469eSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
958ec469eSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1058ec469eSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1158ec469eSopenharmony_ci# See the License for the specific language governing permissions and
1258ec469eSopenharmony_ci# limitations under the License.
1358ec469eSopenharmony_ci
1458ec469eSopenharmony_ciimport("//build/ohos.gni")
1558ec469eSopenharmony_ci
1658ec469eSopenharmony_cideclare_args() {
1758ec469eSopenharmony_ci  miscdevice_feature_vibrator_custom = true
1858ec469eSopenharmony_ci  miscdevice_feature_hiviewdfx_hisysevent = true
1958ec469eSopenharmony_ci}
2058ec469eSopenharmony_ci
2158ec469eSopenharmony_ciprint(
2258ec469eSopenharmony_ci    "miscdevice_feature_vibrator_custom = ${miscdevice_feature_vibrator_custom}")
2358ec469eSopenharmony_ci
2458ec469eSopenharmony_ciSUBSYSTEM_DIR = "//base/sensors/miscdevice"
2558ec469eSopenharmony_ci
2658ec469eSopenharmony_ciFUZZ_MODULE_OUT_PATH = "miscdevice/miscdevice"
2758ec469eSopenharmony_ci
2858ec469eSopenharmony_cimiscdevice_default_defines = []
2958ec469eSopenharmony_ci
3058ec469eSopenharmony_ciif (miscdevice_feature_vibrator_custom) {
3158ec469eSopenharmony_ci  miscdevice_default_defines += [ "OHOS_BUILD_ENABLE_VIBRATOR_CUSTOM" ]
3258ec469eSopenharmony_ci}
3358ec469eSopenharmony_ci
3458ec469eSopenharmony_ciif (!defined(global_parts_info) ||
3558ec469eSopenharmony_ci    defined(global_parts_info.hdf_drivers_interface_light)) {
3658ec469eSopenharmony_ci  hdf_drivers_interface_light = true
3758ec469eSopenharmony_ci  miscdevice_default_defines += [ "HDF_DRIVERS_INTERFACE_LIGHT" ]
3858ec469eSopenharmony_ci} else {
3958ec469eSopenharmony_ci  hdf_drivers_interface_light = false
4058ec469eSopenharmony_ci}
4158ec469eSopenharmony_ci
4258ec469eSopenharmony_ciif (!defined(global_parts_info) ||
4358ec469eSopenharmony_ci    defined(global_parts_info.resourceschedule_memmgr_override)) {
4458ec469eSopenharmony_ci  miscdevice_memmgr_enable = true
4558ec469eSopenharmony_ci} else {
4658ec469eSopenharmony_ci  miscdevice_memmgr_enable = false
4758ec469eSopenharmony_ci}
4858ec469eSopenharmony_ci
4958ec469eSopenharmony_ciif (build_variant == "root") {
5058ec469eSopenharmony_ci  miscdevice_default_defines += [ "BUILD_VARIANT_ENG" ]
5158ec469eSopenharmony_ci  miscdevice_build_eng = true
5258ec469eSopenharmony_ci} else {
5358ec469eSopenharmony_ci  miscdevice_build_eng = false
5458ec469eSopenharmony_ci}
5558ec469eSopenharmony_ci
5658ec469eSopenharmony_ciif (!defined(global_parts_info) ||
5758ec469eSopenharmony_ci    defined(global_parts_info.hdf_drivers_interface_vibrator)) {
5858ec469eSopenharmony_ci  miscdevice_feature_hdf_drivers_interface_vibrator = true
5958ec469eSopenharmony_ci  miscdevice_default_defines += [ "HDF_DRIVERS_INTERFACE_VIBRATOR" ]
6058ec469eSopenharmony_ci} else {
6158ec469eSopenharmony_ci  miscdevice_feature_hdf_drivers_interface_vibrator = false
6258ec469eSopenharmony_ci}
6358ec469eSopenharmony_ci
6458ec469eSopenharmony_ciif (!defined(global_parts_info) ||
6558ec469eSopenharmony_ci    defined(global_parts_info.hiviewdfx_hisysevent)) {
6658ec469eSopenharmony_ci  miscdevice_feature_hiviewdfx_hisysevent = true
6758ec469eSopenharmony_ci  miscdevice_default_defines += [ "HIVIEWDFX_HISYSEVENT_ENABLE" ]
6858ec469eSopenharmony_ci} else {
6958ec469eSopenharmony_ci  miscdevice_feature_hiviewdfx_hisysevent = false
7058ec469eSopenharmony_ci}
7158ec469eSopenharmony_ci
7258ec469eSopenharmony_ciif (!defined(global_parts_info) ||
7358ec469eSopenharmony_ci    defined(global_parts_info.hiviewdfx_hitrace)) {
7458ec469eSopenharmony_ci  miscdevice_feature_hiviewdfx_hitrace = true
7558ec469eSopenharmony_ci  miscdevice_default_defines += [ "HIVIEWDFX_HITRACE_ENABLE" ]
7658ec469eSopenharmony_ci} else {
7758ec469eSopenharmony_ci  miscdevice_feature_hiviewdfx_hitrace = false
7858ec469eSopenharmony_ci}
79