blob: 88a9acb80e6c4fcf34c5ecb233bc4f9f1c3070be [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: {
44 misc_undefined: ["bounds"],
45 },
Michael Wright8e9a8562022-02-09 13:44:29 +000046 tidy: true,
47 tidy_checks: [
48 "-*", // Disable all checks not explicitly enabled for now
49 ] + inputflinger_tidy_checks,
50 tidy_checks_as_errors: inputflinger_tidy_checks,
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080051}
52
Prabir Pradhan9244aea2020-02-05 20:31:40 -080053/////////////////////////////////////////////////
54// libinputflinger
55/////////////////////////////////////////////////
Colin Cross45a1b9c2017-04-19 16:56:46 -070056
Prabir Pradhan9244aea2020-02-05 20:31:40 -080057filegroup {
58 name: "libinputflinger_sources",
Colin Cross45a1b9c2017-04-19 16:56:46 -070059 srcs: [
Siarhei Vishniakou98996032022-08-03 11:54:47 -070060 "InputProcessor.cpp",
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080061 "InputCommonConverter.cpp",
Siarhei Vishniakoua3c8e512022-02-10 19:46:34 -080062 "PreferStylusOverTouchBlocker.cpp",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070063 "UnwantedInteractionBlocker.cpp",
Colin Cross45a1b9c2017-04-19 16:56:46 -070064 "InputManager.cpp",
Colin Cross45a1b9c2017-04-19 16:56:46 -070065 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -080066}
Colin Cross45a1b9c2017-04-19 16:56:46 -070067
Prabir Pradhan9244aea2020-02-05 20:31:40 -080068cc_defaults {
69 name: "libinputflinger_defaults",
70 srcs: [":libinputflinger_sources"],
Colin Cross45a1b9c2017-04-19 16:56:46 -070071 shared_libs: [
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080072 "android.hardware.input.processor-V1-ndk",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080073 "libbase",
Colin Cross45a1b9c2017-04-19 16:56:46 -070074 "libbinder",
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080075 "libbinder_ndk",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070076 "libchrome",
Gang Wang342c9272020-01-13 13:15:04 -050077 "libcrypto",
Colin Cross45a1b9c2017-04-19 16:56:46 -070078 "libcutils",
Siarhei Vishniakou473174e2017-12-27 16:44:42 -080079 "libhidlbase",
Colin Cross45a1b9c2017-04-19 16:56:46 -070080 "libinput",
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",
Siarhei Vishniakoua04181f2021-03-26 05:56:49 +000085 "libstatspull",
86 "libstatssocket",
Colin Cross45a1b9c2017-04-19 16:56:46 -070087 "libutils",
88 "libui",
Siarhei Vishniakoua04181f2021-03-26 05:56:49 +000089 "server_configurable_flags",
Colin Cross45a1b9c2017-04-19 16:56:46 -070090 ],
chaviw09c8d2d2020-08-24 15:48:26 -070091 static_libs: [
92 "libattestation",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070093 "libpalmrejection",
chaviw09c8d2d2020-08-24 15:48:26 -070094 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -080095}
Colin Cross45a1b9c2017-04-19 16:56:46 -070096
Prabir Pradhan9244aea2020-02-05 20:31:40 -080097cc_library_shared {
98 name: "libinputflinger",
99 defaults: [
100 "inputflinger_defaults",
101 "libinputflinger_defaults",
Garfield Tane84e6f92019-08-29 17:28:41 -0700102 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700103 cflags: [
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800104 // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
Colin Cross45a1b9c2017-04-19 16:56:46 -0700105 //-fvisibility=hidden
106 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800107 shared_libs: [
108 // This should consist only of dependencies from inputflinger. Other dependencies should be
109 // in cc_defaults so that they are included in the tests.
110 "libinputflinger_base",
111 "libinputreporter",
112 "libinputreader",
chaviw15fab6f2021-06-07 14:15:52 -0500113 "libgui",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800114 ],
115 static_libs: [
116 "libinputdispatcher",
117 ],
118 export_static_lib_headers: [
119 "libinputdispatcher",
120 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800121 export_include_dirs: [
122 ".",
123 "include",
124 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800125}
126
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800127/////////////////////////////////////////////////
128// libinputflinger_base
129/////////////////////////////////////////////////
130
Prabir Pradhan29c95332018-11-14 20:14:11 -0800131cc_library_headers {
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800132 name: "libinputflinger_headers",
133 export_include_dirs: ["include"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800134}
135
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800136filegroup {
137 name: "libinputflinger_base_sources",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800138 srcs: [
139 "InputListener.cpp",
140 "InputReaderBase.cpp",
Prabir Pradhan5a57cff2019-10-31 18:40:33 -0700141 "InputThread.cpp",
Prabir Pradhan8b89c2f2021-07-29 16:30:14 +0000142 "VibrationElement.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800143 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800144}
Prabir Pradhan29c95332018-11-14 20:14:11 -0800145
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800146cc_defaults {
147 name: "libinputflinger_base_defaults",
148 srcs: [":libinputflinger_base_sources"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800149 shared_libs: [
150 "libbase",
Zim23457d02022-08-17 12:57:41 +0100151 "libbinder",
Garfield Tanff1f1bb2020-01-28 13:24:04 -0800152 "libcutils",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800153 "libinput",
154 "liblog",
chaviwfd9c1ed2020-07-01 10:57:59 -0700155 "libui",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800156 "libutils",
157 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800158 header_libs: [
159 "libinputflinger_headers",
160 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700161}
162
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800163cc_library_shared {
164 name: "libinputflinger_base",
165 defaults: [
166 "inputflinger_defaults",
167 "libinputflinger_base_defaults",
168 ],
169 export_header_lib_headers: [
170 "libinputflinger_headers",
171 ],
172}
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700173
174// This target will build everything 'input-related'. This could be useful for
175// large refactorings of the input code. This is similar to 'm checkbuild', but
176// just for input code.
177// Use 'm checkinput' to build, and then (optionally) use 'm installclean' to
178// remove any of the installed artifacts that you may not want on your actual
179// build.
180phony {
181 name: "checkinput",
182 required: [
183 // native targets
184 "libinput",
185 "libinputflinger",
186 "inputflinger_tests",
187 "inputflinger_benchmarks",
188 "libinput_tests",
189 "libpalmrejection_test",
190 "libandroid_runtime",
191 "libinputservice_test",
192 "Bug-115739809",
193 "StructLayout_test",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700194
195 // native fuzzers
Siarhei Vishniakou400294a2022-08-03 17:58:57 -0700196 "inputflinger_latencytracker_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700197 "inputflinger_cursor_input_fuzzer",
198 "inputflinger_keyboard_input_fuzzer",
199 "inputflinger_multitouch_input_fuzzer",
200 "inputflinger_switch_input_fuzzer",
201 "inputflinger_input_reader_fuzzer",
202 "inputflinger_blocking_queue_fuzzer",
203 "inputflinger_input_classifier_fuzzer",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700204
205 // Java/Kotlin targets
206 "CtsWindowManagerDeviceTestCases",
207 "InputTests",
208 "CtsHardwareTestCases",
209 "CtsInputTestCases",
210 "CtsViewTestCases",
211 "CtsWidgetTestCases",
212 "FrameworksCoreTests",
213 "FrameworksServicesTests",
214 "CtsSecurityTestCases",
215 "CtsSecurityBulletinHostTestCases",
216 ],
217}