1/*
2 * Copyright (C) 2020 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package {
18    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "device_generic_goldfish_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["device_generic_goldfish_license"],
24}
25
26filegroup {
27    name: "android.hardware.sensors@2.1-impl.virtual_srcs",
28    srcs: [
29        "multihal_sensors.cpp",
30        "multihal_sensors_epoll.cpp",
31        "multihal_sensors_qemu.cpp",
32        "sensor_list.cpp",
33    ]
34}
35
36cc_library_headers {
37    name: "android.hardware.sensors@2.1-impl.virtual_headers",
38    vendor_available: true,
39    export_include_dirs: ["include"],
40}
41
42cc_defaults {
43    name: "android.hardware.sensors@2.1-impl.virtual.defaults",
44    vendor: true,
45    relative_install_path: "hw",
46    defaults: ["hidl_defaults"],
47    srcs: [
48        ":android.hardware.sensors@2.1-impl.virtual_srcs",
49    ],
50    shared_libs: [
51        "android.hardware.sensors@2.0",
52        "android.hardware.sensors@2.1",
53        "android.hardware.sensors@2.0-ScopedWakelock",
54        "libbase",
55        "libhidlbase",
56        "liblog",
57        "libutils",
58    ],
59    header_libs: [
60        "android.hardware.sensors@2.X-multihal.header",
61        "android.hardware.sensors@2.1-impl.virtual_headers"
62    ],
63}
64
65cc_library_shared {
66    name: "android.hardware.sensors@2.1-impl.ranchu",
67    defaults: ["android.hardware.sensors@2.1-impl.virtual.defaults"],
68    srcs: [
69        "entry.cpp"
70    ],
71    static_libs: ["libqemud.ranchu"],
72    cflags: [
73        "-DLOG_TAG=\"android.hardware.sensors@2.1-impl.ranchu\"",
74        "-DANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION",
75    ],
76}
77