blob: 8f62629aa30e6d6c4176bc008b11a0890393b10a [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",
Prabir Pradhan89f71192023-06-15 22:14:15 +000082 "libinput",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +000083 "libkll",
Colin Cross45a1b9c2017-04-19 16:56:46 -070084 "liblog",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +000085 "libprotobuf-cpp-lite",
Siarhei Vishniakoude4bf152019-08-16 11:12:52 -050086 "libstatslog",
Colin Cross45a1b9c2017-04-19 16:56:46 -070087 "libutils",
Siarhei Vishniakoua04181f2021-03-26 05:56:49 +000088 "server_configurable_flags",
Colin Cross45a1b9c2017-04-19 16:56:46 -070089 ],
chaviw09c8d2d2020-08-24 15:48:26 -070090 static_libs: [
91 "libattestation",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070092 "libpalmrejection",
Siarhei Vishniakou862ae212022-09-28 15:17:28 -070093 "libui-types",
chaviw09c8d2d2020-08-24 15:48:26 -070094 ],
Siarhei Vishniakou31977182022-09-30 08:51:23 -070095 target: {
96 android: {
97 shared_libs: [
98 "libgui",
Siarhei Vishniakou31977182022-09-30 08:51:23 -070099 "libstatspull",
100 "libstatssocket",
101 ],
102 },
103 host: {
104 static_libs: [
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700105 "libstatspull",
106 "libstatssocket",
107 ],
Siarhei Vishniakou8bea9db2023-06-15 19:51:24 -0700108 include_dirs: [
109 "bionic/libc/kernel/android/uapi/",
110 "bionic/libc/kernel/uapi",
111 ],
112 cflags: [
113 "-D__ANDROID_HOST__",
114 ],
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700115 },
116 },
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800117}
Colin Cross45a1b9c2017-04-19 16:56:46 -0700118
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800119cc_library_shared {
120 name: "libinputflinger",
121 defaults: [
122 "inputflinger_defaults",
123 "libinputflinger_defaults",
Garfield Tane84e6f92019-08-29 17:28:41 -0700124 ],
Siarhei Vishniakou45b703e2022-11-18 15:33:27 -0800125 srcs: [
126 "InputManager.cpp",
127 // other sources are added via "defaults"
128 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700129 cflags: [
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800130 // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
Colin Cross45a1b9c2017-04-19 16:56:46 -0700131 //-fvisibility=hidden
132 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800133 shared_libs: [
134 // This should consist only of dependencies from inputflinger. Other dependencies should be
135 // in cc_defaults so that they are included in the tests.
136 "libinputflinger_base",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800137 "libinputreader",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700138 "libinputreporter",
Prabir Pradhanaddf8e92023-04-06 00:28:48 +0000139 "libPlatformProperties",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800140 ],
141 static_libs: [
142 "libinputdispatcher",
143 ],
144 export_static_lib_headers: [
145 "libinputdispatcher",
146 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800147 export_include_dirs: [
148 ".",
149 "include",
150 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800151}
152
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800153/////////////////////////////////////////////////
154// libinputflinger_base
155/////////////////////////////////////////////////
156
Prabir Pradhan29c95332018-11-14 20:14:11 -0800157cc_library_headers {
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800158 name: "libinputflinger_headers",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700159 host_supported: true,
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800160 export_include_dirs: ["include"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800161}
162
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800163filegroup {
164 name: "libinputflinger_base_sources",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800165 srcs: [
166 "InputListener.cpp",
167 "InputReaderBase.cpp",
Prabir Pradhan5a57cff2019-10-31 18:40:33 -0700168 "InputThread.cpp",
Siarhei Vishniakou78513032022-09-15 18:42:05 -0700169 "NotifyArgs.cpp",
Prabir Pradhan8b89c2f2021-07-29 16:30:14 +0000170 "VibrationElement.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800171 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800172}
Prabir Pradhan29c95332018-11-14 20:14:11 -0800173
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800174cc_defaults {
175 name: "libinputflinger_base_defaults",
176 srcs: [":libinputflinger_base_sources"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800177 shared_libs: [
178 "libbase",
Zim23457d02022-08-17 12:57:41 +0100179 "libbinder",
Garfield Tanff1f1bb2020-01-28 13:24:04 -0800180 "libcutils",
Prabir Pradhan89f71192023-06-15 22:14:15 +0000181 "libinput",
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 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700188}
189
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800190cc_library_shared {
191 name: "libinputflinger_base",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700192 host_supported: true,
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800193 defaults: [
194 "inputflinger_defaults",
195 "libinputflinger_base_defaults",
196 ],
197 export_header_lib_headers: [
198 "libinputflinger_headers",
199 ],
200}
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700201
202// This target will build everything 'input-related'. This could be useful for
203// large refactorings of the input code. This is similar to 'm checkbuild', but
204// just for input code.
205// Use 'm checkinput' to build, and then (optionally) use 'm installclean' to
206// remove any of the installed artifacts that you may not want on your actual
207// build.
208phony {
209 name: "checkinput",
210 required: [
211 // native targets
Siarhei Vishniakou63b63612023-04-12 11:00:23 -0700212 "libgui_test",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700213 "libinput",
214 "libinputflinger",
215 "inputflinger_tests",
216 "inputflinger_benchmarks",
217 "libinput_tests",
218 "libpalmrejection_test",
219 "libandroid_runtime",
220 "libinputservice_test",
221 "Bug-115739809",
222 "StructLayout_test",
Siarhei Vishniakou2a916c42023-04-17 10:37:05 -0700223 // currently unused, but still must build correctly
224 "inputflinger",
225 "libinputflingerhost",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700226
Siarhei Vishniakou5c02a712023-05-15 15:45:02 -0700227 // rust targets
228 "libinput_rust_test",
229
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700230 // native fuzzers
Siarhei Vishniakou400294a2022-08-03 17:58:57 -0700231 "inputflinger_latencytracker_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700232 "inputflinger_cursor_input_fuzzer",
233 "inputflinger_keyboard_input_fuzzer",
234 "inputflinger_multitouch_input_fuzzer",
235 "inputflinger_switch_input_fuzzer",
236 "inputflinger_input_reader_fuzzer",
237 "inputflinger_blocking_queue_fuzzer",
238 "inputflinger_input_classifier_fuzzer",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700239
240 // Java/Kotlin targets
241 "CtsWindowManagerDeviceTestCases",
242 "InputTests",
243 "CtsHardwareTestCases",
244 "CtsInputTestCases",
245 "CtsViewTestCases",
246 "CtsWidgetTestCases",
247 "FrameworksCoreTests",
248 "FrameworksServicesTests",
249 "CtsSecurityTestCases",
250 "CtsSecurityBulletinHostTestCases",
251 ],
252}