blob: 78731b1a7f9328841ea8105d9144201ef79d62eb [file] [log] [blame]
Dan Willemsen3106c1c2016-10-03 23:56:51 -07001// Copyright 2010 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.
Bob Badour3306e492021-02-25 15:35:37 -080014package {
15 // See: http://go/android-license-faq
16 // A large-scale-change added 'default_applicable_licenses' to import
17 // all of the 'license_kinds' from "frameworks_native_license"
18 // to get the below license kinds:
19 // SPDX-license-identifier-Apache-2.0
20 default_applicable_licenses: ["frameworks_native_license"],
21}
22
Jiyong Park172bd722017-06-21 12:14:18 +090023cc_library_headers {
24 name: "libgui_headers",
25 vendor_available: true,
26 export_include_dirs: ["include"],
Lajos Molnar7aa71e72019-04-01 15:34:32 -070027
28 // we must build this module to get the required header as that is generated
Marco Nelissencb04dee2019-10-28 12:55:47 -070029 export_shared_lib_headers: [
30 "android.hidl.token@1.0-utils",
31 "android.hardware.graphics.bufferqueue@1.0",
32 "android.hardware.graphics.bufferqueue@2.0",
33 ],
34 shared_libs: [
35 "android.hidl.token@1.0-utils",
36 "android.hardware.graphics.bufferqueue@1.0",
37 "android.hardware.graphics.bufferqueue@2.0",
38 ],
Jooyung Han7bcb8932020-04-16 18:48:32 +090039 min_sdk_version: "29",
Jiyong Park172bd722017-06-21 12:14:18 +090040}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070041
Alec Mouricdedc5d2021-03-01 22:39:55 -080042cc_library_headers {
43 name: "libgui_aidl_headers",
44 vendor_available: true,
45 static_libs: [
46 "libgui_aidl_static",
47 ],
48
49 export_static_lib_headers: [
50 "libgui_aidl_static",
51 ],
52}
53
chaviw3277faf2021-05-19 16:45:23 -050054// AIDL files that should be exposed to java
55filegroup {
56 name: "guiconstants_aidl",
57 srcs: [
Vishnu Nair4f2ea102021-09-02 09:52:48 -070058 "android/**/DropInputMode.aidl",
chaviw3277faf2021-05-19 16:45:23 -050059 "android/**/TouchOcclusionMode.aidl",
60 ],
61}
62
63cc_library_static {
64 name: "libgui_window_info_static",
65 vendor_available: true,
66 host_supported: true,
67 srcs: [
68 ":guiconstants_aidl",
69 "android/gui/FocusRequest.aidl",
70 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050071 "android/gui/IWindowInfosListener.aidl",
chaviwbf023a62021-06-07 16:00:06 -050072 "android/gui/IWindowInfosReportedListener.aidl",
chaviw3277faf2021-05-19 16:45:23 -050073 "android/gui/WindowInfo.aidl",
74 "WindowInfo.cpp",
75 ],
76
77 shared_libs: [
78 "libbinder",
79 ],
80
81 local_include_dirs: [
82 "include",
83 ],
84
85 export_shared_lib_headers: [
86 "libbinder",
87 ],
88
89 static_libs: [
90 "libui-types",
91 ],
92
93 aidl: {
Alixfcd57762022-04-25 20:14:50 +000094 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -050095 },
96
97 include_dirs: [
98 "frameworks/native/include",
99 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100100
101 target: {
102 darwin: {
103 enabled: false,
104 },
105 },
chaviw3277faf2021-05-19 16:45:23 -0500106}
107
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000108filegroup {
109 name: "libgui_aidl",
110 srcs: ["aidl/**/*.aidl"],
111 path: "aidl/",
112}
113
Alec Mouricdedc5d2021-03-01 22:39:55 -0800114cc_library_static {
115 name: "libgui_aidl_static",
116 vendor_available: true,
117 srcs: [
118 ":libgui_aidl",
119 ],
120
121 shared_libs: [
122 "libbinder",
123 "libui",
124 ],
125
126 local_include_dirs: [
127 "include",
128 ],
129
130 export_shared_lib_headers: [
131 "libbinder",
132 ],
133
chaviw3277faf2021-05-19 16:45:23 -0500134 static_libs: [
135 "libui-types",
136 ],
137
Alec Mouricdedc5d2021-03-01 22:39:55 -0800138 aidl: {
Yi Kong7cd72c52021-12-23 15:51:29 +0800139 export_aidl_headers: true,
140 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800141}
142
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700143cc_library_shared {
144 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900145 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900146 vndk: {
147 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900148 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900149 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900150 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700151
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700152 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700153
Alec Mouricdedc5d2021-03-01 22:39:55 -0800154 static_libs: [
155 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500156 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800157 ],
158 export_static_lib_headers: [
159 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500160 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800161 ],
162
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700163 srcs: [
Vinh Tran9ccb8dd2022-08-09 15:38:48 -0400164 ":framework_native_aidl_binder",
165 ":framework_native_aidl_gui",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000166 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700167 ":libgui_bufferqueue_sources",
168
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700169 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700170 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800171 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800172 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700173 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700174 "ConsumerBase.cpp",
175 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700176 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700177 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700178 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000179 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700180 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800181 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700182 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800183 "IGraphicBufferConsumer.cpp",
184 "IGraphicBufferProducer.cpp",
185 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800186 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700187 "ISurfaceComposer.cpp",
188 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700189 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800190 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800191 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700192 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800193 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700194 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800195 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700196 "Surface.cpp",
197 "SurfaceControl.cpp",
198 "SurfaceComposerClient.cpp",
199 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000200 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800201 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500202 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800203 "bufferqueue/1.0/B2HProducerListener.cpp",
204 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
205 "bufferqueue/2.0/B2HProducerListener.cpp",
206 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700207 ],
208
209 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800210 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700211 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700212 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800213 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700214 ],
215
Chong Zhang62493092020-01-15 16:04:47 -0800216 export_shared_lib_headers: [
217 "libbinder",
218 ],
219
Alec Mouricdedc5d2021-03-01 22:39:55 -0800220 export_header_lib_headers: [
221 "libgui_aidl_headers",
222 ],
223
Jiyong Parka75d3d62018-04-09 12:16:30 +0900224 // bufferhub is not used when building libgui for vendors
225 target: {
226 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800227 cflags: [
228 "-DNO_BUFFERHUB",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800229 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900230 exclude_srcs: [
231 "BufferHubConsumer.cpp",
232 "BufferHubProducer.cpp",
233 ],
234 exclude_shared_libs: [
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700235 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900236 "libbufferhubqueue",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800237 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900238 ],
239 },
240 },
241
Daichi Hironof474d3d2019-11-05 08:54:07 +0900242 aidl: {
243 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800244 },
245
Alec Mouricdedc5d2021-03-01 22:39:55 -0800246 header_libs: [
247 "libdvr_headers",
248 "libgui_aidl_headers",
249 "libpdx_headers",
250 ],
251
Yi Kong7cd72c52021-12-23 15:51:29 +0800252 afdo: true,
Yi Kongb1f2d202021-02-23 17:52:42 +0800253
254 lto: {
255 thin: true,
256 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700257}
258
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700259// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700260// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700261cc_library_static {
262 name: "libgui_bufferqueue_static",
263 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900264 apex_available: [
265 "//apex_available:platform",
266 "com.android.media.swcodec",
267 ],
268 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700269
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700270 cflags: [
271 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800272 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700273 ],
274
275 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700276
277 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000278 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700279 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800280 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700281 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700282}
283
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700284filegroup {
285 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700286 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700287 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700288 "BufferItem.cpp",
289 "BufferQueue.cpp",
290 "BufferQueueConsumer.cpp",
291 "BufferQueueCore.cpp",
292 "BufferQueueProducer.cpp",
293 "BufferQueueThreadState.cpp",
294 "BufferSlot.cpp",
295 "FrameTimestamps.cpp",
296 "GLConsumerUtils.cpp",
297 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700298 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700299 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700300 "bufferqueue/1.0/H2BProducerListener.cpp",
301 "bufferqueue/1.0/WProducerListener.cpp",
302 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700303 "bufferqueue/2.0/H2BProducerListener.cpp",
304 "bufferqueue/2.0/types.cpp",
305 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700306}
307
308// Common build config shared by libgui and libgui_bufferqueue_static.
309cc_defaults {
310 name: "libgui_bufferqueue-defaults",
311
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700312 cflags: [
313 "-Wall",
314 "-Werror",
315 ],
316
317 cppflags: [
318 "-Wextra",
319 "-DDEBUG_ONLY_CODE=0",
320 ],
321
322 product_variables: {
323 eng: {
324 cppflags: [
325 "-UDEBUG_ONLY_CODE",
326 "-DDEBUG_ONLY_CODE=1",
327 ],
328 },
329 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700330
David Stevens7347f0b2020-01-15 20:19:22 +0900331 whole_static_libs: [
332 "LibGuiProperties",
333 ],
334
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700335 shared_libs: [
336 "android.hardware.graphics.bufferqueue@1.0",
337 "android.hardware.graphics.bufferqueue@2.0",
338 "android.hardware.graphics.common@1.1",
339 "android.hardware.graphics.common@1.2",
340 "android.hidl.token@1.0-utils",
341 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700342 "libcutils",
343 "libEGL",
344 "libGLESv2",
345 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700346 "liblog",
347 "libnativewindow",
348 "libsync",
349 "libui",
350 "libutils",
351 "libvndksupport",
352 ],
353
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800354 static_libs: [
355 "libbinderthreadstateutils",
356 ],
357
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700358 header_libs: [
359 "libgui_headers",
360 "libnativebase_headers",
361 ],
362
Ady Abraham62f216c2020-10-13 19:07:23 -0700363 include_dirs: [
364 "frameworks/native/include",
365 ],
366
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700367 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700368 "libEGL",
369 "libnativewindow",
370 "libui",
371 "android.hardware.graphics.bufferqueue@1.0",
372 "android.hardware.graphics.bufferqueue@2.0",
373 "android.hardware.graphics.common@1.1",
374 "android.hardware.graphics.common@1.2",
375 "android.hidl.token@1.0-utils",
376 ],
377
378 export_header_lib_headers: [
379 "libgui_headers",
380 ],
381
382 export_include_dirs: [
383 "include",
384 ],
385}
386
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700387// GMocks for use by external code
388cc_library_static {
389 name: "libgui_mocks",
390 vendor_available: false,
391
392 defaults: ["libgui_bufferqueue-defaults"],
393 static_libs: [
394 "libgtest",
395 "libgmock",
396 ],
397
398 srcs: [
399 "mock/GraphicBufferConsumer.cpp",
400 "mock/GraphicBufferProducer.cpp",
401 ],
402}
403
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700404subdirs = ["tests"]