blob: 2ea4d162602627c0db014f081053a6b9f2835cf0 [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",
Patrick Williams090ad062023-08-08 12:30:10 -050065 "android/gui/StalledTransactionInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050066 "android/**/TouchOcclusionMode.aidl",
67 ],
68}
69
Vinh Tran6bd75632023-04-14 18:55:25 -040070filegroup {
71 name: "android_gui_aidl",
72 srcs: [
73 "android/gui/DisplayInfo.aidl",
74 "android/gui/FocusRequest.aidl",
75 "android/gui/InputApplicationInfo.aidl",
76 "android/gui/IWindowInfosListener.aidl",
Patrick Williamsacd22582023-07-12 13:47:28 -050077 "android/gui/IWindowInfosPublisher.aidl",
Vinh Tran6bd75632023-04-14 18:55:25 -040078 "android/gui/IWindowInfosReportedListener.aidl",
79 "android/gui/WindowInfo.aidl",
Patrick Williamsd828f302023-04-28 17:52:08 -050080 "android/gui/WindowInfosUpdate.aidl",
Vinh Tran6bd75632023-04-14 18:55:25 -040081 ],
82}
83
chaviw3277faf2021-05-19 16:45:23 -050084cc_library_static {
85 name: "libgui_window_info_static",
86 vendor_available: true,
87 host_supported: true,
88 srcs: [
89 ":guiconstants_aidl",
Prabir Pradhande788502021-12-22 00:26:07 -080090 ":inputconstants_aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070091 "android/gui/DisplayInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050092 "android/gui/FocusRequest.aidl",
93 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050094 "android/gui/IWindowInfosListener.aidl",
Patrick Williamsacd22582023-07-12 13:47:28 -050095 "android/gui/IWindowInfosPublisher.aidl",
chaviwbf023a62021-06-07 16:00:06 -050096 "android/gui/IWindowInfosReportedListener.aidl",
Patrick Williamsd828f302023-04-28 17:52:08 -050097 "android/gui/WindowInfosUpdate.aidl",
chaviw3277faf2021-05-19 16:45:23 -050098 "android/gui/WindowInfo.aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070099 "DisplayInfo.cpp",
chaviw3277faf2021-05-19 16:45:23 -0500100 "WindowInfo.cpp",
Patrick Williamsd828f302023-04-28 17:52:08 -0500101 "WindowInfosUpdate.cpp",
chaviw3277faf2021-05-19 16:45:23 -0500102 ],
103
104 shared_libs: [
105 "libbinder",
106 ],
107
108 local_include_dirs: [
109 "include",
110 ],
111
112 export_shared_lib_headers: [
113 "libbinder",
114 ],
115
116 static_libs: [
117 "libui-types",
118 ],
119
120 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700121 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -0500122 },
123
124 include_dirs: [
125 "frameworks/native/include",
126 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100127
128 target: {
129 darwin: {
130 enabled: false,
131 },
132 },
chaviw3277faf2021-05-19 16:45:23 -0500133}
134
Vinh Trancbbf3302023-05-25 09:19:56 -0400135aidl_library {
136 name: "libgui_aidl_hdrs",
137 hdrs: [
138 "android/gui/DisplayInfo.aidl",
139 "android/gui/FocusRequest.aidl",
140 "android/gui/InputApplicationInfo.aidl",
141 "android/gui/IWindowInfosListener.aidl",
Patrick Williamsacd22582023-07-12 13:47:28 -0500142 "android/gui/IWindowInfosPublisher.aidl",
Vinh Trancbbf3302023-05-25 09:19:56 -0400143 "android/gui/IWindowInfosReportedListener.aidl",
Patrick Williams090ad062023-08-08 12:30:10 -0500144 "android/gui/StalledTransactionInfo.aidl",
Vinh Trancbbf3302023-05-25 09:19:56 -0400145 "android/gui/WindowInfo.aidl",
146 "android/gui/WindowInfosUpdate.aidl",
147 ],
148}
149
150aidl_library {
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000151 name: "libgui_aidl",
152 srcs: ["aidl/**/*.aidl"],
Vinh Trancbbf3302023-05-25 09:19:56 -0400153 strip_import_prefix: "aidl",
154 deps: ["libgui_aidl_hdrs"],
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000155}
156
Huihong Luo0a81aa32022-02-22 16:02:36 -0800157filegroup {
158 name: "libgui_frame_event_aidl",
159 srcs: ["aidl/android/gui/FrameEvent.aidl"],
160 path: "aidl/",
161}
162
Alec Mouricdedc5d2021-03-01 22:39:55 -0800163cc_library_static {
164 name: "libgui_aidl_static",
165 vendor_available: true,
Alec Mouricdedc5d2021-03-01 22:39:55 -0800166
167 shared_libs: [
168 "libbinder",
169 "libui",
170 ],
171
172 local_include_dirs: [
173 "include",
174 ],
175
Huihong Luo02186fb2022-02-23 14:21:54 -0800176 include_dirs: [
177 "frameworks/native/include",
178 ],
179
Alec Mouricdedc5d2021-03-01 22:39:55 -0800180 export_shared_lib_headers: [
181 "libbinder",
182 ],
183
chaviw3277faf2021-05-19 16:45:23 -0500184 static_libs: [
185 "libui-types",
Huihong Luo02186fb2022-02-23 14:21:54 -0800186 "libgui_window_info_static",
chaviw3277faf2021-05-19 16:45:23 -0500187 ],
188
Alec Mouricdedc5d2021-03-01 22:39:55 -0800189 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700190 export_aidl_headers: true,
Vinh Trancbbf3302023-05-25 09:19:56 -0400191 libs: ["libgui_aidl"],
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700192 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800193}
194
Ady Abraham91e1a572023-09-07 13:34:46 -0700195aconfig_declarations {
196 name: "libgui_flags",
197 package: "com.android.graphics.libgui.flags",
198 srcs: ["libgui_flags.aconfig"],
199}
200
201cc_aconfig_library {
202 name: "libguiflags",
203 vendor_available: true,
204 aconfig_declarations: "libgui_flags",
205}
206
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700207cc_library_shared {
208 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900209 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900210 vndk: {
211 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900212 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900213 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900214 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700215
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700216 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700217
Alec Mouricdedc5d2021-03-01 22:39:55 -0800218 static_libs: [
219 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500220 "libgui_window_info_static",
Ady Abraham91e1a572023-09-07 13:34:46 -0700221 "libguiflags",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800222 ],
223 export_static_lib_headers: [
224 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500225 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800226 ],
227
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700228 srcs: [
Vinh Tran9ccb8dd2022-08-09 15:38:48 -0400229 ":framework_native_aidl_binder",
230 ":framework_native_aidl_gui",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000231 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700232 ":libgui_bufferqueue_sources",
233
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700234 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700235 "BLASTBufferQueue.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700236 "BufferItemConsumer.cpp",
Rachel Lee273c18c2022-12-13 14:35:07 -0800237 "Choreographer.cpp",
Dominik Laskowski5a5e01e2022-07-08 07:52:44 -0700238 "CompositorTiming.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700239 "ConsumerBase.cpp",
240 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700241 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700242 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700243 "DisplayEventReceiver.cpp",
Alec Mouri0e7d8fd2023-05-03 23:58:43 +0000244 "FenceMonitor.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700245 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800246 "IConsumerListener.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800247 "IGraphicBufferConsumer.cpp",
248 "IGraphicBufferProducer.cpp",
249 "IProducerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700250 "ISurfaceComposer.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700251 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800252 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800253 "LayerMetadata.cpp",
Chavi Weingartenc78f53c2023-04-14 18:50:53 +0000254 "LayerStatePermissions.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700255 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800256 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700257 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800258 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700259 "Surface.cpp",
260 "SurfaceControl.cpp",
261 "SurfaceComposerClient.cpp",
262 "SyncFeatures.cpp",
Rachel Lee18c34372022-01-20 13:57:18 -0800263 "VsyncEventData.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800264 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500265 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800266 "bufferqueue/1.0/B2HProducerListener.cpp",
267 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
268 "bufferqueue/2.0/B2HProducerListener.cpp",
269 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700270 ],
271
272 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 ],
276
Chong Zhang62493092020-01-15 16:04:47 -0800277 export_shared_lib_headers: [
278 "libbinder",
279 ],
280
Alec Mouricdedc5d2021-03-01 22:39:55 -0800281 export_header_lib_headers: [
282 "libgui_aidl_headers",
Rachel Lee273c18c2022-12-13 14:35:07 -0800283 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800284 ],
285
Daichi Hironof474d3d2019-11-05 08:54:07 +0900286 aidl: {
287 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800288 },
289
Alec Mouricdedc5d2021-03-01 22:39:55 -0800290 header_libs: [
Rachel Lee273c18c2022-12-13 14:35:07 -0800291 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800292 "libdvr_headers",
293 "libgui_aidl_headers",
294 "libpdx_headers",
295 ],
296
Yi Kong7cd72c52021-12-23 15:51:29 +0800297 afdo: true,
Yi Kongb1f2d202021-02-23 17:52:42 +0800298
299 lto: {
300 thin: true,
301 },
Chavi Weingartene0237bb2023-02-06 21:48:32 +0000302
303 cflags: [
304 "-Wthread-safety",
305 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700306}
307
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700308// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700309// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700310cc_library_static {
311 name: "libgui_bufferqueue_static",
312 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900313 apex_available: [
314 "//apex_available:platform",
315 "com.android.media.swcodec",
316 ],
317 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700318
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700319 cflags: [
Chong Zhang62493092020-01-15 16:04:47 -0800320 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700321 ],
322
323 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700324
325 srcs: [
Huihong Luo02186fb2022-02-23 14:21:54 -0800326 ":libgui_frame_event_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000327 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700328 ":libgui_bufferqueue_sources",
329 ],
Huihong Luo02186fb2022-02-23 14:21:54 -0800330
331 aidl: {
332 include_dirs: [
333 "frameworks/native/libs/gui",
334 ],
335 },
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700336}
337
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700338filegroup {
339 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700340 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700341 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700342 "BufferItem.cpp",
343 "BufferQueue.cpp",
344 "BufferQueueConsumer.cpp",
345 "BufferQueueCore.cpp",
346 "BufferQueueProducer.cpp",
347 "BufferQueueThreadState.cpp",
348 "BufferSlot.cpp",
349 "FrameTimestamps.cpp",
350 "GLConsumerUtils.cpp",
351 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700352 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700353 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700354 "bufferqueue/1.0/H2BProducerListener.cpp",
355 "bufferqueue/1.0/WProducerListener.cpp",
356 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700357 "bufferqueue/2.0/H2BProducerListener.cpp",
358 "bufferqueue/2.0/types.cpp",
359 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700360}
361
362// Common build config shared by libgui and libgui_bufferqueue_static.
363cc_defaults {
364 name: "libgui_bufferqueue-defaults",
365
Sally Qi6920a2f2022-08-26 10:40:05 -0700366 defaults: ["android.hardware.graphics.common-ndk_shared"],
367
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700368 cflags: [
369 "-Wall",
370 "-Werror",
371 ],
372
373 cppflags: [
374 "-Wextra",
375 "-DDEBUG_ONLY_CODE=0",
376 ],
377
378 product_variables: {
379 eng: {
380 cppflags: [
381 "-UDEBUG_ONLY_CODE",
382 "-DDEBUG_ONLY_CODE=1",
383 ],
384 },
385 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700386
David Stevens7347f0b2020-01-15 20:19:22 +0900387 whole_static_libs: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000388 "libLibGuiProperties",
David Stevens7347f0b2020-01-15 20:19:22 +0900389 ],
390
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700391 shared_libs: [
392 "android.hardware.graphics.bufferqueue@1.0",
393 "android.hardware.graphics.bufferqueue@2.0",
394 "android.hardware.graphics.common@1.1",
395 "android.hardware.graphics.common@1.2",
396 "android.hidl.token@1.0-utils",
397 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700398 "libcutils",
399 "libEGL",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700400 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700401 "liblog",
402 "libnativewindow",
403 "libsync",
404 "libui",
405 "libutils",
406 "libvndksupport",
407 ],
408
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800409 static_libs: [
410 "libbinderthreadstateutils",
411 ],
412
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700413 header_libs: [
414 "libgui_headers",
415 "libnativebase_headers",
416 ],
417
Ady Abraham62f216c2020-10-13 19:07:23 -0700418 include_dirs: [
419 "frameworks/native/include",
420 ],
421
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700422 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700423 "libEGL",
424 "libnativewindow",
425 "libui",
426 "android.hardware.graphics.bufferqueue@1.0",
427 "android.hardware.graphics.bufferqueue@2.0",
428 "android.hardware.graphics.common@1.1",
429 "android.hardware.graphics.common@1.2",
430 "android.hidl.token@1.0-utils",
431 ],
432
433 export_header_lib_headers: [
434 "libgui_headers",
435 ],
436
437 export_include_dirs: [
438 "include",
439 ],
440}
441
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700442// GMocks for use by external code
443cc_library_static {
444 name: "libgui_mocks",
445 vendor_available: false,
446
447 defaults: ["libgui_bufferqueue-defaults"],
448 static_libs: [
449 "libgtest",
450 "libgmock",
451 ],
452
453 srcs: [
Huihong Luo0a81aa32022-02-22 16:02:36 -0800454 ":libgui_frame_event_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700455 "mock/GraphicBufferConsumer.cpp",
456 "mock/GraphicBufferProducer.cpp",
457 ],
458}
459
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700460subdirs = ["tests"]