1//
2// Copyright (C) 2019 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
16package {
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20soong_config_module_type {
21    name: "haptics_feature_cc_defaults",
22    module_type: "cc_defaults",
23    config_namespace: "haptics",
24    variables: [
25        "actuator_model",
26        "adaptive_haptics_feature",
27    ],
28    properties: ["cflags"],
29}
30
31soong_config_string_variable {
32    name: "actuator_model",
33    values: [
34        "luxshare_ict_081545",
35        "luxshare_ict_lt_xlra1906d",
36    ],
37}
38
39soong_config_string_variable {
40    name: "adaptive_haptics_feature",
41    values: [
42        "adaptive_haptics_v1",
43    ],
44}
45
46haptics_feature_cc_defaults {
47    name: "haptics_feature_defaults",
48    soong_config_variables: {
49        actuator_model: {
50            luxshare_ict_081545: {
51                cflags: [
52                    "-DLUXSHARE_ICT_081545",
53                ],
54            },
55            luxshare_ict_lt_xlra1906d: {
56                cflags: [
57                    "-DLUXSHARE_ICT_LT_XLRA1906D",
58                ],
59            },
60            conditions_default: {
61                cflags: [
62                    "-DUNSPECIFIED_ACTUATOR",
63                ],
64            },
65        },
66        adaptive_haptics_feature: {
67            adaptive_haptics_v1: {
68                cflags: [
69                    "-DADAPTIVE_HAPTICS_V1",
70                ],
71            },
72            conditions_default: {
73                cflags: [
74                    "-DDISABLE_ADAPTIVE_HAPTICS_FEATURE",
75                ],
76            },
77        },
78    },
79}
80
81cc_library {
82    name: "libvibecapo_proto",
83    vendor_available: true,
84    owner: "google",
85    defaults: [
86        "VibratorHalCs40l26BinaryDefaults",
87    ],
88    srcs: [
89        "proto/capo.proto",
90    ],
91    export_include_dirs: [
92        "proto",
93    ],
94    proto: {
95        type: "lite",
96        export_proto_headers: true,
97    },
98}
99
100cc_library {
101    name: "VibratorCapo",
102    defaults: [
103        "PixelVibratorBinaryDefaults",
104        "haptics_feature_defaults",
105    ],
106    srcs: [
107        "CapoDetector.cpp",
108    ],
109    shared_libs: [
110        "libcutils",
111        "libprotobuf-cpp-lite",
112    ],
113    static_libs: [
114        "chre_client",
115        "libvibecapo_proto",
116    ],
117    export_include_dirs: [
118        "proto",
119        ".",
120    ],
121    export_static_lib_headers: [
122        "libvibecapo_proto",
123    ],
124    vendor_available: true,
125}
126
127cc_defaults {
128    name: "VibratorCapoDefaults",
129    static_libs: [
130        "chre_client",
131        "libvibecapo_proto",
132        "VibratorCapo",
133    ],
134    shared_libs: [
135        "libprotobuf-cpp-lite",
136    ],
137}
138
139cc_library {
140    name: "PixelVibratorCommon",
141    srcs: [
142        "HardwareBase.cpp",
143    ],
144    shared_libs: [
145        "libbase",
146        "libcutils",
147        "liblog",
148        "libutils",
149    ],
150    cflags: [
151        "-DATRACE_TAG=(ATRACE_TAG_VIBRATOR | ATRACE_TAG_HAL)",
152        "-DLOG_TAG=\"VibratorCommon\"",
153    ],
154    export_include_dirs: ["."],
155    vendor_available: true,
156}
157
158cc_library {
159    name: "PixelVibratorStats",
160    vendor: true,
161    srcs: ["StatsBase.cpp"],
162    cflags: [
163        "-Werror",
164        "-Wall",
165        "-Wextra",
166        "-DATRACE_TAG=(ATRACE_TAG_VIBRATOR | ATRACE_TAG_HAL)",
167        "-DLOG_TAG=\"VibratorStats\"",
168    ],
169    shared_libs: [
170        "android.frameworks.stats-V2-ndk",
171        "libbase",
172        "libcutils",
173        "libbinder_ndk",
174        "liblog",
175        "libprotobuf-cpp-lite",
176        "libutils",
177        "pixelatoms-cpp",
178    ],
179}
180