blob: d7e7eb8ea1a4d3e3fa5a1e7087c8edd9c1245440 [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",
Patrick Williamsacd22582023-07-12 13:47:28 -050076 "android/gui/IWindowInfosPublisher.aidl",
Vinh Tran6bd75632023-04-14 18:55:25 -040077 "android/gui/IWindowInfosReportedListener.aidl",
78 "android/gui/WindowInfo.aidl",
Patrick Williamsd828f302023-04-28 17:52:08 -050079 "android/gui/WindowInfosUpdate.aidl",
Vinh Tran6bd75632023-04-14 18:55:25 -040080 ],
81}
82
chaviw3277faf2021-05-19 16:45:23 -050083cc_library_static {
84 name: "libgui_window_info_static",
85 vendor_available: true,
86 host_supported: true,
87 srcs: [
88 ":guiconstants_aidl",
Prabir Pradhande788502021-12-22 00:26:07 -080089 ":inputconstants_aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070090 "android/gui/DisplayInfo.aidl",
chaviw3277faf2021-05-19 16:45:23 -050091 "android/gui/FocusRequest.aidl",
92 "android/gui/InputApplicationInfo.aidl",
chaviw60c9d3e2021-06-04 12:52:17 -050093 "android/gui/IWindowInfosListener.aidl",
Patrick Williamsacd22582023-07-12 13:47:28 -050094 "android/gui/IWindowInfosPublisher.aidl",
chaviwbf023a62021-06-07 16:00:06 -050095 "android/gui/IWindowInfosReportedListener.aidl",
Patrick Williamsd828f302023-04-28 17:52:08 -050096 "android/gui/WindowInfosUpdate.aidl",
chaviw3277faf2021-05-19 16:45:23 -050097 "android/gui/WindowInfo.aidl",
Prabir Pradhan48f8cb92021-08-26 14:05:36 -070098 "DisplayInfo.cpp",
chaviw3277faf2021-05-19 16:45:23 -050099 "WindowInfo.cpp",
Patrick Williamsd828f302023-04-28 17:52:08 -0500100 "WindowInfosUpdate.cpp",
chaviw3277faf2021-05-19 16:45:23 -0500101 ],
102
103 shared_libs: [
104 "libbinder",
105 ],
106
107 local_include_dirs: [
108 "include",
109 ],
110
111 export_shared_lib_headers: [
112 "libbinder",
113 ],
114
115 static_libs: [
116 "libui-types",
117 ],
118
119 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700120 export_aidl_headers: true,
chaviw3277faf2021-05-19 16:45:23 -0500121 },
122
123 include_dirs: [
124 "frameworks/native/include",
125 ],
Jerome Gaillardaecaf0a2021-07-08 15:34:16 +0100126
127 target: {
128 darwin: {
129 enabled: false,
130 },
131 },
chaviw3277faf2021-05-19 16:45:23 -0500132}
133
Vinh Trancbbf3302023-05-25 09:19:56 -0400134aidl_library {
135 name: "libgui_aidl_hdrs",
136 hdrs: [
137 "android/gui/DisplayInfo.aidl",
138 "android/gui/FocusRequest.aidl",
139 "android/gui/InputApplicationInfo.aidl",
140 "android/gui/IWindowInfosListener.aidl",
Patrick Williamsacd22582023-07-12 13:47:28 -0500141 "android/gui/IWindowInfosPublisher.aidl",
Vinh Trancbbf3302023-05-25 09:19:56 -0400142 "android/gui/IWindowInfosReportedListener.aidl",
143 "android/gui/WindowInfo.aidl",
144 "android/gui/WindowInfosUpdate.aidl",
145 ],
146}
147
148aidl_library {
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000149 name: "libgui_aidl",
150 srcs: ["aidl/**/*.aidl"],
Vinh Trancbbf3302023-05-25 09:19:56 -0400151 strip_import_prefix: "aidl",
152 deps: ["libgui_aidl_hdrs"],
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000153}
154
Huihong Luo0a81aa32022-02-22 16:02:36 -0800155filegroup {
156 name: "libgui_frame_event_aidl",
157 srcs: ["aidl/android/gui/FrameEvent.aidl"],
158 path: "aidl/",
159}
160
Alec Mouricdedc5d2021-03-01 22:39:55 -0800161cc_library_static {
162 name: "libgui_aidl_static",
163 vendor_available: true,
Alec Mouricdedc5d2021-03-01 22:39:55 -0800164
165 shared_libs: [
166 "libbinder",
167 "libui",
168 ],
169
170 local_include_dirs: [
171 "include",
172 ],
173
Huihong Luo02186fb2022-02-23 14:21:54 -0800174 include_dirs: [
175 "frameworks/native/include",
176 ],
177
Alec Mouricdedc5d2021-03-01 22:39:55 -0800178 export_shared_lib_headers: [
179 "libbinder",
180 ],
181
chaviw3277faf2021-05-19 16:45:23 -0500182 static_libs: [
183 "libui-types",
Huihong Luo02186fb2022-02-23 14:21:54 -0800184 "libgui_window_info_static",
chaviw3277faf2021-05-19 16:45:23 -0500185 ],
186
Alec Mouricdedc5d2021-03-01 22:39:55 -0800187 aidl: {
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700188 export_aidl_headers: true,
Vinh Trancbbf3302023-05-25 09:19:56 -0400189 libs: ["libgui_aidl"],
Prabir Pradhan48f8cb92021-08-26 14:05:36 -0700190 },
Alec Mouricdedc5d2021-03-01 22:39:55 -0800191}
192
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700193cc_library_shared {
194 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +0900195 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900196 vndk: {
197 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +0900198 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +0900199 },
Jiyong Parka75d3d62018-04-09 12:16:30 +0900200 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700201
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700202 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700203
Alec Mouricdedc5d2021-03-01 22:39:55 -0800204 static_libs: [
205 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500206 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800207 ],
208 export_static_lib_headers: [
209 "libgui_aidl_static",
chaviw3277faf2021-05-19 16:45:23 -0500210 "libgui_window_info_static",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800211 ],
212
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700213 srcs: [
Vinh Tran9ccb8dd2022-08-09 15:38:48 -0400214 ":framework_native_aidl_binder",
215 ":framework_native_aidl_gui",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000216 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700217 ":libgui_bufferqueue_sources",
218
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700219 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -0700220 "BLASTBufferQueue.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700221 "BufferItemConsumer.cpp",
Rachel Lee273c18c2022-12-13 14:35:07 -0800222 "Choreographer.cpp",
Dominik Laskowski5a5e01e2022-07-08 07:52:44 -0700223 "CompositorTiming.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700224 "ConsumerBase.cpp",
225 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -0700226 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -0700227 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700228 "DisplayEventReceiver.cpp",
Alec Mouri0e7d8fd2023-05-03 23:58:43 +0000229 "FenceMonitor.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700230 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800231 "IConsumerListener.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800232 "IGraphicBufferConsumer.cpp",
233 "IGraphicBufferProducer.cpp",
234 "IProducerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700235 "ISurfaceComposer.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -0700236 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -0800237 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -0800238 "LayerMetadata.cpp",
Chavi Weingartenc78f53c2023-04-14 18:50:53 +0000239 "LayerStatePermissions.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700240 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800241 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700242 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -0800243 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700244 "Surface.cpp",
245 "SurfaceControl.cpp",
246 "SurfaceComposerClient.cpp",
247 "SyncFeatures.cpp",
Rachel Lee18c34372022-01-20 13:57:18 -0800248 "VsyncEventData.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -0800249 "view/Surface.cpp",
chaviw60c9d3e2021-06-04 12:52:17 -0500250 "WindowInfosListenerReporter.cpp",
Chong Zhang62493092020-01-15 16:04:47 -0800251 "bufferqueue/1.0/B2HProducerListener.cpp",
252 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
253 "bufferqueue/2.0/B2HProducerListener.cpp",
254 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700255 ],
256
257 shared_libs: [
Chong Zhang62493092020-01-15 16:04:47 -0800258 "libbinder",
Liz Kammer7994df22023-05-04 12:25:58 +0000259 "libGLESv2",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700260 ],
261
Chong Zhang62493092020-01-15 16:04:47 -0800262 export_shared_lib_headers: [
263 "libbinder",
264 ],
265
Alec Mouricdedc5d2021-03-01 22:39:55 -0800266 export_header_lib_headers: [
267 "libgui_aidl_headers",
Rachel Lee273c18c2022-12-13 14:35:07 -0800268 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800269 ],
270
Daichi Hironof474d3d2019-11-05 08:54:07 +0900271 aidl: {
272 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800273 },
274
Alec Mouricdedc5d2021-03-01 22:39:55 -0800275 header_libs: [
Rachel Lee273c18c2022-12-13 14:35:07 -0800276 "jni_headers",
Alec Mouricdedc5d2021-03-01 22:39:55 -0800277 "libdvr_headers",
278 "libgui_aidl_headers",
279 "libpdx_headers",
280 ],
281
Yi Kong7cd72c52021-12-23 15:51:29 +0800282 afdo: true,
Yi Kongb1f2d202021-02-23 17:52:42 +0800283
284 lto: {
285 thin: true,
286 },
Chavi Weingartene0237bb2023-02-06 21:48:32 +0000287
288 cflags: [
289 "-Wthread-safety",
290 ],
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700291}
292
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700293// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700294// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700295cc_library_static {
296 name: "libgui_bufferqueue_static",
297 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900298 apex_available: [
299 "//apex_available:platform",
300 "com.android.media.swcodec",
301 ],
302 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700303
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700304 cflags: [
Chong Zhang62493092020-01-15 16:04:47 -0800305 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700306 ],
307
308 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700309
310 srcs: [
Huihong Luo02186fb2022-02-23 14:21:54 -0800311 ":libgui_frame_event_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000312 ":inputconstants_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700313 ":libgui_bufferqueue_sources",
314 ],
Huihong Luo02186fb2022-02-23 14:21:54 -0800315
316 aidl: {
317 include_dirs: [
318 "frameworks/native/libs/gui",
319 ],
320 },
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700321}
322
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700323filegroup {
324 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700325 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700326 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700327 "BufferItem.cpp",
328 "BufferQueue.cpp",
329 "BufferQueueConsumer.cpp",
330 "BufferQueueCore.cpp",
331 "BufferQueueProducer.cpp",
332 "BufferQueueThreadState.cpp",
333 "BufferSlot.cpp",
334 "FrameTimestamps.cpp",
335 "GLConsumerUtils.cpp",
336 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700337 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700338 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700339 "bufferqueue/1.0/H2BProducerListener.cpp",
340 "bufferqueue/1.0/WProducerListener.cpp",
341 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700342 "bufferqueue/2.0/H2BProducerListener.cpp",
343 "bufferqueue/2.0/types.cpp",
344 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700345}
346
347// Common build config shared by libgui and libgui_bufferqueue_static.
348cc_defaults {
349 name: "libgui_bufferqueue-defaults",
350
Sally Qi6920a2f2022-08-26 10:40:05 -0700351 defaults: ["android.hardware.graphics.common-ndk_shared"],
352
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700353 cflags: [
354 "-Wall",
355 "-Werror",
356 ],
357
358 cppflags: [
359 "-Wextra",
360 "-DDEBUG_ONLY_CODE=0",
361 ],
362
363 product_variables: {
364 eng: {
365 cppflags: [
366 "-UDEBUG_ONLY_CODE",
367 "-DDEBUG_ONLY_CODE=1",
368 ],
369 },
370 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700371
David Stevens7347f0b2020-01-15 20:19:22 +0900372 whole_static_libs: [
Trevor Radcliffeba8800d2022-07-08 17:58:06 +0000373 "libLibGuiProperties",
David Stevens7347f0b2020-01-15 20:19:22 +0900374 ],
375
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700376 shared_libs: [
377 "android.hardware.graphics.bufferqueue@1.0",
378 "android.hardware.graphics.bufferqueue@2.0",
379 "android.hardware.graphics.common@1.1",
380 "android.hardware.graphics.common@1.2",
381 "android.hidl.token@1.0-utils",
382 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700383 "libcutils",
384 "libEGL",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700385 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700386 "liblog",
387 "libnativewindow",
388 "libsync",
389 "libui",
390 "libutils",
391 "libvndksupport",
392 ],
393
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800394 static_libs: [
395 "libbinderthreadstateutils",
396 ],
397
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700398 header_libs: [
399 "libgui_headers",
400 "libnativebase_headers",
401 ],
402
Ady Abraham62f216c2020-10-13 19:07:23 -0700403 include_dirs: [
404 "frameworks/native/include",
405 ],
406
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700407 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700408 "libEGL",
409 "libnativewindow",
410 "libui",
411 "android.hardware.graphics.bufferqueue@1.0",
412 "android.hardware.graphics.bufferqueue@2.0",
413 "android.hardware.graphics.common@1.1",
414 "android.hardware.graphics.common@1.2",
415 "android.hidl.token@1.0-utils",
416 ],
417
418 export_header_lib_headers: [
419 "libgui_headers",
420 ],
421
422 export_include_dirs: [
423 "include",
424 ],
425}
426
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700427// GMocks for use by external code
428cc_library_static {
429 name: "libgui_mocks",
430 vendor_available: false,
431
432 defaults: ["libgui_bufferqueue-defaults"],
433 static_libs: [
434 "libgtest",
435 "libgmock",
436 ],
437
438 srcs: [
Huihong Luo0a81aa32022-02-22 16:02:36 -0800439 ":libgui_frame_event_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700440 "mock/GraphicBufferConsumer.cpp",
441 "mock/GraphicBufferProducer.cpp",
442 ],
443}
444
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700445subdirs = ["tests"]