blob: 80fed9843411cac4a0c48e6f291c34eb46a6965a [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",
Patrick Williamsd828f302023-04-28 17:52:08 -050078 "android/gui/WindowInfosUpdate.aidl",
Vinh Tran6bd75632023-04-14 18:55:25 -040079 ],
80}
81
chaviw3277faf2021-05-19 16:45:23 -050082cc_library_static {
83 name: "libgui_window_info_static",
84 vendor_available: true,
85 host_supported: true,
86 srcs: [
87 ":guiconstants_aidl",
Prabir Pradhande788502021-12-22 00:26:07 -080088 ":inputconstants_aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070089 "android/gui/DisplayInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050090 "android/gui/FocusRequest.aidl",
91 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050092 "android/gui/IWindowInfosListener.aidl",
chaviwbf023a62021-06-07 16:00:06 -050093 "android/gui/IWindowInfosReportedListener.aidl",
Patrick Williamsd828f302023-04-28 17:52:08 -050094 "android/gui/WindowInfosUpdate.aidl",
chaviw3277faf2021-05-19 16:45:23 -050095 "android/gui/WindowInfo.aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070096 "DisplayInfo.cpp",
chaviw3277faf2021-05-19 16:45:23 -050097 "WindowInfo.cpp",
Patrick Williamsd828f302023-04-28 17:52:08 -050098 "WindowInfosUpdate.cpp",
chaviw3277faf2021-05-19 16:45:23 -050099 ],
100
101 shared_libs: [
102 "libbinder",
103 ],
104
105 local_include_dirs: [
106 "include",
107 ],
108
109 export_shared_lib_headers: [
110 "libbinder",
111 ],
112
113 static_libs: [
114 "libui-types",
115 ],
116
117 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700118 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -0500119 },
120
121 include_dirs: [
122 "frameworks/native/include",
123 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100124
125 target: {
126 darwin: {
127 enabled: false,
128 },
129 },
chaviw3277faf2021-05-19 16:45:23 -0500130}
131
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000132filegroup {
133 name: "libgui_aidl",
134 srcs: ["aidl/**/*.aidl"],
135 path: "aidl/",
Vinh Tran6bd75632023-04-14 18:55:25 -0400136 aidl: {
137 deps: [":android_gui_aidl"],
138 },
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000139}
140
Huihong Luo0a81aa32022-02-22 16:02:36 -0800141filegroup {
142 name: "libgui_frame_event_aidl",
143 srcs: ["aidl/android/gui/FrameEvent.aidl"],
144 path: "aidl/",
145}
146
Alec Mouricdedc5d2021-03-01 22:39:55 -0800147cc_library_static {
148 name: "libgui_aidl_static",
149 vendor_available: true,
150 srcs: [
151 ":libgui_aidl",
152 ],
153
154 shared_libs: [
155 "libbinder",
156 "libui",
157 ],
158
159 local_include_dirs: [
160 "include",
161 ],
162
Huihong Luo02186fb2022-02-23 14:21:54 -0800163 include_dirs: [
164 "frameworks/native/include",
165 ],
166
Alec Mouricdedc5d2021-03-01 22:39:55 -0800167 export_shared_lib_headers: [
168 "libbinder",
169 ],
170
chaviw3277faf2021-05-19 16:45:23 -0500171 static_libs: [
172 "libui-types",
Huihong Luo02186fb2022-02-23 14:21:54 -0800173 "libgui_window_info_static",
chaviw3277faf2021-05-19 16:45:23 -0500174 ],
175
Alec Mouricdedc5d2021-03-01 22:39:55 -0800176 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700177 export_aidl_headers: true,
Huihong Luo02186fb2022-02-23 14:21:54 -0800178 include_dirs: [
179 "frameworks/native/libs/gui",
180 ],
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700181 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800182}
183
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700184cc_library_shared {
185 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900186 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900187 vndk: {
188 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900189 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900190 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900191 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700192
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700193 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700194
Alec Mouricdedc5d2021-03-01 22:39:55 -0800195 static_libs: [
196 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500197 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800198 ],
199 export_static_lib_headers: [
200 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500201 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800202 ],
203
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700204 srcs: [
Vinh Tran9ccb8dd2022-08-09 15:38:48 -0400205 ":framework_native_aidl_binder",
206 ":framework_native_aidl_gui",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000207 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700208 ":libgui_bufferqueue_sources",
209
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700210 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700211 "BLASTBufferQueue.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700212 "BufferItemConsumer.cpp",
Rachel Lee273c18c2022-12-13 14:35:07 -0800213 "Choreographer.cpp",
Dominik Laskowski5a5e01e2022-07-08 07:52:44 -0700214 "CompositorTiming.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700215 "ConsumerBase.cpp",
216 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700217 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700218 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700219 "DisplayEventReceiver.cpp",
220 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800221 "IConsumerListener.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800222 "IGraphicBufferConsumer.cpp",
223 "IGraphicBufferProducer.cpp",
224 "IProducerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700225 "ISurfaceComposer.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700226 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800227 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800228 "LayerMetadata.cpp",
Chavi Weingartenc78f53c2023-04-14 18:50:53 +0000229 "LayerStatePermissions.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700230 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800231 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700232 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800233 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700234 "Surface.cpp",
235 "SurfaceControl.cpp",
236 "SurfaceComposerClient.cpp",
237 "SyncFeatures.cpp",
Rachel Lee18c34372022-01-20 13:57:18 -0800238 "VsyncEventData.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800239 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500240 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800241 "bufferqueue/1.0/B2HProducerListener.cpp",
242 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
243 "bufferqueue/2.0/B2HProducerListener.cpp",
244 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700245 ],
246
247 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800248 "libbinder",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700249 ],
250
Chong Zhang62493092020-01-15 16:04:47 -0800251 export_shared_lib_headers: [
252 "libbinder",
253 ],
254
Alec Mouricdedc5d2021-03-01 22:39:55 -0800255 export_header_lib_headers: [
256 "libgui_aidl_headers",
Rachel Lee273c18c2022-12-13 14:35:07 -0800257 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800258 ],
259
Daichi Hironof474d3d2019-11-05 08:54:07 +0900260 aidl: {
261 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800262 },
263
Alec Mouricdedc5d2021-03-01 22:39:55 -0800264 header_libs: [
Rachel Lee273c18c2022-12-13 14:35:07 -0800265 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800266 "libdvr_headers",
267 "libgui_aidl_headers",
268 "libpdx_headers",
269 ],
270
Yi Kong7cd72c52021-12-23 15:51:29 +0800271 afdo: true,
Yi Kongb1f2d202021-02-23 17:52:42 +0800272
273 lto: {
274 thin: true,
275 },
Chavi Weingartene0237bb2023-02-06 21:48:32 +0000276
277 cflags: [
278 "-Wthread-safety",
279 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700280}
281
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700282// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700283// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700284cc_library_static {
285 name: "libgui_bufferqueue_static",
286 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900287 apex_available: [
288 "//apex_available:platform",
289 "com.android.media.swcodec",
290 ],
291 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700292
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700293 cflags: [
Chong Zhang62493092020-01-15 16:04:47 -0800294 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700295 ],
296
297 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700298
299 srcs: [
Huihong Luo02186fb2022-02-23 14:21:54 -0800300 ":libgui_frame_event_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000301 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700302 ":libgui_bufferqueue_sources",
303 ],
Huihong Luo02186fb2022-02-23 14:21:54 -0800304
305 aidl: {
306 include_dirs: [
307 "frameworks/native/libs/gui",
308 ],
309 },
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700310}
311
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700312filegroup {
313 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700314 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700315 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700316 "BufferItem.cpp",
317 "BufferQueue.cpp",
318 "BufferQueueConsumer.cpp",
319 "BufferQueueCore.cpp",
320 "BufferQueueProducer.cpp",
321 "BufferQueueThreadState.cpp",
322 "BufferSlot.cpp",
323 "FrameTimestamps.cpp",
324 "GLConsumerUtils.cpp",
325 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700326 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700327 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700328 "bufferqueue/1.0/H2BProducerListener.cpp",
329 "bufferqueue/1.0/WProducerListener.cpp",
330 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700331 "bufferqueue/2.0/H2BProducerListener.cpp",
332 "bufferqueue/2.0/types.cpp",
333 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700334}
335
336// Common build config shared by libgui and libgui_bufferqueue_static.
337cc_defaults {
338 name: "libgui_bufferqueue-defaults",
339
Sally Qi6920a2f2022-08-26 10:40:05 -0700340 defaults: ["android.hardware.graphics.common-ndk_shared"],
341
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700342 cflags: [
343 "-Wall",
344 "-Werror",
345 ],
346
347 cppflags: [
348 "-Wextra",
349 "-DDEBUG_ONLY_CODE=0",
350 ],
351
352 product_variables: {
353 eng: {
354 cppflags: [
355 "-UDEBUG_ONLY_CODE",
356 "-DDEBUG_ONLY_CODE=1",
357 ],
358 },
359 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700360
David Stevens7347f0b2020-01-15 20:19:22 +0900361 whole_static_libs: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000362 "libLibGuiProperties",
David Stevens7347f0b2020-01-15 20:19:22 +0900363 ],
364
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700365 shared_libs: [
366 "android.hardware.graphics.bufferqueue@1.0",
367 "android.hardware.graphics.bufferqueue@2.0",
368 "android.hardware.graphics.common@1.1",
369 "android.hardware.graphics.common@1.2",
370 "android.hidl.token@1.0-utils",
371 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700372 "libcutils",
373 "libEGL",
374 "libGLESv2",
375 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700376 "liblog",
377 "libnativewindow",
378 "libsync",
379 "libui",
380 "libutils",
381 "libvndksupport",
382 ],
383
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800384 static_libs: [
385 "libbinderthreadstateutils",
386 ],
387
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700388 header_libs: [
389 "libgui_headers",
390 "libnativebase_headers",
391 ],
392
Ady Abraham62f216c2020-10-13 19:07:23 -0700393 include_dirs: [
394 "frameworks/native/include",
395 ],
396
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700397 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700398 "libEGL",
399 "libnativewindow",
400 "libui",
401 "android.hardware.graphics.bufferqueue@1.0",
402 "android.hardware.graphics.bufferqueue@2.0",
403 "android.hardware.graphics.common@1.1",
404 "android.hardware.graphics.common@1.2",
405 "android.hidl.token@1.0-utils",
406 ],
407
408 export_header_lib_headers: [
409 "libgui_headers",
410 ],
411
412 export_include_dirs: [
413 "include",
414 ],
415}
416
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700417// GMocks for use by external code
418cc_library_static {
419 name: "libgui_mocks",
420 vendor_available: false,
421
422 defaults: ["libgui_bufferqueue-defaults"],
423 static_libs: [
424 "libgtest",
425 "libgmock",
426 ],
427
428 srcs: [
Huihong Luo0a81aa32022-02-22 16:02:36 -0800429 ":libgui_frame_event_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700430 "mock/GraphicBufferConsumer.cpp",
431 "mock/GraphicBufferProducer.cpp",
432 ],
433}
434
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700435subdirs = ["tests"]