blob: 21900a073a034c50424f4bc388e1ff6470da81ed [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
Huihong Luo0a81aa32022-02-22 16:02:36 -0800123filegroup {
124 name: "libgui_frame_event_aidl",
125 srcs: ["aidl/android/gui/FrameEvent.aidl"],
126 path: "aidl/",
127}
128
Alec Mouricdedc5d2021-03-01 22:39:55 -0800129cc_library_static {
130 name: "libgui_aidl_static",
131 vendor_available: true,
132 srcs: [
133 ":libgui_aidl",
134 ],
135
136 shared_libs: [
137 "libbinder",
138 "libui",
139 ],
140
141 local_include_dirs: [
142 "include",
143 ],
144
Huihong Luo02186fb2022-02-23 14:21:54 -0800145 include_dirs: [
146 "frameworks/native/include",
147 ],
148
Alec Mouricdedc5d2021-03-01 22:39:55 -0800149 export_shared_lib_headers: [
150 "libbinder",
151 ],
152
chaviw3277faf2021-05-19 16:45:23 -0500153 static_libs: [
154 "libui-types",
Huihong Luo02186fb2022-02-23 14:21:54 -0800155 "libgui_window_info_static",
chaviw3277faf2021-05-19 16:45:23 -0500156 ],
157
Alec Mouricdedc5d2021-03-01 22:39:55 -0800158 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700159 export_aidl_headers: true,
Huihong Luo02186fb2022-02-23 14:21:54 -0800160 include_dirs: [
161 "frameworks/native/libs/gui",
162 ],
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700163 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800164}
165
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700166cc_library_shared {
167 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900168 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900169 vndk: {
170 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900171 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900172 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900173 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700174
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700175 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700176
Alec Mouricdedc5d2021-03-01 22:39:55 -0800177 static_libs: [
178 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500179 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800180 ],
181 export_static_lib_headers: [
182 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500183 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800184 ],
185
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700186 srcs: [
Vinh Tran9ccb8dd2022-08-09 15:38:48 -0400187 ":framework_native_aidl_binder",
188 ":framework_native_aidl_gui",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000189 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700190 ":libgui_bufferqueue_sources",
191
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700192 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700193 "BLASTBufferQueue.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700194 "BufferItemConsumer.cpp",
Rachel Lee273c18c2022-12-13 14:35:07 -0800195 "Choreographer.cpp",
Dominik Laskowski5a5e01e2022-07-08 07:52:44 -0700196 "CompositorTiming.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700197 "ConsumerBase.cpp",
198 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700199 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700200 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700201 "DisplayEventReceiver.cpp",
202 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800203 "IConsumerListener.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800204 "IGraphicBufferConsumer.cpp",
205 "IGraphicBufferProducer.cpp",
206 "IProducerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700207 "ISurfaceComposer.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700208 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800209 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800210 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700211 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800212 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700213 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800214 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700215 "Surface.cpp",
216 "SurfaceControl.cpp",
217 "SurfaceComposerClient.cpp",
218 "SyncFeatures.cpp",
Rachel Lee18c34372022-01-20 13:57:18 -0800219 "VsyncEventData.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800220 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500221 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800222 "bufferqueue/1.0/B2HProducerListener.cpp",
223 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
224 "bufferqueue/2.0/B2HProducerListener.cpp",
225 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700226 ],
227
228 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800229 "libbinder",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700230 ],
231
Chong Zhang62493092020-01-15 16:04:47 -0800232 export_shared_lib_headers: [
233 "libbinder",
234 ],
235
Alec Mouricdedc5d2021-03-01 22:39:55 -0800236 export_header_lib_headers: [
237 "libgui_aidl_headers",
Rachel Lee273c18c2022-12-13 14:35:07 -0800238 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800239 ],
240
Daichi Hironof474d3d2019-11-05 08:54:07 +0900241 aidl: {
242 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800243 },
244
Alec Mouricdedc5d2021-03-01 22:39:55 -0800245 header_libs: [
Rachel Lee273c18c2022-12-13 14:35:07 -0800246 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800247 "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 },
Chavi Weingartene0237bb2023-02-06 21:48:32 +0000257
258 cflags: [
259 "-Wthread-safety",
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: [
Chong Zhang62493092020-01-15 16:04:47 -0800275 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700276 ],
277
278 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700279
280 srcs: [
Huihong Luo02186fb2022-02-23 14:21:54 -0800281 ":libgui_frame_event_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000282 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700283 ":libgui_bufferqueue_sources",
284 ],
Huihong Luo02186fb2022-02-23 14:21:54 -0800285
286 aidl: {
287 include_dirs: [
288 "frameworks/native/libs/gui",
289 ],
290 },
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700291}
292
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700293filegroup {
294 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700295 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700296 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700297 "BufferItem.cpp",
298 "BufferQueue.cpp",
299 "BufferQueueConsumer.cpp",
300 "BufferQueueCore.cpp",
301 "BufferQueueProducer.cpp",
302 "BufferQueueThreadState.cpp",
303 "BufferSlot.cpp",
304 "FrameTimestamps.cpp",
305 "GLConsumerUtils.cpp",
306 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700307 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700308 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700309 "bufferqueue/1.0/H2BProducerListener.cpp",
310 "bufferqueue/1.0/WProducerListener.cpp",
311 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700312 "bufferqueue/2.0/H2BProducerListener.cpp",
313 "bufferqueue/2.0/types.cpp",
314 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700315}
316
317// Common build config shared by libgui and libgui_bufferqueue_static.
318cc_defaults {
319 name: "libgui_bufferqueue-defaults",
320
Sally Qi6920a2f2022-08-26 10:40:05 -0700321 defaults: ["android.hardware.graphics.common-ndk_shared"],
322
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700323 cflags: [
324 "-Wall",
325 "-Werror",
326 ],
327
328 cppflags: [
329 "-Wextra",
330 "-DDEBUG_ONLY_CODE=0",
331 ],
332
333 product_variables: {
334 eng: {
335 cppflags: [
336 "-UDEBUG_ONLY_CODE",
337 "-DDEBUG_ONLY_CODE=1",
338 ],
339 },
340 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700341
David Stevens7347f0b2020-01-15 20:19:22 +0900342 whole_static_libs: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000343 "libLibGuiProperties",
David Stevens7347f0b2020-01-15 20:19:22 +0900344 ],
345
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700346 shared_libs: [
347 "android.hardware.graphics.bufferqueue@1.0",
348 "android.hardware.graphics.bufferqueue@2.0",
349 "android.hardware.graphics.common@1.1",
350 "android.hardware.graphics.common@1.2",
351 "android.hidl.token@1.0-utils",
352 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700353 "libcutils",
354 "libEGL",
355 "libGLESv2",
356 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700357 "liblog",
358 "libnativewindow",
359 "libsync",
360 "libui",
361 "libutils",
362 "libvndksupport",
363 ],
364
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800365 static_libs: [
366 "libbinderthreadstateutils",
367 ],
368
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700369 header_libs: [
370 "libgui_headers",
371 "libnativebase_headers",
372 ],
373
Ady Abraham62f216c2020-10-13 19:07:23 -0700374 include_dirs: [
375 "frameworks/native/include",
376 ],
377
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700378 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700379 "libEGL",
380 "libnativewindow",
381 "libui",
382 "android.hardware.graphics.bufferqueue@1.0",
383 "android.hardware.graphics.bufferqueue@2.0",
384 "android.hardware.graphics.common@1.1",
385 "android.hardware.graphics.common@1.2",
386 "android.hidl.token@1.0-utils",
387 ],
388
389 export_header_lib_headers: [
390 "libgui_headers",
391 ],
392
393 export_include_dirs: [
394 "include",
395 ],
396}
397
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700398// GMocks for use by external code
399cc_library_static {
400 name: "libgui_mocks",
401 vendor_available: false,
402
403 defaults: ["libgui_bufferqueue-defaults"],
404 static_libs: [
405 "libgtest",
406 "libgmock",
407 ],
408
409 srcs: [
Huihong Luo0a81aa32022-02-22 16:02:36 -0800410 ":libgui_frame_event_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700411 "mock/GraphicBufferConsumer.cpp",
412 "mock/GraphicBufferProducer.cpp",
413 ],
414}
415
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700416subdirs = ["tests"]