blob: 0fe6f24842ac24b27ac7324778aa15c04940ea3f [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",
Ray Essickeed53a02022-02-09 09:40:20 -080040 // TODO(b/218719284) can media use be constrained to libgui_bufferqueue_static?
41 apex_available: [
42 "//apex_available:platform",
43 "com.android.media.swcodec",
44 "test_com.android.media.swcodec",
45 ],
Jiyong Park172bd722017-06-21 12:14:18 +090046}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070047
Alec Mouricdedc5d2021-03-01 22:39:55 -080048cc_library_headers {
49 name: "libgui_aidl_headers",
50 vendor_available: true,
51 static_libs: [
52 "libgui_aidl_static",
53 ],
54
55 export_static_lib_headers: [
56 "libgui_aidl_static",
57 ],
58}
59
chaviw3277faf2021-05-19 16:45:23 -050060// AIDL files that should be exposed to java
61filegroup {
62 name: "guiconstants_aidl",
63 srcs: [
Vishnu Nair9cf4a4d2021-09-17 12:16:08 -070064 "android/gui/DropInputMode.aidl",
chaviw3277faf2021-05-19 16:45:23 -050065 "android/**/TouchOcclusionMode.aidl",
66 ],
67}
68
69cc_library_static {
70 name: "libgui_window_info_static",
71 vendor_available: true,
72 host_supported: true,
73 srcs: [
74 ":guiconstants_aidl",
Prabir Pradhande788502021-12-22 00:26:07 -080075 ":inputconstants_aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070076 "android/gui/DisplayInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050077 "android/gui/FocusRequest.aidl",
78 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050079 "android/gui/IWindowInfosListener.aidl",
chaviwbf023a62021-06-07 16:00:06 -050080 "android/gui/IWindowInfosReportedListener.aidl",
chaviw3277faf2021-05-19 16:45:23 -050081 "android/gui/WindowInfo.aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070082 "DisplayInfo.cpp",
chaviw3277faf2021-05-19 16:45:23 -050083 "WindowInfo.cpp",
84 ],
85
86 shared_libs: [
87 "libbinder",
88 ],
89
90 local_include_dirs: [
91 "include",
92 ],
93
94 export_shared_lib_headers: [
95 "libbinder",
96 ],
97
98 static_libs: [
99 "libui-types",
100 ],
101
102 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700103 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -0500104 },
105
106 include_dirs: [
107 "frameworks/native/include",
108 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100109
110 target: {
111 darwin: {
112 enabled: false,
113 },
114 },
chaviw3277faf2021-05-19 16:45:23 -0500115}
116
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000117filegroup {
118 name: "libgui_aidl",
119 srcs: ["aidl/**/*.aidl"],
120 path: "aidl/",
121}
122
Alec Mouricdedc5d2021-03-01 22:39:55 -0800123cc_library_static {
124 name: "libgui_aidl_static",
125 vendor_available: true,
126 srcs: [
127 ":libgui_aidl",
128 ],
129
130 shared_libs: [
131 "libbinder",
132 "libui",
133 ],
134
135 local_include_dirs: [
136 "include",
137 ],
138
139 export_shared_lib_headers: [
140 "libbinder",
141 ],
142
chaviw3277faf2021-05-19 16:45:23 -0500143 static_libs: [
144 "libui-types",
145 ],
146
Alec Mouricdedc5d2021-03-01 22:39:55 -0800147 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700148 export_aidl_headers: true,
149 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800150}
151
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700152cc_library_shared {
153 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900154 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900155 vndk: {
156 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900157 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900158 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900159 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700160
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700161 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700162
Alec Mouricdedc5d2021-03-01 22:39:55 -0800163 static_libs: [
164 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500165 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800166 ],
167 export_static_lib_headers: [
168 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500169 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800170 ],
171
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700172 srcs: [
Vinh Tran9ccb8dd2022-08-09 15:38:48 -0400173 ":framework_native_aidl_binder",
174 ":framework_native_aidl_gui",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000175 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700176 ":libgui_bufferqueue_sources",
177
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700178 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700179 "BLASTBufferQueue.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700180 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700181 "ConsumerBase.cpp",
182 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700183 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700184 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700185 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000186 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700187 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800188 "IConsumerListener.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800189 "IGraphicBufferConsumer.cpp",
190 "IGraphicBufferProducer.cpp",
191 "IProducerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700192 "ISurfaceComposer.cpp",
193 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700194 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800195 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800196 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700197 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800198 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700199 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800200 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700201 "Surface.cpp",
202 "SurfaceControl.cpp",
203 "SurfaceComposerClient.cpp",
204 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000205 "TransactionTracing.cpp",
Rachel Lee18c34372022-01-20 13:57:18 -0800206 "VsyncEventData.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800207 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500208 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800209 "bufferqueue/1.0/B2HProducerListener.cpp",
210 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
211 "bufferqueue/2.0/B2HProducerListener.cpp",
212 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700213 ],
214
215 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800216 "libbinder",
Liz Kammerc0353372023-05-03 17:59:47 -0400217 "libGLESv2",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700218 ],
219
Chong Zhang62493092020-01-15 16:04:47 -0800220 export_shared_lib_headers: [
221 "libbinder",
222 ],
223
Alec Mouricdedc5d2021-03-01 22:39:55 -0800224 export_header_lib_headers: [
225 "libgui_aidl_headers",
226 ],
227
Daichi Hironof474d3d2019-11-05 08:54:07 +0900228 aidl: {
229 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800230 },
231
Alec Mouricdedc5d2021-03-01 22:39:55 -0800232 header_libs: [
233 "libdvr_headers",
234 "libgui_aidl_headers",
235 "libpdx_headers",
236 ],
237
Yi Kong7cd72c52021-12-23 15:51:29 +0800238 afdo: true,
Yi Kongb1f2d202021-02-23 17:52:42 +0800239
240 lto: {
241 thin: true,
242 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700243}
244
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700245// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700246// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700247cc_library_static {
248 name: "libgui_bufferqueue_static",
249 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900250 apex_available: [
251 "//apex_available:platform",
252 "com.android.media.swcodec",
253 ],
254 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700255
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700256 cflags: [
Chong Zhang62493092020-01-15 16:04:47 -0800257 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700258 ],
259
260 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700261
262 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000263 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700264 ":libgui_bufferqueue_sources",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800265 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700266 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700267}
268
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700269filegroup {
270 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700271 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700272 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700273 "BufferItem.cpp",
274 "BufferQueue.cpp",
275 "BufferQueueConsumer.cpp",
276 "BufferQueueCore.cpp",
277 "BufferQueueProducer.cpp",
278 "BufferQueueThreadState.cpp",
279 "BufferSlot.cpp",
280 "FrameTimestamps.cpp",
281 "GLConsumerUtils.cpp",
282 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700283 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700284 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700285 "bufferqueue/1.0/H2BProducerListener.cpp",
286 "bufferqueue/1.0/WProducerListener.cpp",
287 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700288 "bufferqueue/2.0/H2BProducerListener.cpp",
289 "bufferqueue/2.0/types.cpp",
290 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700291}
292
293// Common build config shared by libgui and libgui_bufferqueue_static.
294cc_defaults {
295 name: "libgui_bufferqueue-defaults",
296
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700297 cflags: [
298 "-Wall",
299 "-Werror",
300 ],
301
302 cppflags: [
303 "-Wextra",
304 "-DDEBUG_ONLY_CODE=0",
305 ],
306
307 product_variables: {
308 eng: {
309 cppflags: [
310 "-UDEBUG_ONLY_CODE",
311 "-DDEBUG_ONLY_CODE=1",
312 ],
313 },
314 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700315
David Stevens7347f0b2020-01-15 20:19:22 +0900316 whole_static_libs: [
Trevor Radcliffee4d3b992022-07-21 17:03:34 +0000317 "libLibGuiProperties",
David Stevens7347f0b2020-01-15 20:19:22 +0900318 ],
319
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700320 shared_libs: [
321 "android.hardware.graphics.bufferqueue@1.0",
322 "android.hardware.graphics.bufferqueue@2.0",
323 "android.hardware.graphics.common@1.1",
324 "android.hardware.graphics.common@1.2",
Marc Kassis77b11c62022-11-08 16:19:33 +0100325 "android.hardware.graphics.common-V4-ndk",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700326 "android.hidl.token@1.0-utils",
327 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700328 "libcutils",
329 "libEGL",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700330 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700331 "liblog",
332 "libnativewindow",
333 "libsync",
334 "libui",
335 "libutils",
336 "libvndksupport",
337 ],
338
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800339 static_libs: [
340 "libbinderthreadstateutils",
341 ],
342
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700343 header_libs: [
344 "libgui_headers",
345 "libnativebase_headers",
346 ],
347
Ady Abraham62f216c2020-10-13 19:07:23 -0700348 include_dirs: [
349 "frameworks/native/include",
350 ],
351
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700352 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700353 "libEGL",
354 "libnativewindow",
355 "libui",
356 "android.hardware.graphics.bufferqueue@1.0",
357 "android.hardware.graphics.bufferqueue@2.0",
358 "android.hardware.graphics.common@1.1",
359 "android.hardware.graphics.common@1.2",
360 "android.hidl.token@1.0-utils",
361 ],
362
363 export_header_lib_headers: [
364 "libgui_headers",
365 ],
366
367 export_include_dirs: [
368 "include",
369 ],
370}
371
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700372// GMocks for use by external code
373cc_library_static {
374 name: "libgui_mocks",
375 vendor_available: false,
376
377 defaults: ["libgui_bufferqueue-defaults"],
378 static_libs: [
379 "libgtest",
380 "libgmock",
381 ],
382
383 srcs: [
384 "mock/GraphicBufferConsumer.cpp",
385 "mock/GraphicBufferProducer.cpp",
386 ],
387}
388
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700389subdirs = ["tests"]