blob: 69df45bc3eb4bb599b49cc885d146e7c38876031 [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",
Siarhei Vishniakou31977182022-09-30 08:51:23 -070063 "InputProcessor.cpp",
Siarhei Vishniakoua3c8e512022-02-10 19:46:34 -080064 "PreferStylusOverTouchBlocker.cpp",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070065 "UnwantedInteractionBlocker.cpp",
Colin Cross45a1b9c2017-04-19 16:56:46 -070066 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -080067}
Colin Cross45a1b9c2017-04-19 16:56:46 -070068
Prabir Pradhan9244aea2020-02-05 20:31:40 -080069cc_defaults {
70 name: "libinputflinger_defaults",
71 srcs: [":libinputflinger_sources"],
Colin Cross45a1b9c2017-04-19 16:56:46 -070072 shared_libs: [
Harry Cuttsd1f18fa2022-12-08 14:28:02 +000073 "android.hardware.input.processor-V1-ndk",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080074 "libbase",
Colin Cross45a1b9c2017-04-19 16:56:46 -070075 "libbinder",
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080076 "libbinder_ndk",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070077 "libchrome",
Gang Wang342c9272020-01-13 13:15:04 -050078 "libcrypto",
Colin Cross45a1b9c2017-04-19 16:56:46 -070079 "libcutils",
Siarhei Vishniakou473174e2017-12-27 16:44:42 -080080 "libhidlbase",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +000081 "libkll",
Colin Cross45a1b9c2017-04-19 16:56:46 -070082 "liblog",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +000083 "libprotobuf-cpp-lite",
Siarhei Vishniakoude4bf152019-08-16 11:12:52 -050084 "libstatslog",
Colin Cross45a1b9c2017-04-19 16:56:46 -070085 "libutils",
Siarhei Vishniakoua04181f2021-03-26 05:56:49 +000086 "server_configurable_flags",
Colin Cross45a1b9c2017-04-19 16:56:46 -070087 ],
chaviw09c8d2d2020-08-24 15:48:26 -070088 static_libs: [
89 "libattestation",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070090 "libpalmrejection",
Siarhei Vishniakou862ae212022-09-28 15:17:28 -070091 "libui-types",
chaviw09c8d2d2020-08-24 15:48:26 -070092 ],
Siarhei Vishniakou31977182022-09-30 08:51:23 -070093 target: {
94 android: {
95 shared_libs: [
96 "libgui",
97 "libinput",
98 "libstatspull",
99 "libstatssocket",
100 ],
101 },
102 host: {
103 static_libs: [
104 "libinput",
105 "libstatspull",
106 "libstatssocket",
107 ],
108 },
109 },
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800110}
Colin Cross45a1b9c2017-04-19 16:56:46 -0700111
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800112cc_library_shared {
113 name: "libinputflinger",
114 defaults: [
115 "inputflinger_defaults",
116 "libinputflinger_defaults",
Garfield Tane84e6f92019-08-29 17:28:41 -0700117 ],
Siarhei Vishniakou45b703e2022-11-18 15:33:27 -0800118 srcs: [
119 "InputManager.cpp",
120 // other sources are added via "defaults"
121 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700122 cflags: [
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800123 // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
Colin Cross45a1b9c2017-04-19 16:56:46 -0700124 //-fvisibility=hidden
125 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800126 shared_libs: [
127 // This should consist only of dependencies from inputflinger. Other dependencies should be
128 // in cc_defaults so that they are included in the tests.
129 "libinputflinger_base",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800130 "libinputreader",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700131 "libinputreporter",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800132 ],
133 static_libs: [
134 "libinputdispatcher",
135 ],
136 export_static_lib_headers: [
137 "libinputdispatcher",
138 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800139 export_include_dirs: [
140 ".",
141 "include",
142 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800143}
144
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800145/////////////////////////////////////////////////
146// libinputflinger_base
147/////////////////////////////////////////////////
148
Prabir Pradhan29c95332018-11-14 20:14:11 -0800149cc_library_headers {
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800150 name: "libinputflinger_headers",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700151 host_supported: true,
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800152 export_include_dirs: ["include"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800153}
154
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800155filegroup {
156 name: "libinputflinger_base_sources",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800157 srcs: [
158 "InputListener.cpp",
159 "InputReaderBase.cpp",
Prabir Pradhan5a57cff2019-10-31 18:40:33 -0700160 "InputThread.cpp",
Siarhei Vishniakou78513032022-09-15 18:42:05 -0700161 "NotifyArgs.cpp",
Prabir Pradhan8b89c2f2021-07-29 16:30:14 +0000162 "VibrationElement.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800163 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800164}
Prabir Pradhan29c95332018-11-14 20:14:11 -0800165
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800166cc_defaults {
167 name: "libinputflinger_base_defaults",
168 srcs: [":libinputflinger_base_sources"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800169 shared_libs: [
170 "libbase",
Zim23457d02022-08-17 12:57:41 +0100171 "libbinder",
Garfield Tanff1f1bb2020-01-28 13:24:04 -0800172 "libcutils",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800173 "liblog",
174 "libutils",
175 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800176 header_libs: [
177 "libinputflinger_headers",
178 ],
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700179 target: {
180 android: {
181 shared_libs: [
182 "libinput",
183 ],
184 },
185 host: {
186 static_libs: [
187 "libinput",
Colin Cross5b799302022-10-18 21:52:41 -0700188 "libui-types",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700189 ],
190 },
191 },
Colin Cross45a1b9c2017-04-19 16:56:46 -0700192}
193
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800194cc_library_shared {
195 name: "libinputflinger_base",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700196 host_supported: true,
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800197 defaults: [
198 "inputflinger_defaults",
199 "libinputflinger_base_defaults",
200 ],
201 export_header_lib_headers: [
202 "libinputflinger_headers",
203 ],
204}
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700205
206// This target will build everything 'input-related'. This could be useful for
207// large refactorings of the input code. This is similar to 'm checkbuild', but
208// just for input code.
209// Use 'm checkinput' to build, and then (optionally) use 'm installclean' to
210// remove any of the installed artifacts that you may not want on your actual
211// build.
212phony {
213 name: "checkinput",
214 required: [
215 // native targets
Siarhei Vishniakou63b63612023-04-12 11:00:23 -0700216 "libgui_test",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700217 "libinput",
218 "libinputflinger",
219 "inputflinger_tests",
220 "inputflinger_benchmarks",
221 "libinput_tests",
222 "libpalmrejection_test",
223 "libandroid_runtime",
224 "libinputservice_test",
225 "Bug-115739809",
226 "StructLayout_test",
Siarhei Vishniakou2a916c42023-04-17 10:37:05 -0700227 // currently unused, but still must build correctly
228 "inputflinger",
229 "libinputflingerhost",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700230
231 // native fuzzers
Siarhei Vishniakou400294a2022-08-03 17:58:57 -0700232 "inputflinger_latencytracker_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700233 "inputflinger_cursor_input_fuzzer",
234 "inputflinger_keyboard_input_fuzzer",
235 "inputflinger_multitouch_input_fuzzer",
236 "inputflinger_switch_input_fuzzer",
237 "inputflinger_input_reader_fuzzer",
238 "inputflinger_blocking_queue_fuzzer",
239 "inputflinger_input_classifier_fuzzer",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700240
241 // Java/Kotlin targets
242 "CtsWindowManagerDeviceTestCases",
243 "InputTests",
244 "CtsHardwareTestCases",
245 "CtsInputTestCases",
246 "CtsViewTestCases",
247 "CtsWidgetTestCases",
248 "FrameworksCoreTests",
249 "FrameworksServicesTests",
250 "CtsSecurityTestCases",
251 "CtsSecurityBulletinHostTestCases",
252 ],
253}