blob: dc7c75a775ecb19d958a69e1ca1472344b78993a [file] [log] [blame]
Colin Cross45a1b9c2017-04-19 16:56:46 -07001// Copyright (C) 2013 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
Prabir Pradhan9244aea2020-02-05 20:31:40 -080015// Default flags to be used throughout all libraries in inputflinger.
Bob Badour3306e492021-02-25 15:35:37 -080016package {
17 // See: http://go/android-license-faq
18 // A large-scale-change added 'default_applicable_licenses' to import
19 // all of the 'license_kinds' from "frameworks_native_license"
20 // to get the below license kinds:
21 // SPDX-license-identifier-Apache-2.0
22 default_applicable_licenses: ["frameworks_native_license"],
23}
24
Michael Wright8e9a8562022-02-09 13:44:29 +000025inputflinger_tidy_checks = [
26 "android-*",
27]
28
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080029cc_defaults {
30 name: "inputflinger_defaults",
Siarhei Vishniakouf47c339e2021-12-30 11:22:26 -080031 cpp_std: "c++20",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080032 cflags: [
33 "-Wall",
34 "-Wextra",
35 "-Werror",
36 "-Wno-unused-parameter",
37 "-Wthread-safety",
Siarhei Vishniakoub4d960d2019-10-03 15:38:44 -050038 "-Wshadow",
Siarhei Vishniakou3cab9b62020-08-05 11:45:47 -050039 "-Wshadow-field-in-constructor-modified",
40 "-Wshadow-uncaptured-local",
Siarhei Vishniakouaed7ad02022-08-03 15:04:33 -070041 "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080042 ],
Siarhei Vishniakoud549b252020-08-11 11:25:26 -050043 sanitize: {
Siarhei Vishniakou31977182022-09-30 08:51:23 -070044 misc_undefined: [
45 "bounds",
46 ],
Siarhei Vishniakoud549b252020-08-11 11:25:26 -050047 },
Michael Wright8e9a8562022-02-09 13:44:29 +000048 tidy: true,
49 tidy_checks: [
50 "-*", // Disable all checks not explicitly enabled for now
51 ] + inputflinger_tidy_checks,
52 tidy_checks_as_errors: inputflinger_tidy_checks,
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080053}
54
Prabir Pradhan9244aea2020-02-05 20:31:40 -080055/////////////////////////////////////////////////
56// libinputflinger
57/////////////////////////////////////////////////
Colin Cross45a1b9c2017-04-19 16:56:46 -070058
Prabir Pradhan9244aea2020-02-05 20:31:40 -080059filegroup {
60 name: "libinputflinger_sources",
Colin Cross45a1b9c2017-04-19 16:56:46 -070061 srcs: [
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080062 "InputCommonConverter.cpp",
Prabir Pradhanaddf8e92023-04-06 00:28:48 +000063 "InputDeviceMetricsCollector.cpp",
Siarhei Vishniakou31977182022-09-30 08:51:23 -070064 "InputProcessor.cpp",
Siarhei Vishniakoua3c8e512022-02-10 19:46:34 -080065 "PreferStylusOverTouchBlocker.cpp",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070066 "UnwantedInteractionBlocker.cpp",
Colin Cross45a1b9c2017-04-19 16:56:46 -070067 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -080068}
Colin Cross45a1b9c2017-04-19 16:56:46 -070069
Prabir Pradhan9244aea2020-02-05 20:31:40 -080070cc_defaults {
71 name: "libinputflinger_defaults",
72 srcs: [":libinputflinger_sources"],
Colin Cross45a1b9c2017-04-19 16:56:46 -070073 shared_libs: [
Harry Cuttsd1f18fa2022-12-08 14:28:02 +000074 "android.hardware.input.processor-V1-ndk",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080075 "libbase",
Colin Cross45a1b9c2017-04-19 16:56:46 -070076 "libbinder",
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080077 "libbinder_ndk",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070078 "libchrome",
Gang Wang342c9272020-01-13 13:15:04 -050079 "libcrypto",
Colin Cross45a1b9c2017-04-19 16:56:46 -070080 "libcutils",
Siarhei Vishniakou473174e2017-12-27 16:44:42 -080081 "libhidlbase",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +000082 "libkll",
Colin Cross45a1b9c2017-04-19 16:56:46 -070083 "liblog",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +000084 "libprotobuf-cpp-lite",
Siarhei Vishniakoude4bf152019-08-16 11:12:52 -050085 "libstatslog",
Colin Cross45a1b9c2017-04-19 16:56:46 -070086 "libutils",
Siarhei Vishniakoua04181f2021-03-26 05:56:49 +000087 "server_configurable_flags",
Colin Cross45a1b9c2017-04-19 16:56:46 -070088 ],
chaviw09c8d2d2020-08-24 15:48:26 -070089 static_libs: [
90 "libattestation",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070091 "libpalmrejection",
Siarhei Vishniakou862ae212022-09-28 15:17:28 -070092 "libui-types",
chaviw09c8d2d2020-08-24 15:48:26 -070093 ],
Siarhei Vishniakou31977182022-09-30 08:51:23 -070094 target: {
95 android: {
96 shared_libs: [
97 "libgui",
98 "libinput",
99 "libstatspull",
100 "libstatssocket",
101 ],
102 },
103 host: {
104 static_libs: [
105 "libinput",
106 "libstatspull",
107 "libstatssocket",
108 ],
Siarhei Vishniakou8bea9db2023-06-15 19:51:24 -0700109 include_dirs: [
110 "bionic/libc/kernel/android/uapi/",
111 "bionic/libc/kernel/uapi",
112 ],
113 cflags: [
114 "-D__ANDROID_HOST__",
115 ],
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700116 },
117 },
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800118}
Colin Cross45a1b9c2017-04-19 16:56:46 -0700119
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800120cc_library_shared {
121 name: "libinputflinger",
122 defaults: [
123 "inputflinger_defaults",
124 "libinputflinger_defaults",
Garfield Tane84e6f92019-08-29 17:28:41 -0700125 ],
Siarhei Vishniakou45b703e2022-11-18 15:33:27 -0800126 srcs: [
127 "InputManager.cpp",
128 // other sources are added via "defaults"
129 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700130 cflags: [
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800131 // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
Colin Cross45a1b9c2017-04-19 16:56:46 -0700132 //-fvisibility=hidden
133 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800134 shared_libs: [
135 // This should consist only of dependencies from inputflinger. Other dependencies should be
136 // in cc_defaults so that they are included in the tests.
137 "libinputflinger_base",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800138 "libinputreader",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700139 "libinputreporter",
Prabir Pradhanaddf8e92023-04-06 00:28:48 +0000140 "libPlatformProperties",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800141 ],
142 static_libs: [
143 "libinputdispatcher",
144 ],
145 export_static_lib_headers: [
146 "libinputdispatcher",
147 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800148 export_include_dirs: [
149 ".",
150 "include",
151 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800152}
153
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800154/////////////////////////////////////////////////
155// libinputflinger_base
156/////////////////////////////////////////////////
157
Prabir Pradhan29c95332018-11-14 20:14:11 -0800158cc_library_headers {
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800159 name: "libinputflinger_headers",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700160 host_supported: true,
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800161 export_include_dirs: ["include"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800162}
163
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800164filegroup {
165 name: "libinputflinger_base_sources",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800166 srcs: [
167 "InputListener.cpp",
168 "InputReaderBase.cpp",
Prabir Pradhan5a57cff2019-10-31 18:40:33 -0700169 "InputThread.cpp",
Siarhei Vishniakou78513032022-09-15 18:42:05 -0700170 "NotifyArgs.cpp",
Prabir Pradhan8b89c2f2021-07-29 16:30:14 +0000171 "VibrationElement.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800172 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800173}
Prabir Pradhan29c95332018-11-14 20:14:11 -0800174
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800175cc_defaults {
176 name: "libinputflinger_base_defaults",
177 srcs: [":libinputflinger_base_sources"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800178 shared_libs: [
179 "libbase",
Zim23457d02022-08-17 12:57:41 +0100180 "libbinder",
Garfield Tanff1f1bb2020-01-28 13:24:04 -0800181 "libcutils",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800182 "liblog",
183 "libutils",
184 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800185 header_libs: [
186 "libinputflinger_headers",
187 ],
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700188 target: {
189 android: {
190 shared_libs: [
191 "libinput",
192 ],
193 },
194 host: {
195 static_libs: [
196 "libinput",
Colin Cross5b799302022-10-18 21:52:41 -0700197 "libui-types",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700198 ],
199 },
200 },
Colin Cross45a1b9c2017-04-19 16:56:46 -0700201}
202
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800203cc_library_shared {
204 name: "libinputflinger_base",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700205 host_supported: true,
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800206 defaults: [
207 "inputflinger_defaults",
208 "libinputflinger_base_defaults",
209 ],
210 export_header_lib_headers: [
211 "libinputflinger_headers",
212 ],
213}
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700214
215// This target will build everything 'input-related'. This could be useful for
216// large refactorings of the input code. This is similar to 'm checkbuild', but
217// just for input code.
218// Use 'm checkinput' to build, and then (optionally) use 'm installclean' to
219// remove any of the installed artifacts that you may not want on your actual
220// build.
221phony {
222 name: "checkinput",
223 required: [
224 // native targets
Siarhei Vishniakou63b63612023-04-12 11:00:23 -0700225 "libgui_test",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700226 "libinput",
227 "libinputflinger",
228 "inputflinger_tests",
229 "inputflinger_benchmarks",
230 "libinput_tests",
231 "libpalmrejection_test",
232 "libandroid_runtime",
233 "libinputservice_test",
234 "Bug-115739809",
235 "StructLayout_test",
Siarhei Vishniakou2a916c42023-04-17 10:37:05 -0700236 // currently unused, but still must build correctly
237 "inputflinger",
238 "libinputflingerhost",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700239
Siarhei Vishniakou5c02a712023-05-15 15:45:02 -0700240 // rust targets
241 "libinput_rust_test",
242
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700243 // native fuzzers
Siarhei Vishniakou400294a2022-08-03 17:58:57 -0700244 "inputflinger_latencytracker_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700245 "inputflinger_cursor_input_fuzzer",
246 "inputflinger_keyboard_input_fuzzer",
247 "inputflinger_multitouch_input_fuzzer",
248 "inputflinger_switch_input_fuzzer",
249 "inputflinger_input_reader_fuzzer",
250 "inputflinger_blocking_queue_fuzzer",
251 "inputflinger_input_classifier_fuzzer",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700252
253 // Java/Kotlin targets
254 "CtsWindowManagerDeviceTestCases",
255 "InputTests",
256 "CtsHardwareTestCases",
257 "CtsInputTestCases",
258 "CtsViewTestCases",
259 "CtsWidgetTestCases",
260 "FrameworksCoreTests",
261 "FrameworksServicesTests",
262 "CtsSecurityTestCases",
263 "CtsSecurityBulletinHostTestCases",
264 ],
265}