blob: 86b3bde42a5f2aa25b1f6ba4fe71d48ee6d24ffd [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 ],
109 },
110 },
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800111}
Colin Cross45a1b9c2017-04-19 16:56:46 -0700112
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800113cc_library_shared {
114 name: "libinputflinger",
115 defaults: [
116 "inputflinger_defaults",
117 "libinputflinger_defaults",
Garfield Tane84e6f92019-08-29 17:28:41 -0700118 ],
Siarhei Vishniakou45b703e2022-11-18 15:33:27 -0800119 srcs: [
120 "InputManager.cpp",
121 // other sources are added via "defaults"
122 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700123 cflags: [
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800124 // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
Colin Cross45a1b9c2017-04-19 16:56:46 -0700125 //-fvisibility=hidden
126 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800127 shared_libs: [
128 // This should consist only of dependencies from inputflinger. Other dependencies should be
129 // in cc_defaults so that they are included in the tests.
130 "libinputflinger_base",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800131 "libinputreader",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700132 "libinputreporter",
Prabir Pradhanaddf8e92023-04-06 00:28:48 +0000133 "libPlatformProperties",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800134 ],
135 static_libs: [
136 "libinputdispatcher",
137 ],
138 export_static_lib_headers: [
139 "libinputdispatcher",
140 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800141 export_include_dirs: [
142 ".",
143 "include",
144 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800145}
146
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800147/////////////////////////////////////////////////
148// libinputflinger_base
149/////////////////////////////////////////////////
150
Prabir Pradhan29c95332018-11-14 20:14:11 -0800151cc_library_headers {
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800152 name: "libinputflinger_headers",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700153 host_supported: true,
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800154 export_include_dirs: ["include"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800155}
156
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800157filegroup {
158 name: "libinputflinger_base_sources",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800159 srcs: [
160 "InputListener.cpp",
161 "InputReaderBase.cpp",
Prabir Pradhan5a57cff2019-10-31 18:40:33 -0700162 "InputThread.cpp",
Siarhei Vishniakou78513032022-09-15 18:42:05 -0700163 "NotifyArgs.cpp",
Prabir Pradhan8b89c2f2021-07-29 16:30:14 +0000164 "VibrationElement.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800165 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800166}
Prabir Pradhan29c95332018-11-14 20:14:11 -0800167
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800168cc_defaults {
169 name: "libinputflinger_base_defaults",
170 srcs: [":libinputflinger_base_sources"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800171 shared_libs: [
172 "libbase",
Zim23457d02022-08-17 12:57:41 +0100173 "libbinder",
Garfield Tanff1f1bb2020-01-28 13:24:04 -0800174 "libcutils",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800175 "liblog",
176 "libutils",
177 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800178 header_libs: [
179 "libinputflinger_headers",
180 ],
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700181 target: {
182 android: {
183 shared_libs: [
184 "libinput",
185 ],
186 },
187 host: {
188 static_libs: [
189 "libinput",
Colin Cross5b799302022-10-18 21:52:41 -0700190 "libui-types",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700191 ],
192 },
193 },
Colin Cross45a1b9c2017-04-19 16:56:46 -0700194}
195
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800196cc_library_shared {
197 name: "libinputflinger_base",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700198 host_supported: true,
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800199 defaults: [
200 "inputflinger_defaults",
201 "libinputflinger_base_defaults",
202 ],
203 export_header_lib_headers: [
204 "libinputflinger_headers",
205 ],
206}
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700207
208// This target will build everything 'input-related'. This could be useful for
209// large refactorings of the input code. This is similar to 'm checkbuild', but
210// just for input code.
211// Use 'm checkinput' to build, and then (optionally) use 'm installclean' to
212// remove any of the installed artifacts that you may not want on your actual
213// build.
214phony {
215 name: "checkinput",
216 required: [
217 // native targets
Siarhei Vishniakou63b63612023-04-12 11:00:23 -0700218 "libgui_test",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700219 "libinput",
220 "libinputflinger",
221 "inputflinger_tests",
222 "inputflinger_benchmarks",
223 "libinput_tests",
224 "libpalmrejection_test",
225 "libandroid_runtime",
226 "libinputservice_test",
227 "Bug-115739809",
228 "StructLayout_test",
Siarhei Vishniakou2a916c42023-04-17 10:37:05 -0700229 // currently unused, but still must build correctly
230 "inputflinger",
231 "libinputflingerhost",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700232
Siarhei Vishniakou5c02a712023-05-15 15:45:02 -0700233 // rust targets
234 "libinput_rust_test",
235
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700236 // native fuzzers
Siarhei Vishniakou400294a2022-08-03 17:58:57 -0700237 "inputflinger_latencytracker_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700238 "inputflinger_cursor_input_fuzzer",
239 "inputflinger_keyboard_input_fuzzer",
240 "inputflinger_multitouch_input_fuzzer",
241 "inputflinger_switch_input_fuzzer",
242 "inputflinger_input_reader_fuzzer",
243 "inputflinger_blocking_queue_fuzzer",
244 "inputflinger_input_classifier_fuzzer",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700245
246 // Java/Kotlin targets
247 "CtsWindowManagerDeviceTestCases",
248 "InputTests",
249 "CtsHardwareTestCases",
250 "CtsInputTestCases",
251 "CtsViewTestCases",
252 "CtsWidgetTestCases",
253 "FrameworksCoreTests",
254 "FrameworksServicesTests",
255 "CtsSecurityTestCases",
256 "CtsSecurityBulletinHostTestCases",
257 ],
258}