blob: 8c250a4d0b51b1082d1881d8ca12f5205a705110 [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 Nair50c73552021-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: {
94 export_aidl_headers: true
95 },
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: {
139 export_aidl_headers: true
140 }
141}
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: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900164 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000165 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700166 ":libgui_bufferqueue_sources",
167
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700168 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700169 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800170 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800171 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700172 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700173 "ConsumerBase.cpp",
174 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700175 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700176 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700177 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000178 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700179 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800180 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700181 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800182 "IGraphicBufferConsumer.cpp",
183 "IGraphicBufferProducer.cpp",
184 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800185 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700186 "ISurfaceComposer.cpp",
187 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700188 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800189 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800190 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700191 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800192 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700193 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800194 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700195 "Surface.cpp",
196 "SurfaceControl.cpp",
197 "SurfaceComposerClient.cpp",
198 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000199 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800200 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500201 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800202 "bufferqueue/1.0/B2HProducerListener.cpp",
203 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
204 "bufferqueue/2.0/B2HProducerListener.cpp",
205 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700206 ],
207
208 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800209 "android.frameworks.bufferhub@1.0",
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: [
Fan Xu021776e2018-12-05 13:34:48 -0800235 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700236 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900237 "libbufferhubqueue",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800238 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900239 ],
240 },
241 },
242
Daichi Hironof474d3d2019-11-05 08:54:07 +0900243 aidl: {
244 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800245 },
246
Alec Mouricdedc5d2021-03-01 22:39:55 -0800247 header_libs: [
248 "libdvr_headers",
249 "libgui_aidl_headers",
250 "libpdx_headers",
251 ],
252
Yi Kongccc1c7c2021-02-22 17:44:17 +0800253 pgo: {
254 sampling: true,
255 profile_file: "libgui/libgui.profdata",
256 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800257
258 lto: {
259 thin: true,
260 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700261}
262
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700263// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700264// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700265cc_library_static {
266 name: "libgui_bufferqueue_static",
267 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900268 apex_available: [
269 "//apex_available:platform",
270 "com.android.media.swcodec",
271 ],
272 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700273
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700274 cflags: [
275 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800276 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700277 ],
278
279 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700280
281 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000282 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700283 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800284 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700285 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700286}
287
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700288filegroup {
289 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700290 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700291 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700292 "BufferItem.cpp",
293 "BufferQueue.cpp",
294 "BufferQueueConsumer.cpp",
295 "BufferQueueCore.cpp",
296 "BufferQueueProducer.cpp",
297 "BufferQueueThreadState.cpp",
298 "BufferSlot.cpp",
299 "FrameTimestamps.cpp",
300 "GLConsumerUtils.cpp",
301 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700302 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700303 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700304 "bufferqueue/1.0/H2BProducerListener.cpp",
305 "bufferqueue/1.0/WProducerListener.cpp",
306 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700307 "bufferqueue/2.0/H2BProducerListener.cpp",
308 "bufferqueue/2.0/types.cpp",
309 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700310}
311
312// Common build config shared by libgui and libgui_bufferqueue_static.
313cc_defaults {
314 name: "libgui_bufferqueue-defaults",
315
316 clang: true,
317 cflags: [
318 "-Wall",
319 "-Werror",
320 ],
321
322 cppflags: [
323 "-Wextra",
324 "-DDEBUG_ONLY_CODE=0",
325 ],
326
327 product_variables: {
328 eng: {
329 cppflags: [
330 "-UDEBUG_ONLY_CODE",
331 "-DDEBUG_ONLY_CODE=1",
332 ],
333 },
334 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700335
David Stevens7347f0b2020-01-15 20:19:22 +0900336 whole_static_libs: [
337 "LibGuiProperties",
338 ],
339
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700340 shared_libs: [
341 "android.hardware.graphics.bufferqueue@1.0",
342 "android.hardware.graphics.bufferqueue@2.0",
343 "android.hardware.graphics.common@1.1",
344 "android.hardware.graphics.common@1.2",
345 "android.hidl.token@1.0-utils",
346 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700347 "libcutils",
348 "libEGL",
349 "libGLESv2",
350 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700351 "liblog",
352 "libnativewindow",
353 "libsync",
354 "libui",
355 "libutils",
356 "libvndksupport",
357 ],
358
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800359 static_libs: [
360 "libbinderthreadstateutils",
361 ],
362
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700363 header_libs: [
364 "libgui_headers",
365 "libnativebase_headers",
366 ],
367
Ady Abraham62f216c2020-10-13 19:07:23 -0700368 include_dirs: [
369 "frameworks/native/include",
370 ],
371
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700372 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700373 "libEGL",
374 "libnativewindow",
375 "libui",
376 "android.hardware.graphics.bufferqueue@1.0",
377 "android.hardware.graphics.bufferqueue@2.0",
378 "android.hardware.graphics.common@1.1",
379 "android.hardware.graphics.common@1.2",
380 "android.hidl.token@1.0-utils",
381 ],
382
383 export_header_lib_headers: [
384 "libgui_headers",
385 ],
386
387 export_include_dirs: [
388 "include",
389 ],
390}
391
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700392// GMocks for use by external code
393cc_library_static {
394 name: "libgui_mocks",
395 vendor_available: false,
396
397 defaults: ["libgui_bufferqueue-defaults"],
398 static_libs: [
399 "libgtest",
400 "libgmock",
401 ],
402
403 srcs: [
404 "mock/GraphicBufferConsumer.cpp",
405 "mock/GraphicBufferProducer.cpp",
406 ],
407}
408
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700409subdirs = ["tests"]