blob: d1de5517996cfce09991bc6c0372e797a726d0ba [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 "InputManager.cpp",
64 "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: [
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080074 "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 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700119 cflags: [
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800120 // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
Colin Cross45a1b9c2017-04-19 16:56:46 -0700121 //-fvisibility=hidden
122 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800123 shared_libs: [
124 // This should consist only of dependencies from inputflinger. Other dependencies should be
125 // in cc_defaults so that they are included in the tests.
126 "libinputflinger_base",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800127 "libinputreader",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700128 "libinputreporter",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800129 ],
130 static_libs: [
131 "libinputdispatcher",
132 ],
133 export_static_lib_headers: [
134 "libinputdispatcher",
135 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800136 export_include_dirs: [
137 ".",
138 "include",
139 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800140}
141
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800142/////////////////////////////////////////////////
143// libinputflinger_base
144/////////////////////////////////////////////////
145
Prabir Pradhan29c95332018-11-14 20:14:11 -0800146cc_library_headers {
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800147 name: "libinputflinger_headers",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700148 host_supported: true,
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800149 export_include_dirs: ["include"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800150}
151
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800152filegroup {
153 name: "libinputflinger_base_sources",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800154 srcs: [
155 "InputListener.cpp",
156 "InputReaderBase.cpp",
Prabir Pradhan5a57cff2019-10-31 18:40:33 -0700157 "InputThread.cpp",
Siarhei Vishniakou78513032022-09-15 18:42:05 -0700158 "NotifyArgs.cpp",
Prabir Pradhan8b89c2f2021-07-29 16:30:14 +0000159 "VibrationElement.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800160 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800161}
Prabir Pradhan29c95332018-11-14 20:14:11 -0800162
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800163cc_defaults {
164 name: "libinputflinger_base_defaults",
165 srcs: [":libinputflinger_base_sources"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800166 shared_libs: [
167 "libbase",
Zim23457d02022-08-17 12:57:41 +0100168 "libbinder",
Garfield Tanff1f1bb2020-01-28 13:24:04 -0800169 "libcutils",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800170 "liblog",
171 "libutils",
172 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800173 header_libs: [
174 "libinputflinger_headers",
175 ],
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700176 target: {
177 android: {
178 shared_libs: [
179 "libinput",
180 ],
181 },
182 host: {
183 static_libs: [
184 "libinput",
Colin Cross5b799302022-10-18 21:52:41 -0700185 "libui-types",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700186 ],
187 },
188 },
Colin Cross45a1b9c2017-04-19 16:56:46 -0700189}
190
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800191cc_library_shared {
192 name: "libinputflinger_base",
Siarhei Vishniakou31977182022-09-30 08:51:23 -0700193 host_supported: true,
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800194 defaults: [
195 "inputflinger_defaults",
196 "libinputflinger_base_defaults",
197 ],
198 export_header_lib_headers: [
199 "libinputflinger_headers",
200 ],
201}
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700202
203// This target will build everything 'input-related'. This could be useful for
204// large refactorings of the input code. This is similar to 'm checkbuild', but
205// just for input code.
206// Use 'm checkinput' to build, and then (optionally) use 'm installclean' to
207// remove any of the installed artifacts that you may not want on your actual
208// build.
209phony {
210 name: "checkinput",
211 required: [
212 // native targets
213 "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 Vishniakou007713d2022-09-16 14:40:11 -0700223
224 // native fuzzers
Siarhei Vishniakou400294a2022-08-03 17:58:57 -0700225 "inputflinger_latencytracker_fuzzer",
Siarhei Vishniakou007713d2022-09-16 14:40:11 -0700226 "inputflinger_cursor_input_fuzzer",
227 "inputflinger_keyboard_input_fuzzer",
228 "inputflinger_multitouch_input_fuzzer",
229 "inputflinger_switch_input_fuzzer",
230 "inputflinger_input_reader_fuzzer",
231 "inputflinger_blocking_queue_fuzzer",
232 "inputflinger_input_classifier_fuzzer",
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700233
234 // Java/Kotlin targets
235 "CtsWindowManagerDeviceTestCases",
236 "InputTests",
237 "CtsHardwareTestCases",
238 "CtsInputTestCases",
239 "CtsViewTestCases",
240 "CtsWidgetTestCases",
241 "FrameworksCoreTests",
242 "FrameworksServicesTests",
243 "CtsSecurityTestCases",
244 "CtsSecurityBulletinHostTestCases",
245 ],
246}