blob: 4f57d576a4a694e1f082dd5a325e0038fb6e39ed [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: [
58 "android/**/TouchOcclusionMode.aidl",
59 ],
60}
61
62cc_library_static {
63 name: "libgui_window_info_static",
64 vendor_available: true,
65 host_supported: true,
66 srcs: [
67 ":guiconstants_aidl",
68 "android/gui/FocusRequest.aidl",
69 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050070 "android/gui/IWindowInfosListener.aidl",
chaviw3277faf2021-05-19 16:45:23 -050071 "android/gui/WindowInfo.aidl",
72 "WindowInfo.cpp",
73 ],
74
75 shared_libs: [
76 "libbinder",
77 ],
78
79 local_include_dirs: [
80 "include",
81 ],
82
83 export_shared_lib_headers: [
84 "libbinder",
85 ],
86
87 static_libs: [
88 "libui-types",
89 ],
90
91 aidl: {
92 export_aidl_headers: true
93 },
94
95 include_dirs: [
96 "frameworks/native/include",
97 ],
98}
99
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000100filegroup {
101 name: "libgui_aidl",
102 srcs: ["aidl/**/*.aidl"],
103 path: "aidl/",
104}
105
Alec Mouricdedc5d2021-03-01 22:39:55 -0800106cc_library_static {
107 name: "libgui_aidl_static",
108 vendor_available: true,
109 srcs: [
110 ":libgui_aidl",
111 ],
112
113 shared_libs: [
114 "libbinder",
115 "libui",
116 ],
117
118 local_include_dirs: [
119 "include",
120 ],
121
122 export_shared_lib_headers: [
123 "libbinder",
124 ],
125
chaviw3277faf2021-05-19 16:45:23 -0500126 static_libs: [
127 "libui-types",
128 ],
129
Alec Mouricdedc5d2021-03-01 22:39:55 -0800130 aidl: {
131 export_aidl_headers: true
132 }
133}
134
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700135cc_library_shared {
136 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900137 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900138 vndk: {
139 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900140 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900141 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900142 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700143
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700144 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700145
Alec Mouricdedc5d2021-03-01 22:39:55 -0800146 static_libs: [
147 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500148 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800149 ],
150 export_static_lib_headers: [
151 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500152 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800153 ],
154
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700155 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +0900156 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000157 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700158 ":libgui_bufferqueue_sources",
159
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700160 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700161 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -0800162 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800163 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700164 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700165 "ConsumerBase.cpp",
166 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700167 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700168 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700169 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000170 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700171 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800172 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700173 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800174 "IGraphicBufferConsumer.cpp",
175 "IGraphicBufferProducer.cpp",
176 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -0800177 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700178 "ISurfaceComposer.cpp",
179 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700180 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800181 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800182 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700183 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800184 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700185 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800186 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700187 "Surface.cpp",
188 "SurfaceControl.cpp",
189 "SurfaceComposerClient.cpp",
190 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000191 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800192 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500193 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800194 "bufferqueue/1.0/B2HProducerListener.cpp",
195 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
196 "bufferqueue/2.0/B2HProducerListener.cpp",
197 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700198 ],
199
200 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800201 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -0800202 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700203 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700204 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800205 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700206 ],
207
Chong Zhang62493092020-01-15 16:04:47 -0800208 export_shared_lib_headers: [
209 "libbinder",
210 ],
211
Alec Mouricdedc5d2021-03-01 22:39:55 -0800212 export_header_lib_headers: [
213 "libgui_aidl_headers",
214 ],
215
Jiyong Parka75d3d62018-04-09 12:16:30 +0900216 // bufferhub is not used when building libgui for vendors
217 target: {
218 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800219 cflags: [
220 "-DNO_BUFFERHUB",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800221 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900222 exclude_srcs: [
223 "BufferHubConsumer.cpp",
224 "BufferHubProducer.cpp",
225 ],
226 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800227 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700228 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900229 "libbufferhubqueue",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800230 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900231 ],
232 },
233 },
234
Daichi Hironof474d3d2019-11-05 08:54:07 +0900235 aidl: {
236 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800237 },
238
Alec Mouricdedc5d2021-03-01 22:39:55 -0800239 header_libs: [
240 "libdvr_headers",
241 "libgui_aidl_headers",
242 "libpdx_headers",
243 ],
244
Yi Kongccc1c7c2021-02-22 17:44:17 +0800245 pgo: {
246 sampling: true,
247 profile_file: "libgui/libgui.profdata",
248 },
Yi Kongb1f2d202021-02-23 17:52:42 +0800249
250 lto: {
251 thin: true,
252 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700253}
254
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700255// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700256// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700257cc_library_static {
258 name: "libgui_bufferqueue_static",
259 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900260 apex_available: [
261 "//apex_available:platform",
262 "com.android.media.swcodec",
263 ],
264 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700265
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700266 cflags: [
267 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800268 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700269 ],
270
271 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700272
273 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000274 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700275 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800276 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700277 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700278}
279
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700280filegroup {
281 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700282 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700283 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700284 "BufferItem.cpp",
285 "BufferQueue.cpp",
286 "BufferQueueConsumer.cpp",
287 "BufferQueueCore.cpp",
288 "BufferQueueProducer.cpp",
289 "BufferQueueThreadState.cpp",
290 "BufferSlot.cpp",
291 "FrameTimestamps.cpp",
292 "GLConsumerUtils.cpp",
293 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700294 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700295 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700296 "bufferqueue/1.0/H2BProducerListener.cpp",
297 "bufferqueue/1.0/WProducerListener.cpp",
298 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700299 "bufferqueue/2.0/H2BProducerListener.cpp",
300 "bufferqueue/2.0/types.cpp",
301 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700302}
303
304// Common build config shared by libgui and libgui_bufferqueue_static.
305cc_defaults {
306 name: "libgui_bufferqueue-defaults",
307
308 clang: true,
309 cflags: [
310 "-Wall",
311 "-Werror",
312 ],
313
314 cppflags: [
315 "-Wextra",
316 "-DDEBUG_ONLY_CODE=0",
317 ],
318
319 product_variables: {
320 eng: {
321 cppflags: [
322 "-UDEBUG_ONLY_CODE",
323 "-DDEBUG_ONLY_CODE=1",
324 ],
325 },
326 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700327
David Stevens7347f0b2020-01-15 20:19:22 +0900328 whole_static_libs: [
329 "LibGuiProperties",
330 ],
331
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700332 shared_libs: [
333 "android.hardware.graphics.bufferqueue@1.0",
334 "android.hardware.graphics.bufferqueue@2.0",
335 "android.hardware.graphics.common@1.1",
336 "android.hardware.graphics.common@1.2",
337 "android.hidl.token@1.0-utils",
338 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700339 "libcutils",
340 "libEGL",
341 "libGLESv2",
342 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700343 "liblog",
344 "libnativewindow",
345 "libsync",
346 "libui",
347 "libutils",
348 "libvndksupport",
349 ],
350
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800351 static_libs: [
352 "libbinderthreadstateutils",
353 ],
354
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700355 header_libs: [
356 "libgui_headers",
357 "libnativebase_headers",
358 ],
359
Ady Abraham62f216c2020-10-13 19:07:23 -0700360 include_dirs: [
361 "frameworks/native/include",
362 ],
363
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700364 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700365 "libEGL",
366 "libnativewindow",
367 "libui",
368 "android.hardware.graphics.bufferqueue@1.0",
369 "android.hardware.graphics.bufferqueue@2.0",
370 "android.hardware.graphics.common@1.1",
371 "android.hardware.graphics.common@1.2",
372 "android.hidl.token@1.0-utils",
373 ],
374
375 export_header_lib_headers: [
376 "libgui_headers",
377 ],
378
379 export_include_dirs: [
380 "include",
381 ],
382}
383
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700384// GMocks for use by external code
385cc_library_static {
386 name: "libgui_mocks",
387 vendor_available: false,
388
389 defaults: ["libgui_bufferqueue-defaults"],
390 static_libs: [
391 "libgtest",
392 "libgmock",
393 ],
394
395 srcs: [
396 "mock/GraphicBufferConsumer.cpp",
397 "mock/GraphicBufferProducer.cpp",
398 ],
399}
400
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700401subdirs = ["tests"]