blob: ca92ab5aca463dcd9f4ead6111ab1d0b6532a4a0 [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 {
Aditya Choudharyb48ed1d2024-01-31 11:06:10 +000017 default_team: "trendy_team_input_framework",
Bob Badour3306e492021-02-25 15:35:37 -080018 // See: http://go/android-license-faq
19 // A large-scale-change added 'default_applicable_licenses' to import
20 // all of the 'license_kinds' from "frameworks_native_license"
21 // to get the below license kinds:
22 // SPDX-license-identifier-Apache-2.0
23 default_applicable_licenses: ["frameworks_native_license"],
24}
25
Michael Wright8e9a8562022-02-09 13:44:29 +000026inputflinger_tidy_checks = [
27 "android-*",
28]
29
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080030cc_defaults {
31 name: "inputflinger_defaults",
Siarhei Vishniakou4c155eb2023-06-30 11:47:12 -070032 host_supported: true,
Siarhei Vishniakouf47c339e2021-12-30 11:22:26 -080033 cpp_std: "c++20",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080034 cflags: [
35 "-Wall",
36 "-Wextra",
37 "-Werror",
38 "-Wno-unused-parameter",
39 "-Wthread-safety",
Siarhei Vishniakoub4d960d2019-10-03 15:38:44 -050040 "-Wshadow",
Siarhei Vishniakou3cab9b62020-08-05 11:45:47 -050041 "-Wshadow-field-in-constructor-modified",
42 "-Wshadow-uncaptured-local",
Siarhei Vishniakouaed7ad02022-08-03 15:04:33 -070043 "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080044 ],
Siarhei Vishniakoud549b252020-08-11 11:25:26 -050045 sanitize: {
Siarhei Vishniakou31977182022-09-30 08:51:23 -070046 misc_undefined: [
47 "bounds",
48 ],
Siarhei Vishniakoud549b252020-08-11 11:25:26 -050049 },
Michael Wright8e9a8562022-02-09 13:44:29 +000050 tidy: true,
51 tidy_checks: [
52 "-*", // Disable all checks not explicitly enabled for now
53 ] + inputflinger_tidy_checks,
54 tidy_checks_as_errors: inputflinger_tidy_checks,
Siarhei Vishniakou4c155eb2023-06-30 11:47:12 -070055 target: {
56 host: {
57 sanitize: {
58 address: true,
Siarhei Vishniakou802959c2024-05-06 18:54:24 +000059 diag: {
60 cfi: true,
61 integer_overflow: true,
62 memtag_heap: true,
63 undefined: true,
64 misc_undefined: [
65 "bounds",
66 "all",
67 ],
68 },
Siarhei Vishniakou4c155eb2023-06-30 11:47:12 -070069 },
70 include_dirs: [
71 "bionic/libc/kernel/android/uapi/",
72 "bionic/libc/kernel/uapi",
73 ],
74 cflags: [
75 "-D__ANDROID_HOST__",
76 ],
77 },
78 },
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080079}
80
Prabir Pradhan9244aea2020-02-05 20:31:40 -080081/////////////////////////////////////////////////
82// libinputflinger
83/////////////////////////////////////////////////
Colin Cross45a1b9c2017-04-19 16:56:46 -070084
Prabir Pradhan9244aea2020-02-05 20:31:40 -080085filegroup {
86 name: "libinputflinger_sources",
Colin Cross45a1b9c2017-04-19 16:56:46 -070087 srcs: [
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080088 "InputCommonConverter.cpp",
Prabir Pradhanaddf8e92023-04-06 00:28:48 +000089 "InputDeviceMetricsCollector.cpp",
Vaibhav Devmurari5766aee2023-11-03 17:21:25 +000090 "InputFilter.cpp",
Vaibhav Devmurari93144682023-12-11 16:38:56 +000091 "InputFilterCallbacks.cpp",
Siarhei Vishniakou31977182022-09-30 08:51:23 -070092 "InputProcessor.cpp",
Prabir Pradhanb56e92c2023-06-09 23:40:37 +000093 "PointerChoreographer.cpp",
Siarhei Vishniakoua3c8e512022-02-10 19:46:34 -080094 "PreferStylusOverTouchBlocker.cpp",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070095 "UnwantedInteractionBlocker.cpp",
Colin Cross45a1b9c2017-04-19 16:56:46 -070096 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -080097}
Colin Cross45a1b9c2017-04-19 16:56:46 -070098
Prabir Pradhan9244aea2020-02-05 20:31:40 -080099cc_defaults {
100 name: "libinputflinger_defaults",
101 srcs: [":libinputflinger_sources"],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700102 shared_libs: [
Harry Cuttsd1f18fa2022-12-08 14:28:02 +0000103 "android.hardware.input.processor-V1-ndk",
Prabir Pradhan44e6e832023-06-06 00:03:25 +0000104 "com.android.server.inputflinger-ndk",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800105 "libbase",
Colin Cross45a1b9c2017-04-19 16:56:46 -0700106 "libbinder",
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -0800107 "libbinder_ndk",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -0700108 "libchrome",
Gang Wang342c9272020-01-13 13:15:04 -0500109 "libcrypto",
Colin Cross45a1b9c2017-04-19 16:56:46 -0700110 "libcutils",
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800111 "libhidlbase",
Prabir Pradhan89f71192023-06-15 22:14:15 +0000112 "libinput",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +0000113 "libkll",
Colin Cross45a1b9c2017-04-19 16:56:46 -0700114 "liblog",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +0000115 "libprotobuf-cpp-lite",
Siarhei Vishniakoude4bf152019-08-16 11:12:52 -0500116 "libstatslog",
Colin Cross45a1b9c2017-04-19 16:56:46 -0700117 "libutils",
Vova Sharaienko75ffb262024-01-03 00:12:37 +0000118 "libstatspull",
119 "libstatssocket",
Prabir Pradhanf4099452024-04-12 18:34:14 +0000120 "packagemanager_aidl-cpp",
Siarhei Vishniakoua04181f2021-03-26 05:56:49 +0000121 "server_configurable_flags",
Colin Cross45a1b9c2017-04-19 16:56:46 -0700122 ],
chaviw09c8d2d2020-08-24 15:48:26 -0700123 static_libs: [
124 "libattestation",
Prabir Pradhandae52792023-12-15 07:36:40 +0000125 "libperfetto_client_experimental",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -0700126 "libpalmrejection",
Siarhei Vishniakou862ae212022-09-28 15:17:28 -0700127 "libui-types",
chaviw09c8d2d2020-08-24 15:48:26 -0700128 ],
Prabir Pradhan44e6e832023-06-06 00:03:25 +0000129 generated_headers: [
130 "cxx-bridge-header",
131 "inputflinger_rs_bootstrap_bridge_header",
132 ],
133 header_libs: ["inputflinger_rs_bootstrap_cxx_headers"],
134 generated_sources: ["inputflinger_rs_bootstrap_bridge_code"],
135 whole_static_libs: ["libinputflinger_rs"],
136 export_shared_lib_headers: ["com.android.server.inputflinger-ndk"],
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700137 target: {
138 android: {
139 shared_libs: [
140 "libgui",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700141 ],
142 },
143 },
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800144}
Colin Cross45a1b9c2017-04-19 16:56:46 -0700145
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800146cc_library_shared {
147 name: "libinputflinger",
Siarhei Vishniakoucac84272023-06-28 14:43:25 -0700148 host_supported: true,
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800149 defaults: [
150 "inputflinger_defaults",
151 "libinputflinger_defaults",
Garfield Tane84e6f92019-08-29 17:28:41 -0700152 ],
Siarhei Vishniakou45b703e2022-11-18 15:33:27 -0800153 srcs: [
154 "InputManager.cpp",
155 // other sources are added via "defaults"
156 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700157 cflags: [
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800158 // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
Colin Cross45a1b9c2017-04-19 16:56:46 -0700159 //-fvisibility=hidden
160 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800161 shared_libs: [
162 // This should consist only of dependencies from inputflinger. Other dependencies should be
163 // in cc_defaults so that they are included in the tests.
164 "libinputflinger_base",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800165 "libinputreader",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700166 "libinputreporter",
Prabir Pradhanaddf8e92023-04-06 00:28:48 +0000167 "libPlatformProperties",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800168 ],
169 static_libs: [
170 "libinputdispatcher",
171 ],
172 export_static_lib_headers: [
173 "libinputdispatcher",
174 ],
Prabir Pradhan02f88332024-08-08 15:54:00 +0000175 export_shared_lib_headers: [
176 "libinputflinger_base",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800177 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800178}
179
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800180/////////////////////////////////////////////////
181// libinputflinger_base
182/////////////////////////////////////////////////
183
Prabir Pradhan29c95332018-11-14 20:14:11 -0800184cc_library_headers {
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800185 name: "libinputflinger_headers",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700186 host_supported: true,
Prabir Pradhan02f88332024-08-08 15:54:00 +0000187 export_include_dirs: [
188 "include",
189 ".",
190 ],
191 header_libs: [
192 "libchrome-gestures_headers",
193 ],
194 export_header_lib_headers: [
195 "libchrome-gestures_headers",
196 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800197}
198
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800199filegroup {
200 name: "libinputflinger_base_sources",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800201 srcs: [
Asmita Poddar631a14e2023-10-03 10:22:07 +0000202 "InputDeviceMetricsSource.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800203 "InputListener.cpp",
204 "InputReaderBase.cpp",
Prabir Pradhan5a57cff2019-10-31 18:40:33 -0700205 "InputThread.cpp",
Siarhei Vishniakou78513032022-09-15 18:42:05 -0700206 "NotifyArgs.cpp",
Prabir Pradhan8b89c2f2021-07-29 16:30:14 +0000207 "VibrationElement.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800208 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800209}
Prabir Pradhan29c95332018-11-14 20:14:11 -0800210
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800211cc_defaults {
212 name: "libinputflinger_base_defaults",
213 srcs: [":libinputflinger_base_sources"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800214 shared_libs: [
215 "libbase",
Zim23457d02022-08-17 12:57:41 +0100216 "libbinder",
Garfield Tanff1f1bb2020-01-28 13:24:04 -0800217 "libcutils",
Prabir Pradhan89f71192023-06-15 22:14:15 +0000218 "libinput",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800219 "liblog",
Jerry Chang27db62f2024-06-19 11:38:29 +0000220 "libprocessgroup",
Asmita Poddar631a14e2023-10-03 10:22:07 +0000221 "libstatslog",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800222 "libutils",
223 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800224 header_libs: [
225 "libinputflinger_headers",
226 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700227}
228
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800229cc_library_shared {
230 name: "libinputflinger_base",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700231 host_supported: true,
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800232 defaults: [
233 "inputflinger_defaults",
234 "libinputflinger_base_defaults",
235 ],
236 export_header_lib_headers: [
237 "libinputflinger_headers",
238 ],
239}
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700240
241// This target will build everything 'input-related'. This could be useful for
242// large refactorings of the input code. This is similar to 'm checkbuild', but
243// just for input code.
244// Use 'm checkinput' to build, and then (optionally) use 'm installclean' to
245// remove any of the installed artifacts that you may not want on your actual
246// build.
247phony {
248 name: "checkinput",
249 required: [
250 // native targets
Siarhei Vishniakou63b63612023-04-12 11:00:23 -0700251 "libgui_test",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700252 "libinput",
Siarhei Vishniakou4c155eb2023-06-30 11:47:12 -0700253 "libinputreader_static",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700254 "libinputflinger",
255 "inputflinger_tests",
256 "inputflinger_benchmarks",
257 "libinput_tests",
258 "libpalmrejection_test",
259 "libandroid_runtime",
260 "libinputservice_test",
261 "Bug-115739809",
262 "StructLayout_test",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700263
Siarhei Vishniakoufa2a0492023-11-14 13:13:18 -0800264 // jni
265 "libservices.core",
266
Siarhei Vishniakou5c02a712023-05-15 15:45:02 -0700267 // rust targets
268 "libinput_rust_test",
269
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700270 // native fuzzers
Siarhei Vishniakou400294a2022-08-03 17:58:57 -0700271 "inputflinger_latencytracker_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700272 "inputflinger_cursor_input_fuzzer",
273 "inputflinger_keyboard_input_fuzzer",
274 "inputflinger_multitouch_input_fuzzer",
275 "inputflinger_switch_input_fuzzer",
Harry Cuttsccb75e82023-06-23 14:08:06 +0000276 "inputflinger_touchpad_input_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700277 "inputflinger_input_reader_fuzzer",
278 "inputflinger_blocking_queue_fuzzer",
279 "inputflinger_input_classifier_fuzzer",
Siarhei Vishniakou2defec02023-06-08 17:24:44 -0700280 "inputflinger_input_dispatcher_fuzzer",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700281
282 // Java/Kotlin targets
Nataniel Borges45f243d2023-07-25 14:50:20 +0000283 "CtsWindowManagerDeviceWindow",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700284 "InputTests",
285 "CtsHardwareTestCases",
286 "CtsInputTestCases",
287 "CtsViewTestCases",
288 "CtsWidgetTestCases",
289 "FrameworksCoreTests",
290 "FrameworksServicesTests",
291 "CtsSecurityTestCases",
292 "CtsSecurityBulletinHostTestCases",
Siarhei Vishniakou27174942024-04-15 10:20:24 -0700293 "monkey_test",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700294 ],
295}