blob: 69f42bc800f66667f47a1dee67da64572d892bc9 [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 Vishniakou4c155eb2023-06-30 11:47:12 -070031 host_supported: true,
Siarhei Vishniakouf47c339e2021-12-30 11:22:26 -080032 cpp_std: "c++20",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080033 cflags: [
34 "-Wall",
35 "-Wextra",
36 "-Werror",
37 "-Wno-unused-parameter",
38 "-Wthread-safety",
Siarhei Vishniakoub4d960d2019-10-03 15:38:44 -050039 "-Wshadow",
Siarhei Vishniakou3cab9b62020-08-05 11:45:47 -050040 "-Wshadow-field-in-constructor-modified",
41 "-Wshadow-uncaptured-local",
Siarhei Vishniakouaed7ad02022-08-03 15:04:33 -070042 "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080043 ],
Siarhei Vishniakoud549b252020-08-11 11:25:26 -050044 sanitize: {
Siarhei Vishniakou31977182022-09-30 08:51:23 -070045 misc_undefined: [
46 "bounds",
47 ],
Siarhei Vishniakoud549b252020-08-11 11:25:26 -050048 },
Michael Wright8e9a8562022-02-09 13:44:29 +000049 tidy: true,
50 tidy_checks: [
51 "-*", // Disable all checks not explicitly enabled for now
52 ] + inputflinger_tidy_checks,
53 tidy_checks_as_errors: inputflinger_tidy_checks,
Siarhei Vishniakou4c155eb2023-06-30 11:47:12 -070054 target: {
55 host: {
56 sanitize: {
57 address: true,
58 },
59 include_dirs: [
60 "bionic/libc/kernel/android/uapi/",
61 "bionic/libc/kernel/uapi",
62 ],
63 cflags: [
64 "-D__ANDROID_HOST__",
65 ],
66 },
67 },
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080068}
69
Prabir Pradhan9244aea2020-02-05 20:31:40 -080070/////////////////////////////////////////////////
71// libinputflinger
72/////////////////////////////////////////////////
Colin Cross45a1b9c2017-04-19 16:56:46 -070073
Prabir Pradhan9244aea2020-02-05 20:31:40 -080074filegroup {
75 name: "libinputflinger_sources",
Colin Cross45a1b9c2017-04-19 16:56:46 -070076 srcs: [
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080077 "InputCommonConverter.cpp",
Prabir Pradhanaddf8e92023-04-06 00:28:48 +000078 "InputDeviceMetricsCollector.cpp",
Vaibhav Devmurari5766aee2023-11-03 17:21:25 +000079 "InputFilter.cpp",
Vaibhav Devmurari93144682023-12-11 16:38:56 +000080 "InputFilterCallbacks.cpp",
Siarhei Vishniakou31977182022-09-30 08:51:23 -070081 "InputProcessor.cpp",
Prabir Pradhanb56e92c2023-06-09 23:40:37 +000082 "PointerChoreographer.cpp",
Siarhei Vishniakoua3c8e512022-02-10 19:46:34 -080083 "PreferStylusOverTouchBlocker.cpp",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070084 "UnwantedInteractionBlocker.cpp",
Colin Cross45a1b9c2017-04-19 16:56:46 -070085 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -080086}
Colin Cross45a1b9c2017-04-19 16:56:46 -070087
Prabir Pradhan9244aea2020-02-05 20:31:40 -080088cc_defaults {
89 name: "libinputflinger_defaults",
90 srcs: [":libinputflinger_sources"],
Colin Cross45a1b9c2017-04-19 16:56:46 -070091 shared_libs: [
Harry Cuttsd1f18fa2022-12-08 14:28:02 +000092 "android.hardware.input.processor-V1-ndk",
Prabir Pradhan44e6e832023-06-06 00:03:25 +000093 "com.android.server.inputflinger-ndk",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080094 "libbase",
Colin Cross45a1b9c2017-04-19 16:56:46 -070095 "libbinder",
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080096 "libbinder_ndk",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070097 "libchrome",
Gang Wang342c9272020-01-13 13:15:04 -050098 "libcrypto",
Colin Cross45a1b9c2017-04-19 16:56:46 -070099 "libcutils",
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800100 "libhidlbase",
Prabir Pradhan89f71192023-06-15 22:14:15 +0000101 "libinput",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +0000102 "libkll",
Colin Cross45a1b9c2017-04-19 16:56:46 -0700103 "liblog",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +0000104 "libprotobuf-cpp-lite",
Siarhei Vishniakoude4bf152019-08-16 11:12:52 -0500105 "libstatslog",
Colin Cross45a1b9c2017-04-19 16:56:46 -0700106 "libutils",
Siarhei Vishniakoua04181f2021-03-26 05:56:49 +0000107 "server_configurable_flags",
Colin Cross45a1b9c2017-04-19 16:56:46 -0700108 ],
chaviw09c8d2d2020-08-24 15:48:26 -0700109 static_libs: [
110 "libattestation",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -0700111 "libpalmrejection",
Siarhei Vishniakou862ae212022-09-28 15:17:28 -0700112 "libui-types",
chaviw09c8d2d2020-08-24 15:48:26 -0700113 ],
Prabir Pradhan44e6e832023-06-06 00:03:25 +0000114 generated_headers: [
115 "cxx-bridge-header",
116 "inputflinger_rs_bootstrap_bridge_header",
117 ],
118 header_libs: ["inputflinger_rs_bootstrap_cxx_headers"],
119 generated_sources: ["inputflinger_rs_bootstrap_bridge_code"],
120 whole_static_libs: ["libinputflinger_rs"],
121 export_shared_lib_headers: ["com.android.server.inputflinger-ndk"],
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700122 target: {
123 android: {
124 shared_libs: [
125 "libgui",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700126 "libstatspull",
127 "libstatssocket",
128 ],
129 },
130 host: {
131 static_libs: [
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700132 "libstatspull",
133 "libstatssocket",
134 ],
135 },
136 },
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800137}
Colin Cross45a1b9c2017-04-19 16:56:46 -0700138
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800139cc_library_shared {
140 name: "libinputflinger",
Siarhei Vishniakoucac84272023-06-28 14:43:25 -0700141 host_supported: true,
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800142 defaults: [
143 "inputflinger_defaults",
144 "libinputflinger_defaults",
Garfield Tane84e6f92019-08-29 17:28:41 -0700145 ],
Siarhei Vishniakou45b703e2022-11-18 15:33:27 -0800146 srcs: [
147 "InputManager.cpp",
148 // other sources are added via "defaults"
149 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700150 cflags: [
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800151 // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
Colin Cross45a1b9c2017-04-19 16:56:46 -0700152 //-fvisibility=hidden
153 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800154 shared_libs: [
155 // This should consist only of dependencies from inputflinger. Other dependencies should be
156 // in cc_defaults so that they are included in the tests.
157 "libinputflinger_base",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800158 "libinputreader",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700159 "libinputreporter",
Prabir Pradhanaddf8e92023-04-06 00:28:48 +0000160 "libPlatformProperties",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800161 ],
162 static_libs: [
163 "libinputdispatcher",
164 ],
165 export_static_lib_headers: [
166 "libinputdispatcher",
167 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800168 export_include_dirs: [
169 ".",
170 "include",
171 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800172}
173
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800174/////////////////////////////////////////////////
175// libinputflinger_base
176/////////////////////////////////////////////////
177
Prabir Pradhan29c95332018-11-14 20:14:11 -0800178cc_library_headers {
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800179 name: "libinputflinger_headers",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700180 host_supported: true,
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800181 export_include_dirs: ["include"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800182}
183
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800184filegroup {
185 name: "libinputflinger_base_sources",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800186 srcs: [
Asmita Poddar631a14e2023-10-03 10:22:07 +0000187 "InputDeviceMetricsSource.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800188 "InputListener.cpp",
189 "InputReaderBase.cpp",
Prabir Pradhan5a57cff2019-10-31 18:40:33 -0700190 "InputThread.cpp",
Siarhei Vishniakou78513032022-09-15 18:42:05 -0700191 "NotifyArgs.cpp",
Prabir Pradhan8b89c2f2021-07-29 16:30:14 +0000192 "VibrationElement.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800193 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800194}
Prabir Pradhan29c95332018-11-14 20:14:11 -0800195
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800196cc_defaults {
197 name: "libinputflinger_base_defaults",
198 srcs: [":libinputflinger_base_sources"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800199 shared_libs: [
200 "libbase",
Zim23457d02022-08-17 12:57:41 +0100201 "libbinder",
Garfield Tanff1f1bb2020-01-28 13:24:04 -0800202 "libcutils",
Prabir Pradhan89f71192023-06-15 22:14:15 +0000203 "libinput",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800204 "liblog",
Asmita Poddar631a14e2023-10-03 10:22:07 +0000205 "libstatslog",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800206 "libutils",
207 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800208 header_libs: [
209 "libinputflinger_headers",
210 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700211}
212
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800213cc_library_shared {
214 name: "libinputflinger_base",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700215 host_supported: true,
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800216 defaults: [
217 "inputflinger_defaults",
218 "libinputflinger_base_defaults",
219 ],
220 export_header_lib_headers: [
221 "libinputflinger_headers",
222 ],
223}
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700224
225// This target will build everything 'input-related'. This could be useful for
226// large refactorings of the input code. This is similar to 'm checkbuild', but
227// just for input code.
228// Use 'm checkinput' to build, and then (optionally) use 'm installclean' to
229// remove any of the installed artifacts that you may not want on your actual
230// build.
231phony {
232 name: "checkinput",
233 required: [
234 // native targets
Siarhei Vishniakou63b63612023-04-12 11:00:23 -0700235 "libgui_test",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700236 "libinput",
Siarhei Vishniakou4c155eb2023-06-30 11:47:12 -0700237 "libinputreader_static",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700238 "libinputflinger",
239 "inputflinger_tests",
240 "inputflinger_benchmarks",
241 "libinput_tests",
242 "libpalmrejection_test",
243 "libandroid_runtime",
244 "libinputservice_test",
245 "Bug-115739809",
246 "StructLayout_test",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700247
Siarhei Vishniakoufa2a0492023-11-14 13:13:18 -0800248 // jni
249 "libservices.core",
250
Siarhei Vishniakou5c02a712023-05-15 15:45:02 -0700251 // rust targets
252 "libinput_rust_test",
253
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700254 // native fuzzers
Siarhei Vishniakou400294a2022-08-03 17:58:57 -0700255 "inputflinger_latencytracker_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700256 "inputflinger_cursor_input_fuzzer",
257 "inputflinger_keyboard_input_fuzzer",
258 "inputflinger_multitouch_input_fuzzer",
259 "inputflinger_switch_input_fuzzer",
Harry Cuttsccb75e82023-06-23 14:08:06 +0000260 "inputflinger_touchpad_input_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700261 "inputflinger_input_reader_fuzzer",
262 "inputflinger_blocking_queue_fuzzer",
263 "inputflinger_input_classifier_fuzzer",
Siarhei Vishniakou2defec02023-06-08 17:24:44 -0700264 "inputflinger_input_dispatcher_fuzzer",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700265
266 // Java/Kotlin targets
Nataniel Borges45f243d2023-07-25 14:50:20 +0000267 "CtsWindowManagerDeviceWindow",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700268 "InputTests",
269 "CtsHardwareTestCases",
270 "CtsInputTestCases",
271 "CtsViewTestCases",
272 "CtsWidgetTestCases",
273 "FrameworksCoreTests",
274 "FrameworksServicesTests",
275 "CtsSecurityTestCases",
276 "CtsSecurityBulletinHostTestCases",
277 ],
278}