blob: c84ee1f9daa0adea1d69cfe8aed7754ff57139f7 [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
Ady Abraham107788e2023-10-17 12:31:08 -070023aconfig_declarations {
24 name: "libgui_flags",
25 package: "com.android.graphics.libgui.flags",
26 srcs: ["libgui_flags.aconfig"],
27}
28
29cc_aconfig_library {
30 name: "libguiflags",
31 host_supported: true,
32 vendor_available: true,
33 min_sdk_version: "29",
34 apex_available: [
35 "//apex_available:platform",
36 "com.android.media.swcodec",
37 "test_com.android.media.swcodec",
38 ],
39 aconfig_declarations: "libgui_flags",
40}
41
Jiyong Park172bd722017-06-21 12:14:18 +090042cc_library_headers {
43 name: "libgui_headers",
44 vendor_available: true,
45 export_include_dirs: ["include"],
Lajos Molnar7aa71e72019-04-01 15:34:32 -070046
47 // we must build this module to get the required header as that is generated
Marco Nelissencb04dee2019-10-28 12:55:47 -070048 export_shared_lib_headers: [
49 "android.hidl.token@1.0-utils",
50 "android.hardware.graphics.bufferqueue@1.0",
51 "android.hardware.graphics.bufferqueue@2.0",
52 ],
53 shared_libs: [
54 "android.hidl.token@1.0-utils",
55 "android.hardware.graphics.bufferqueue@1.0",
56 "android.hardware.graphics.bufferqueue@2.0",
57 ],
Ady Abraham107788e2023-10-17 12:31:08 -070058 static_libs: ["libguiflags"],
59 export_static_lib_headers: ["libguiflags"],
Jooyung Han7bcb8932020-04-16 18:48:32 +090060 min_sdk_version: "29",
Ray Essickeed53a02022-02-09 09:40:20 -080061 // TODO(b/218719284) can media use be constrained to libgui_bufferqueue_static?
62 apex_available: [
63 "//apex_available:platform",
64 "com.android.media.swcodec",
65 "test_com.android.media.swcodec",
66 ],
Jiyong Park172bd722017-06-21 12:14:18 +090067}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070068
Alec Mouricdedc5d2021-03-01 22:39:55 -080069cc_library_headers {
70 name: "libgui_aidl_headers",
71 vendor_available: true,
72 static_libs: [
73 "libgui_aidl_static",
74 ],
75
76 export_static_lib_headers: [
77 "libgui_aidl_static",
78 ],
79}
80
chaviw3277faf2021-05-19 16:45:23 -050081// AIDL files that should be exposed to java
82filegroup {
83 name: "guiconstants_aidl",
84 srcs: [
Vishnu Nair9cf4a4d2021-09-17 12:16:08 -070085 "android/gui/DropInputMode.aidl",
Patrick Williams090ad062023-08-08 12:30:10 -050086 "android/gui/StalledTransactionInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050087 "android/**/TouchOcclusionMode.aidl",
88 ],
89}
90
Vinh Tran6bd75632023-04-14 18:55:25 -040091filegroup {
92 name: "android_gui_aidl",
93 srcs: [
94 "android/gui/DisplayInfo.aidl",
95 "android/gui/FocusRequest.aidl",
96 "android/gui/InputApplicationInfo.aidl",
97 "android/gui/IWindowInfosListener.aidl",
Patrick Williamsacd22582023-07-12 13:47:28 -050098 "android/gui/IWindowInfosPublisher.aidl",
Vinh Tran6bd75632023-04-14 18:55:25 -040099 "android/gui/IWindowInfosReportedListener.aidl",
100 "android/gui/WindowInfo.aidl",
Patrick Williamsd828f302023-04-28 17:52:08 -0500101 "android/gui/WindowInfosUpdate.aidl",
Vinh Tran6bd75632023-04-14 18:55:25 -0400102 ],
103}
104
chaviw3277faf2021-05-19 16:45:23 -0500105cc_library_static {
106 name: "libgui_window_info_static",
107 vendor_available: true,
108 host_supported: true,
109 srcs: [
110 ":guiconstants_aidl",
Prabir Pradhande788502021-12-22 00:26:07 -0800111 ":inputconstants_aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700112 "android/gui/DisplayInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -0500113 "android/gui/FocusRequest.aidl",
114 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -0500115 "android/gui/IWindowInfosListener.aidl",
Patrick Williamsacd22582023-07-12 13:47:28 -0500116 "android/gui/IWindowInfosPublisher.aidl",
chaviwbf023a62021-06-07 16:00:06 -0500117 "android/gui/IWindowInfosReportedListener.aidl",
Patrick Williamsd828f302023-04-28 17:52:08 -0500118 "android/gui/WindowInfosUpdate.aidl",
chaviw3277faf2021-05-19 16:45:23 -0500119 "android/gui/WindowInfo.aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700120 "DisplayInfo.cpp",
chaviw3277faf2021-05-19 16:45:23 -0500121 "WindowInfo.cpp",
Patrick Williamsd828f302023-04-28 17:52:08 -0500122 "WindowInfosUpdate.cpp",
chaviw3277faf2021-05-19 16:45:23 -0500123 ],
124
125 shared_libs: [
126 "libbinder",
127 ],
128
129 local_include_dirs: [
130 "include",
131 ],
132
133 export_shared_lib_headers: [
134 "libbinder",
135 ],
136
137 static_libs: [
138 "libui-types",
139 ],
140
141 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700142 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -0500143 },
144
145 include_dirs: [
146 "frameworks/native/include",
147 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100148
149 target: {
150 darwin: {
151 enabled: false,
152 },
153 },
chaviw3277faf2021-05-19 16:45:23 -0500154}
155
Vinh Trancbbf3302023-05-25 09:19:56 -0400156aidl_library {
157 name: "libgui_aidl_hdrs",
158 hdrs: [
159 "android/gui/DisplayInfo.aidl",
160 "android/gui/FocusRequest.aidl",
161 "android/gui/InputApplicationInfo.aidl",
162 "android/gui/IWindowInfosListener.aidl",
Patrick Williamsacd22582023-07-12 13:47:28 -0500163 "android/gui/IWindowInfosPublisher.aidl",
Vinh Trancbbf3302023-05-25 09:19:56 -0400164 "android/gui/IWindowInfosReportedListener.aidl",
Patrick Williams090ad062023-08-08 12:30:10 -0500165 "android/gui/StalledTransactionInfo.aidl",
Vinh Trancbbf3302023-05-25 09:19:56 -0400166 "android/gui/WindowInfo.aidl",
167 "android/gui/WindowInfosUpdate.aidl",
168 ],
169}
170
171aidl_library {
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000172 name: "libgui_aidl",
173 srcs: ["aidl/**/*.aidl"],
Vinh Trancbbf3302023-05-25 09:19:56 -0400174 strip_import_prefix: "aidl",
175 deps: ["libgui_aidl_hdrs"],
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000176}
177
Huihong Luo0a81aa32022-02-22 16:02:36 -0800178filegroup {
179 name: "libgui_frame_event_aidl",
180 srcs: ["aidl/android/gui/FrameEvent.aidl"],
181 path: "aidl/",
182}
183
Alec Mouricdedc5d2021-03-01 22:39:55 -0800184cc_library_static {
185 name: "libgui_aidl_static",
186 vendor_available: true,
Alec Mouricdedc5d2021-03-01 22:39:55 -0800187
188 shared_libs: [
189 "libbinder",
190 "libui",
191 ],
192
193 local_include_dirs: [
194 "include",
195 ],
196
Huihong Luo02186fb2022-02-23 14:21:54 -0800197 include_dirs: [
198 "frameworks/native/include",
199 ],
200
Alec Mouricdedc5d2021-03-01 22:39:55 -0800201 export_shared_lib_headers: [
202 "libbinder",
203 ],
204
chaviw3277faf2021-05-19 16:45:23 -0500205 static_libs: [
206 "libui-types",
Huihong Luo02186fb2022-02-23 14:21:54 -0800207 "libgui_window_info_static",
chaviw3277faf2021-05-19 16:45:23 -0500208 ],
209
Alec Mouricdedc5d2021-03-01 22:39:55 -0800210 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700211 export_aidl_headers: true,
Vinh Trancbbf3302023-05-25 09:19:56 -0400212 libs: ["libgui_aidl"],
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700213 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800214}
215
Ady Abraham6cdd3fd2023-09-07 18:45:58 -0700216filegroup {
217 name: "libgui-sources",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700218 srcs: [
Vinh Tran9ccb8dd2022-08-09 15:38:48 -0400219 ":framework_native_aidl_binder",
220 ":framework_native_aidl_gui",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000221 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700222 ":libgui_bufferqueue_sources",
223
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700224 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700225 "BLASTBufferQueue.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700226 "BufferItemConsumer.cpp",
Rachel Lee273c18c2022-12-13 14:35:07 -0800227 "Choreographer.cpp",
Dominik Laskowski5a5e01e2022-07-08 07:52:44 -0700228 "CompositorTiming.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700229 "ConsumerBase.cpp",
230 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700231 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700232 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700233 "DisplayEventReceiver.cpp",
Alec Mouri0e7d8fd2023-05-03 23:58:43 +0000234 "FenceMonitor.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700235 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800236 "IConsumerListener.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800237 "IGraphicBufferConsumer.cpp",
238 "IGraphicBufferProducer.cpp",
239 "IProducerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700240 "ISurfaceComposer.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700241 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800242 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800243 "LayerMetadata.cpp",
Chavi Weingartenc78f53c2023-04-14 18:50:53 +0000244 "LayerStatePermissions.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700245 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800246 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700247 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800248 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700249 "Surface.cpp",
250 "SurfaceControl.cpp",
251 "SurfaceComposerClient.cpp",
252 "SyncFeatures.cpp",
Rachel Lee18c34372022-01-20 13:57:18 -0800253 "VsyncEventData.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800254 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500255 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800256 "bufferqueue/1.0/B2HProducerListener.cpp",
257 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
258 "bufferqueue/2.0/B2HProducerListener.cpp",
259 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700260 ],
Ady Abraham6cdd3fd2023-09-07 18:45:58 -0700261}
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700262
Ady Abraham6cdd3fd2023-09-07 18:45:58 -0700263cc_defaults {
264 name: "libgui-defaults",
265 defaults: ["libgui_bufferqueue-defaults"],
266 srcs: [":libgui-sources"],
267 static_libs: [
268 "libgui_aidl_static",
269 "libgui_window_info_static",
270 "libguiflags",
271 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700272 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800273 "libbinder",
Liz Kammer7994df22023-05-04 12:25:58 +0000274 "libGLESv2",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700275 ],
Ady Abraham107788e2023-10-17 12:31:08 -0700276 export_static_lib_headers: [
277 "libguiflags",
278 ],
Ady Abraham6cdd3fd2023-09-07 18:45:58 -0700279}
280
281cc_library_shared {
282 name: "libgui",
283 vendor_available: true,
284 vndk: {
285 enabled: true,
286 private: true,
287 },
288 double_loadable: true,
289
290 defaults: [
291 "libgui-defaults",
292 ],
293
294 export_static_lib_headers: [
295 "libgui_aidl_static",
296 "libgui_window_info_static",
297 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700298
Chong Zhang62493092020-01-15 16:04:47 -0800299 export_shared_lib_headers: [
300 "libbinder",
301 ],
302
Alec Mouricdedc5d2021-03-01 22:39:55 -0800303 export_header_lib_headers: [
304 "libgui_aidl_headers",
Rachel Lee273c18c2022-12-13 14:35:07 -0800305 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800306 ],
307
Daichi Hironof474d3d2019-11-05 08:54:07 +0900308 aidl: {
309 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800310 },
311
Alec Mouricdedc5d2021-03-01 22:39:55 -0800312 header_libs: [
Rachel Lee273c18c2022-12-13 14:35:07 -0800313 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800314 "libdvr_headers",
315 "libgui_aidl_headers",
316 "libpdx_headers",
317 ],
318
Yi Kong7cd72c52021-12-23 15:51:29 +0800319 afdo: true,
Yi Kongb1f2d202021-02-23 17:52:42 +0800320
321 lto: {
322 thin: true,
323 },
Chavi Weingartene0237bb2023-02-06 21:48:32 +0000324
325 cflags: [
326 "-Wthread-safety",
327 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700328}
329
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700330// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700331// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700332cc_library_static {
333 name: "libgui_bufferqueue_static",
334 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900335 apex_available: [
336 "//apex_available:platform",
337 "com.android.media.swcodec",
338 ],
339 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700340
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700341 cflags: [
Chong Zhang62493092020-01-15 16:04:47 -0800342 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700343 ],
344
345 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700346
347 srcs: [
Huihong Luo02186fb2022-02-23 14:21:54 -0800348 ":libgui_frame_event_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000349 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700350 ":libgui_bufferqueue_sources",
351 ],
Huihong Luo02186fb2022-02-23 14:21:54 -0800352
353 aidl: {
354 include_dirs: [
355 "frameworks/native/libs/gui",
356 ],
357 },
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700358}
359
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700360filegroup {
361 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700362 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700363 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700364 "BufferItem.cpp",
365 "BufferQueue.cpp",
366 "BufferQueueConsumer.cpp",
367 "BufferQueueCore.cpp",
368 "BufferQueueProducer.cpp",
369 "BufferQueueThreadState.cpp",
370 "BufferSlot.cpp",
Ady Abraham6cdd3fd2023-09-07 18:45:58 -0700371 "FrameRateUtils.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700372 "FrameTimestamps.cpp",
373 "GLConsumerUtils.cpp",
374 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700375 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700376 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700377 "bufferqueue/1.0/H2BProducerListener.cpp",
378 "bufferqueue/1.0/WProducerListener.cpp",
379 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700380 "bufferqueue/2.0/H2BProducerListener.cpp",
381 "bufferqueue/2.0/types.cpp",
382 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700383}
384
385// Common build config shared by libgui and libgui_bufferqueue_static.
386cc_defaults {
387 name: "libgui_bufferqueue-defaults",
388
Sally Qi6920a2f2022-08-26 10:40:05 -0700389 defaults: ["android.hardware.graphics.common-ndk_shared"],
390
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700391 cflags: [
392 "-Wall",
393 "-Werror",
394 ],
395
396 cppflags: [
397 "-Wextra",
398 "-DDEBUG_ONLY_CODE=0",
399 ],
400
401 product_variables: {
402 eng: {
403 cppflags: [
404 "-UDEBUG_ONLY_CODE",
405 "-DDEBUG_ONLY_CODE=1",
406 ],
407 },
408 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700409
David Stevens7347f0b2020-01-15 20:19:22 +0900410 whole_static_libs: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000411 "libLibGuiProperties",
David Stevens7347f0b2020-01-15 20:19:22 +0900412 ],
413
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700414 shared_libs: [
415 "android.hardware.graphics.bufferqueue@1.0",
416 "android.hardware.graphics.bufferqueue@2.0",
417 "android.hardware.graphics.common@1.1",
418 "android.hardware.graphics.common@1.2",
419 "android.hidl.token@1.0-utils",
420 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700421 "libcutils",
422 "libEGL",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700423 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700424 "liblog",
425 "libnativewindow",
426 "libsync",
427 "libui",
428 "libutils",
429 "libvndksupport",
430 ],
431
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800432 static_libs: [
433 "libbinderthreadstateutils",
434 ],
435
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700436 header_libs: [
437 "libgui_headers",
438 "libnativebase_headers",
439 ],
440
Ady Abraham62f216c2020-10-13 19:07:23 -0700441 include_dirs: [
442 "frameworks/native/include",
443 ],
444
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700445 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700446 "libEGL",
447 "libnativewindow",
448 "libui",
449 "android.hardware.graphics.bufferqueue@1.0",
450 "android.hardware.graphics.bufferqueue@2.0",
451 "android.hardware.graphics.common@1.1",
452 "android.hardware.graphics.common@1.2",
453 "android.hidl.token@1.0-utils",
454 ],
455
456 export_header_lib_headers: [
457 "libgui_headers",
458 ],
459
460 export_include_dirs: [
461 "include",
462 ],
463}
464
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700465// GMocks for use by external code
466cc_library_static {
467 name: "libgui_mocks",
468 vendor_available: false,
469
470 defaults: ["libgui_bufferqueue-defaults"],
471 static_libs: [
472 "libgtest",
473 "libgmock",
Ady Abraham107788e2023-10-17 12:31:08 -0700474 "libguiflags",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700475 ],
476
477 srcs: [
Huihong Luo0a81aa32022-02-22 16:02:36 -0800478 ":libgui_frame_event_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700479 "mock/GraphicBufferConsumer.cpp",
480 "mock/GraphicBufferProducer.cpp",
481 ],
482}
483
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700484subdirs = ["tests"]