blob: 0a63c1564eee5bc6dcb650c9493a9e5dfd617435 [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
Vinh Tran6bd75632023-04-14 18:55:25 -040069filegroup {
70 name: "android_gui_aidl",
71 srcs: [
72 "android/gui/DisplayInfo.aidl",
73 "android/gui/FocusRequest.aidl",
74 "android/gui/InputApplicationInfo.aidl",
75 "android/gui/IWindowInfosListener.aidl",
76 "android/gui/IWindowInfosReportedListener.aidl",
77 "android/gui/WindowInfo.aidl",
78 ],
79}
80
chaviw3277faf2021-05-19 16:45:23 -050081cc_library_static {
82 name: "libgui_window_info_static",
83 vendor_available: true,
84 host_supported: true,
85 srcs: [
86 ":guiconstants_aidl",
Prabir Pradhande788502021-12-22 00:26:07 -080087 ":inputconstants_aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070088 "android/gui/DisplayInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050089 "android/gui/FocusRequest.aidl",
90 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050091 "android/gui/IWindowInfosListener.aidl",
chaviwbf023a62021-06-07 16:00:06 -050092 "android/gui/IWindowInfosReportedListener.aidl",
chaviw3277faf2021-05-19 16:45:23 -050093 "android/gui/WindowInfo.aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070094 "DisplayInfo.cpp",
chaviw3277faf2021-05-19 16:45:23 -050095 "WindowInfo.cpp",
96 ],
97
98 shared_libs: [
99 "libbinder",
100 ],
101
102 local_include_dirs: [
103 "include",
104 ],
105
106 export_shared_lib_headers: [
107 "libbinder",
108 ],
109
110 static_libs: [
111 "libui-types",
112 ],
113
114 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700115 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -0500116 },
117
118 include_dirs: [
119 "frameworks/native/include",
120 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100121
122 target: {
123 darwin: {
124 enabled: false,
125 },
126 },
chaviw3277faf2021-05-19 16:45:23 -0500127}
128
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000129filegroup {
130 name: "libgui_aidl",
131 srcs: ["aidl/**/*.aidl"],
132 path: "aidl/",
Vinh Tran6bd75632023-04-14 18:55:25 -0400133 aidl: {
134 deps: [":android_gui_aidl"],
135 },
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000136}
137
Huihong Luo0a81aa32022-02-22 16:02:36 -0800138filegroup {
139 name: "libgui_frame_event_aidl",
140 srcs: ["aidl/android/gui/FrameEvent.aidl"],
141 path: "aidl/",
142}
143
Alec Mouricdedc5d2021-03-01 22:39:55 -0800144cc_library_static {
145 name: "libgui_aidl_static",
146 vendor_available: true,
147 srcs: [
148 ":libgui_aidl",
149 ],
150
151 shared_libs: [
152 "libbinder",
153 "libui",
154 ],
155
156 local_include_dirs: [
157 "include",
158 ],
159
Huihong Luo02186fb2022-02-23 14:21:54 -0800160 include_dirs: [
161 "frameworks/native/include",
162 ],
163
Alec Mouricdedc5d2021-03-01 22:39:55 -0800164 export_shared_lib_headers: [
165 "libbinder",
166 ],
167
chaviw3277faf2021-05-19 16:45:23 -0500168 static_libs: [
169 "libui-types",
Huihong Luo02186fb2022-02-23 14:21:54 -0800170 "libgui_window_info_static",
chaviw3277faf2021-05-19 16:45:23 -0500171 ],
172
Alec Mouricdedc5d2021-03-01 22:39:55 -0800173 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700174 export_aidl_headers: true,
Huihong Luo02186fb2022-02-23 14:21:54 -0800175 include_dirs: [
176 "frameworks/native/libs/gui",
177 ],
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700178 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800179}
180
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700181cc_library_shared {
182 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900183 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900184 vndk: {
185 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900186 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900187 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900188 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700189
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700190 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700191
Alec Mouricdedc5d2021-03-01 22:39:55 -0800192 static_libs: [
193 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500194 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800195 ],
196 export_static_lib_headers: [
197 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500198 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800199 ],
200
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700201 srcs: [
Vinh Tran9ccb8dd2022-08-09 15:38:48 -0400202 ":framework_native_aidl_binder",
203 ":framework_native_aidl_gui",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000204 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700205 ":libgui_bufferqueue_sources",
206
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700207 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700208 "BLASTBufferQueue.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700209 "BufferItemConsumer.cpp",
Rachel Lee273c18c2022-12-13 14:35:07 -0800210 "Choreographer.cpp",
Dominik Laskowski5a5e01e2022-07-08 07:52:44 -0700211 "CompositorTiming.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700212 "ConsumerBase.cpp",
213 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700214 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700215 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700216 "DisplayEventReceiver.cpp",
217 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800218 "IConsumerListener.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800219 "IGraphicBufferConsumer.cpp",
220 "IGraphicBufferProducer.cpp",
221 "IProducerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700222 "ISurfaceComposer.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700223 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800224 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800225 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700226 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800227 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700228 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800229 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700230 "Surface.cpp",
231 "SurfaceControl.cpp",
232 "SurfaceComposerClient.cpp",
233 "SyncFeatures.cpp",
Rachel Lee18c34372022-01-20 13:57:18 -0800234 "VsyncEventData.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800235 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500236 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800237 "bufferqueue/1.0/B2HProducerListener.cpp",
238 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
239 "bufferqueue/2.0/B2HProducerListener.cpp",
240 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700241 ],
242
243 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800244 "libbinder",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700245 ],
246
Chong Zhang62493092020-01-15 16:04:47 -0800247 export_shared_lib_headers: [
248 "libbinder",
249 ],
250
Alec Mouricdedc5d2021-03-01 22:39:55 -0800251 export_header_lib_headers: [
252 "libgui_aidl_headers",
Rachel Lee273c18c2022-12-13 14:35:07 -0800253 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800254 ],
255
Daichi Hironof474d3d2019-11-05 08:54:07 +0900256 aidl: {
257 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800258 },
259
Alec Mouricdedc5d2021-03-01 22:39:55 -0800260 header_libs: [
Rachel Lee273c18c2022-12-13 14:35:07 -0800261 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800262 "libdvr_headers",
263 "libgui_aidl_headers",
264 "libpdx_headers",
265 ],
266
Yi Kong7cd72c52021-12-23 15:51:29 +0800267 afdo: true,
Yi Kongb1f2d202021-02-23 17:52:42 +0800268
269 lto: {
270 thin: true,
271 },
Chavi Weingartene0237bb2023-02-06 21:48:32 +0000272
273 cflags: [
274 "-Wthread-safety",
275 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700276}
277
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700278// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700279// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700280cc_library_static {
281 name: "libgui_bufferqueue_static",
282 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900283 apex_available: [
284 "//apex_available:platform",
285 "com.android.media.swcodec",
286 ],
287 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700288
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700289 cflags: [
Chong Zhang62493092020-01-15 16:04:47 -0800290 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700291 ],
292
293 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700294
295 srcs: [
Huihong Luo02186fb2022-02-23 14:21:54 -0800296 ":libgui_frame_event_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000297 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700298 ":libgui_bufferqueue_sources",
299 ],
Huihong Luo02186fb2022-02-23 14:21:54 -0800300
301 aidl: {
302 include_dirs: [
303 "frameworks/native/libs/gui",
304 ],
305 },
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700306}
307
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700308filegroup {
309 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700310 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700311 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700312 "BufferItem.cpp",
313 "BufferQueue.cpp",
314 "BufferQueueConsumer.cpp",
315 "BufferQueueCore.cpp",
316 "BufferQueueProducer.cpp",
317 "BufferQueueThreadState.cpp",
318 "BufferSlot.cpp",
319 "FrameTimestamps.cpp",
320 "GLConsumerUtils.cpp",
321 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700322 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700323 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700324 "bufferqueue/1.0/H2BProducerListener.cpp",
325 "bufferqueue/1.0/WProducerListener.cpp",
326 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700327 "bufferqueue/2.0/H2BProducerListener.cpp",
328 "bufferqueue/2.0/types.cpp",
329 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700330}
331
332// Common build config shared by libgui and libgui_bufferqueue_static.
333cc_defaults {
334 name: "libgui_bufferqueue-defaults",
335
Sally Qi6920a2f2022-08-26 10:40:05 -0700336 defaults: ["android.hardware.graphics.common-ndk_shared"],
337
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700338 cflags: [
339 "-Wall",
340 "-Werror",
341 ],
342
343 cppflags: [
344 "-Wextra",
345 "-DDEBUG_ONLY_CODE=0",
346 ],
347
348 product_variables: {
349 eng: {
350 cppflags: [
351 "-UDEBUG_ONLY_CODE",
352 "-DDEBUG_ONLY_CODE=1",
353 ],
354 },
355 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700356
David Stevens7347f0b2020-01-15 20:19:22 +0900357 whole_static_libs: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000358 "libLibGuiProperties",
David Stevens7347f0b2020-01-15 20:19:22 +0900359 ],
360
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700361 shared_libs: [
362 "android.hardware.graphics.bufferqueue@1.0",
363 "android.hardware.graphics.bufferqueue@2.0",
364 "android.hardware.graphics.common@1.1",
365 "android.hardware.graphics.common@1.2",
366 "android.hidl.token@1.0-utils",
367 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700368 "libcutils",
369 "libEGL",
370 "libGLESv2",
371 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700372 "liblog",
373 "libnativewindow",
374 "libsync",
375 "libui",
376 "libutils",
377 "libvndksupport",
378 ],
379
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800380 static_libs: [
381 "libbinderthreadstateutils",
382 ],
383
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700384 header_libs: [
385 "libgui_headers",
386 "libnativebase_headers",
387 ],
388
Ady Abraham62f216c2020-10-13 19:07:23 -0700389 include_dirs: [
390 "frameworks/native/include",
391 ],
392
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700393 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700394 "libEGL",
395 "libnativewindow",
396 "libui",
397 "android.hardware.graphics.bufferqueue@1.0",
398 "android.hardware.graphics.bufferqueue@2.0",
399 "android.hardware.graphics.common@1.1",
400 "android.hardware.graphics.common@1.2",
401 "android.hidl.token@1.0-utils",
402 ],
403
404 export_header_lib_headers: [
405 "libgui_headers",
406 ],
407
408 export_include_dirs: [
409 "include",
410 ],
411}
412
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700413// GMocks for use by external code
414cc_library_static {
415 name: "libgui_mocks",
416 vendor_available: false,
417
418 defaults: ["libgui_bufferqueue-defaults"],
419 static_libs: [
420 "libgtest",
421 "libgmock",
422 ],
423
424 srcs: [
Huihong Luo0a81aa32022-02-22 16:02:36 -0800425 ":libgui_frame_event_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700426 "mock/GraphicBufferConsumer.cpp",
427 "mock/GraphicBufferProducer.cpp",
428 ],
429}
430
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700431subdirs = ["tests"]