blob: d62f4aa3255cf3780bce60a03da9db5b916a1cad [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 Vishniakou61291d42019-02-11 18:13:20 -080041 ],
Siarhei Vishniakoud549b252020-08-11 11:25:26 -050042 sanitize: {
43 misc_undefined: ["bounds"],
44 },
Michael Wright8e9a8562022-02-09 13:44:29 +000045 tidy: true,
46 tidy_checks: [
47 "-*", // Disable all checks not explicitly enabled for now
48 ] + inputflinger_tidy_checks,
49 tidy_checks_as_errors: inputflinger_tidy_checks,
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080050}
51
Prabir Pradhan9244aea2020-02-05 20:31:40 -080052/////////////////////////////////////////////////
53// libinputflinger
54/////////////////////////////////////////////////
Colin Cross45a1b9c2017-04-19 16:56:46 -070055
Prabir Pradhan9244aea2020-02-05 20:31:40 -080056filegroup {
57 name: "libinputflinger_sources",
Colin Cross45a1b9c2017-04-19 16:56:46 -070058 srcs: [
Siarhei Vishniakou98996032022-08-03 11:54:47 -070059 "InputProcessor.cpp",
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080060 "InputCommonConverter.cpp",
Siarhei Vishniakoua3c8e512022-02-10 19:46:34 -080061 "PreferStylusOverTouchBlocker.cpp",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070062 "UnwantedInteractionBlocker.cpp",
Colin Cross45a1b9c2017-04-19 16:56:46 -070063 "InputManager.cpp",
Colin Cross45a1b9c2017-04-19 16:56:46 -070064 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -080065}
Colin Cross45a1b9c2017-04-19 16:56:46 -070066
Prabir Pradhan9244aea2020-02-05 20:31:40 -080067cc_defaults {
68 name: "libinputflinger_defaults",
69 srcs: [":libinputflinger_sources"],
Colin Cross45a1b9c2017-04-19 16:56:46 -070070 shared_libs: [
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080071 "android.hardware.input.processor-V1-ndk",
Siarhei Vishniakou61291d42019-02-11 18:13:20 -080072 "libbase",
Colin Cross45a1b9c2017-04-19 16:56:46 -070073 "libbinder",
Siarhei Vishniakou34d6fef2022-02-01 19:03:45 -080074 "libbinder_ndk",
Siarhei Vishniakouba0a8752021-09-14 14:43:25 -070075 "libchrome",
Gang Wang342c9272020-01-13 13:15:04 -050076 "libcrypto",
Colin Cross45a1b9c2017-04-19 16:56:46 -070077 "libcutils",
Siarhei Vishniakou473174e2017-12-27 16:44:42 -080078 "libhidlbase",
Colin Cross45a1b9c2017-04-19 16:56:46 -070079 "libinput",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +000080 "libkll",
Colin Cross45a1b9c2017-04-19 16:56:46 -070081 "liblog",
Siarhei Vishniakou99b9d382021-04-01 08:03:41 +000082 "libprotobuf-cpp-lite",
Siarhei Vishniakoude4bf152019-08-16 11:12:52 -050083 "libstatslog",
Siarhei Vishniakoua04181f2021-03-26 05:56:49 +000084 "libstatspull",
85 "libstatssocket",
Colin Cross45a1b9c2017-04-19 16:56:46 -070086 "libutils",
87 "libui",
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",
chaviw09c8d2d2020-08-24 15:48:26 -070093 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -080094}
Colin Cross45a1b9c2017-04-19 16:56:46 -070095
Prabir Pradhan9244aea2020-02-05 20:31:40 -080096cc_library_shared {
97 name: "libinputflinger",
98 defaults: [
99 "inputflinger_defaults",
100 "libinputflinger_defaults",
Garfield Tane84e6f92019-08-29 17:28:41 -0700101 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700102 cflags: [
Siarhei Vishniakou473174e2017-12-27 16:44:42 -0800103 // TODO(b/23084678): Move inputflinger to its own process and mark it hidden
Colin Cross45a1b9c2017-04-19 16:56:46 -0700104 //-fvisibility=hidden
105 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800106 shared_libs: [
107 // This should consist only of dependencies from inputflinger. Other dependencies should be
108 // in cc_defaults so that they are included in the tests.
109 "libinputflinger_base",
110 "libinputreporter",
111 "libinputreader",
chaviw15fab6f2021-06-07 14:15:52 -0500112 "libgui",
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800113 ],
114 static_libs: [
115 "libinputdispatcher",
116 ],
117 export_static_lib_headers: [
118 "libinputdispatcher",
119 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800120 export_include_dirs: [
121 ".",
122 "include",
123 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800124}
125
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800126/////////////////////////////////////////////////
127// libinputflinger_base
128/////////////////////////////////////////////////
129
Prabir Pradhan29c95332018-11-14 20:14:11 -0800130cc_library_headers {
Siarhei Vishniakou61291d42019-02-11 18:13:20 -0800131 name: "libinputflinger_headers",
132 export_include_dirs: ["include"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800133}
134
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800135filegroup {
136 name: "libinputflinger_base_sources",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800137 srcs: [
138 "InputListener.cpp",
139 "InputReaderBase.cpp",
Prabir Pradhan5a57cff2019-10-31 18:40:33 -0700140 "InputThread.cpp",
Prabir Pradhan8b89c2f2021-07-29 16:30:14 +0000141 "VibrationElement.cpp",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800142 ],
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800143}
Prabir Pradhan29c95332018-11-14 20:14:11 -0800144
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800145cc_defaults {
146 name: "libinputflinger_base_defaults",
147 srcs: [":libinputflinger_base_sources"],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800148 shared_libs: [
149 "libbase",
Garfield Tanff1f1bb2020-01-28 13:24:04 -0800150 "libcutils",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800151 "libinput",
152 "liblog",
chaviwfd9c1ed2020-07-01 10:57:59 -0700153 "libui",
Prabir Pradhan29c95332018-11-14 20:14:11 -0800154 "libutils",
155 ],
Prabir Pradhan29c95332018-11-14 20:14:11 -0800156 header_libs: [
157 "libinputflinger_headers",
158 ],
Colin Cross45a1b9c2017-04-19 16:56:46 -0700159}
160
Prabir Pradhan9244aea2020-02-05 20:31:40 -0800161cc_library_shared {
162 name: "libinputflinger_base",
163 defaults: [
164 "inputflinger_defaults",
165 "libinputflinger_base_defaults",
166 ],
167 export_header_lib_headers: [
168 "libinputflinger_headers",
169 ],
170}
Siarhei Vishniakouce555312022-07-21 17:52:02 -0700171
172// This target will build everything 'input-related'. This could be useful for
173// large refactorings of the input code. This is similar to 'm checkbuild', but
174// just for input code.
175// Use 'm checkinput' to build, and then (optionally) use 'm installclean' to
176// remove any of the installed artifacts that you may not want on your actual
177// build.
178phony {
179 name: "checkinput",
180 required: [
181 // native targets
182 "libinput",
183 "libinputflinger",
184 "inputflinger_tests",
185 "inputflinger_benchmarks",
186 "libinput_tests",
187 "libpalmrejection_test",
188 "libandroid_runtime",
189 "libinputservice_test",
190 "Bug-115739809",
191 "StructLayout_test",
192
193 // Java/Kotlin targets
194 "CtsWindowManagerDeviceTestCases",
195 "InputTests",
196 "CtsHardwareTestCases",
197 "CtsInputTestCases",
198 "CtsViewTestCases",
199 "CtsWidgetTestCases",
200 "FrameworksCoreTests",
201 "FrameworksServicesTests",
202 "CtsSecurityTestCases",
203 "CtsSecurityBulletinHostTestCases",
204 ],
205}