/* * Copyright (C) 2023 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ filegroup { name: "sensors-rockchip.rc", srcs: ["sensors-rockchip.rc"], } filegroup { name: "sensors-rockchip.xml", srcs: ["sensors-rockchip.xml"], } soong_config_module_type { name: "sensor_rockchip_soong_gen_defaults", module_type: "cc_defaults", config_namespace: "sensor_rockchip", bool_variables: [ "gravity", "compass", "gyroscope", "proximity", "light", "pressure", "temperature", ], properties: ["cflags"], } sensor_rockchip_soong_gen_defaults { name: "sensor_rockchip_gen_defaults", soong_config_variables: { gravity: { cflags: ["-DGRAVITY_SENSOR_SUPPORT=1"], conditions_default: { cflags: ["-DGRAVITY_SENSOR_SUPPORT=0"], }, }, compass: { cflags: ["-DCOMPASS_SENSOR_SUPPORT=1"], conditions_default: { cflags: ["-DCOMPASS_SENSOR_SUPPORT=0"], }, }, gyroscope: { cflags: ["-DGYROSCOPE_SENSOR_SUPPORT=1"], conditions_default: { cflags: ["-DGYROSCOPE_SENSOR_SUPPORT=0"], }, }, proximity: { cflags: ["-DPROXIMITY_SENSOR_SUPPORT=1"], conditions_default: { cflags: ["-DPROXIMITY_SENSOR_SUPPORT=0"], }, }, light: { cflags: ["-DLIGHT_SENSOR_SUPPORT=1"], conditions_default: { cflags: ["-DLIGHT_SENSOR_SUPPORT=0"], }, }, pressure: { cflags: ["-DPRESSURE_SENSOR_SUPPORT=1"], conditions_default: { cflags: ["-DPRESSURE_SENSOR_SUPPORT=0"], }, }, temperature: { cflags: ["-DTEMPERATURE_SENSOR_SUPPORT=1"], conditions_default: { cflags: ["-DTEMPERATURE_SENSOR_SUPPORT=0"], }, }, }, } cc_library_static { name: "libsensors_rockchip_impl", vendor: true, defaults: ["sensor_rockchip_gen_defaults"], shared_libs: [ "libbase", "libfmq", "libpower", "libbinder_ndk", "android.hardware.sensors-V2-ndk", ], export_include_dirs: ["include"], srcs: [ "InputEventReader.cpp", "Sensors.cpp", "Sensor.cpp", "sensors/*.cpp", ], visibility: [ ":__subpackages__", "//hardware/interfaces/tests/extension/sensors:__subpackages__", ], } cc_binary { name: "android.hardware.sensors-service.rockchip", relative_install_path: "hw", init_rc: [":sensors-rockchip.rc"], vintf_fragments: [":sensors-rockchip.xml"], defaults: ["sensor_rockchip_gen_defaults"], vendor: true, shared_libs: [ "libbase", "libbinder_ndk", "libfmq", "libpower", "libcutils", "liblog", "libutils", "android.hardware.sensors-V2-ndk", ], static_libs: [ "libsensors_rockchip_impl", ], srcs: ["main.cpp"], }