| // Copyright 2010 The Android Open Source Project | |
| // | |
| // Licensed under the Apache License, Version 2.0 (the "License"); | |
| // you may not use this file except in compliance with the License. | |
| // You may obtain a copy of the License at | |
| // | |
| // http://www.apache.org/licenses/LICENSE-2.0 | |
| // | |
| // Unless required by applicable law or agreed to in writing, software | |
| // distributed under the License is distributed on an "AS IS" BASIS, | |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| // See the License for the specific language governing permissions and | |
| // limitations under the License. | |
| package { | |
| // See: http://go/android-license-faq | |
| // A large-scale-change added 'default_applicable_licenses' to import | |
| // all of the 'license_kinds' from "frameworks_native_license" | |
| // to get the below license kinds: | |
| // SPDX-license-identifier-Apache-2.0 | |
| default_applicable_licenses: ["frameworks_native_license"], | |
| default_team: "trendy_team_android_core_graphics_stack", | |
| } | |
| aconfig_declarations { | |
| name: "libgui_flags", | |
| package: "com.android.graphics.libgui.flags", | |
| container: "system", | |
| srcs: ["libgui_flags.aconfig"], | |
| } | |
| cc_aconfig_library { | |
| name: "libguiflags", | |
| host_supported: true, | |
| vendor_available: true, | |
| min_sdk_version: "29", | |
| apex_available: [ | |
| "//apex_available:platform", | |
| "com.android.media.swcodec", | |
| "test_com.android.media.swcodec", | |
| ], | |
| aconfig_declarations: "libgui_flags", | |
| } | |
| cc_aconfig_library { | |
| name: "aconfig_libgui_flags_c_lib", | |
| min_sdk_version: "30", | |
| vendor_available: true, | |
| double_loadable: true, | |
| host_supported: true, | |
| apex_available: [ | |
| "//apex_available:platform", | |
| "com.android.media", | |
| "com.android.media.swcodec", | |
| ], | |
| aconfig_declarations: "libgui_flags", | |
| } | |
| cc_aconfig_library { | |
| name: "libguiflags_no_apex", | |
| aconfig_declarations: "libgui_flags", | |
| } | |
| cc_library_headers { | |
| name: "libgui_headers", | |
| vendor_available: true, | |
| export_include_dirs: ["include"], | |
| // we must build this module to get the required header as that is generated | |
| export_shared_lib_headers: [ | |
| "android.hidl.token@1.0-utils", | |
| "android.hardware.graphics.bufferqueue@1.0", | |
| "android.hardware.graphics.bufferqueue@2.0", | |
| ], | |
| shared_libs: [ | |
| "android.hidl.token@1.0-utils", | |
| "android.hardware.graphics.bufferqueue@1.0", | |
| "android.hardware.graphics.bufferqueue@2.0", | |
| ], | |
| static_libs: ["libguiflags"], | |
| export_static_lib_headers: ["libguiflags"], | |
| min_sdk_version: "29", | |
| // TODO(b/218719284) can media use be constrained to libgui_bufferqueue_static? | |
| apex_available: [ | |
| "//apex_available:platform", | |
| "com.android.media.swcodec", | |
| "test_com.android.media.swcodec", | |
| ], | |
| } | |
| cc_library_headers { | |
| name: "libgui_aidl_headers", | |
| vendor_available: true, | |
| static_libs: [ | |
| "libgui_aidl_static", | |
| ], | |
| export_static_lib_headers: [ | |
| "libgui_aidl_static", | |
| ], | |
| } | |
| // AIDL files that should be exposed to java | |
| filegroup { | |
| name: "guiconstants_aidl", | |
| srcs: [ | |
| "android/gui/BorderSettings.aidl", | |
| "android/gui/BoxShadowSettings.aidl", | |
| "android/gui/CornerRadiiData.aidl", | |
| "android/gui/DropInputMode.aidl", | |
| "android/gui/EarlyWakeupInfo.aidl", | |
| "android/gui/StalledTransactionInfo.aidl", | |
| "android/**/TouchOcclusionMode.aidl", | |
| "android/gui/TransactionBarrier.aidl", | |
| "android/gui/TrustedOverlay.aidl", | |
| "android/gui/Vec2.aidl", | |
| ], | |
| } | |
| filegroup { | |
| name: "android_gui_aidl", | |
| srcs: [ | |
| "android/gui/DisplayInfo.aidl", | |
| "android/gui/FocusRequest.aidl", | |
| "android/gui/InputApplicationInfo.aidl", | |
| "android/gui/IWindowInfosListener.aidl", | |
| "android/gui/IWindowInfosPublisher.aidl", | |
| "android/gui/IWindowInfosReportedListener.aidl", | |
| "android/gui/WindowInfo.aidl", | |
| "android/gui/WindowInfosUpdate.aidl", | |
| ], | |
| } | |
| cc_library_static { | |
| name: "libgui_window_info_static", | |
| vendor_available: true, | |
| host_supported: true, | |
| srcs: [ | |
| ":guiconstants_aidl", | |
| ":inputconstants_aidl", | |
| "android/gui/DisplayInfo.aidl", | |
| "android/gui/FocusRequest.aidl", | |
| "android/gui/InputApplicationInfo.aidl", | |
| "android/gui/IWindowInfosListener.aidl", | |
| "android/gui/IWindowInfosPublisher.aidl", | |
| "android/gui/IWindowInfosReportedListener.aidl", | |
| "android/gui/WindowInfosUpdate.aidl", | |
| "android/gui/WindowInfo.aidl", | |
| "DisplayInfo.cpp", | |
| "WindowInfo.cpp", | |
| "WindowInfosUpdate.cpp", | |
| ], | |
| shared_libs: [ | |
| "libbinder", | |
| ], | |
| local_include_dirs: [ | |
| "include", | |
| ], | |
| export_shared_lib_headers: [ | |
| "libbinder", | |
| ], | |
| static_libs: [ | |
| "libui-types", | |
| ], | |
| aidl: { | |
| export_aidl_headers: true, | |
| }, | |
| include_dirs: [ | |
| "frameworks/native/include", | |
| ], | |
| target: { | |
| darwin: { | |
| enabled: false, | |
| }, | |
| }, | |
| } | |
| filegroup { | |
| name: "libgui_extra_aidl_files", | |
| srcs: [ | |
| "android/gui/DisplayInfo.aidl", | |
| "android/gui/FocusRequest.aidl", | |
| "android/gui/InputApplicationInfo.aidl", | |
| "android/gui/IWindowInfosListener.aidl", | |
| "android/gui/IWindowInfosPublisher.aidl", | |
| "android/gui/IWindowInfosReportedListener.aidl", | |
| "android/gui/StalledTransactionInfo.aidl", | |
| "android/gui/WindowInfo.aidl", | |
| "android/gui/WindowInfosUpdate.aidl", | |
| ], | |
| } | |
| filegroup { | |
| name: "libgui_extra_unstructured_aidl_files", | |
| srcs: [ | |
| "android/gui/DisplayInfo.aidl", | |
| "android/gui/InputApplicationInfo.aidl", | |
| "android/gui/WindowInfo.aidl", | |
| "android/gui/WindowInfosUpdate.aidl", | |
| ], | |
| } | |
| aidl_library { | |
| name: "libgui_aidl_hdrs", | |
| hdrs: [":libgui_extra_aidl_files"], | |
| } | |
| aidl_library { | |
| name: "libgui_extra_unstructured_aidl_hdrs", | |
| hdrs: [":libgui_extra_unstructured_aidl_files"], | |
| } | |
| aidl_library { | |
| name: "libgui_aidl", | |
| srcs: ["aidl/**/*.aidl"], | |
| strip_import_prefix: "aidl", | |
| deps: [ | |
| "libgui_aidl_hdrs", | |
| "libgui_extra_unstructured_aidl_hdrs", | |
| ], | |
| } | |
| filegroup { | |
| name: "libgui_frame_event_aidl", | |
| srcs: ["aidl/android/gui/FrameEvent.aidl"], | |
| path: "aidl/", | |
| } | |
| cc_library_static { | |
| name: "libgui_aidl_static", | |
| vendor_available: true, | |
| shared_libs: [ | |
| "libbinder", | |
| "libui", | |
| ], | |
| local_include_dirs: [ | |
| "include", | |
| ], | |
| include_dirs: [ | |
| "frameworks/native/include", | |
| ], | |
| export_shared_lib_headers: [ | |
| "libbinder", | |
| ], | |
| static_libs: [ | |
| "libui-types", | |
| "libgui_window_info_static", | |
| ], | |
| aidl: { | |
| export_aidl_headers: true, | |
| libs: ["libgui_aidl"], | |
| }, | |
| } | |
| filegroup { | |
| name: "libgui-sources", | |
| srcs: [ | |
| ":framework_native_aidl_binder", | |
| ":framework_native_aidl_gui", | |
| ":inputconstants_aidl", | |
| ":libgui_bufferqueue_sources", | |
| "BitTube.cpp", | |
| "BLASTBufferQueue.cpp", | |
| "BufferItemConsumer.cpp", | |
| "BufferReleaseChannel.cpp", | |
| "Choreographer.cpp", | |
| "CompositorTiming.cpp", | |
| "ConsumerBase.cpp", | |
| "CpuConsumer.cpp", | |
| "DebugEGLImageTracker.cpp", | |
| "DisplayEventDispatcher.cpp", | |
| "DisplayEventReceiver.cpp", | |
| "FenceMonitor.cpp", | |
| "Flags.cpp", | |
| "GLConsumer.cpp", | |
| "IGraphicBufferProducer.cpp", | |
| "IProducerListener.cpp", | |
| "ISurfaceComposer.cpp", | |
| "ITransactionCompletedListener.cpp", | |
| "LayerMetadata.cpp", | |
| "LayerStatePermissions.cpp", | |
| "LayerState.cpp", | |
| "DisplayLuts.cpp", | |
| "OccupancyTracker.cpp", | |
| "StreamSplitter.cpp", | |
| "ScreenCaptureResults.cpp", | |
| "Surface.cpp", | |
| "SurfaceControl.cpp", | |
| "SurfaceComposerClient.cpp", | |
| "SyncFeatures.cpp", | |
| "TransactionState.cpp", | |
| "VsyncEventData.cpp", | |
| "view/Surface.cpp", | |
| "WindowInfosListenerReporter.cpp", | |
| "bufferqueue/1.0/B2HProducerListener.cpp", | |
| "bufferqueue/1.0/H2BGraphicBufferProducer.cpp", | |
| "bufferqueue/2.0/B2HProducerListener.cpp", | |
| "bufferqueue/2.0/H2BGraphicBufferProducer.cpp", | |
| ], | |
| } | |
| cc_defaults { | |
| name: "libgui-defaults", | |
| defaults: ["libgui_bufferqueue-defaults"], | |
| tidy: true, | |
| tidy_flags: [ | |
| // Only check our headers | |
| "--header-filter=^.*frameworks/native/libs/gui/.*.h$", | |
| ], | |
| static_libs: [ | |
| "libgui_aidl_static", | |
| "libgui_window_info_static", | |
| "libguiflags", | |
| ], | |
| shared_libs: [ | |
| "libbinder", | |
| "libGLESv2", | |
| ], | |
| export_static_lib_headers: [ | |
| "libguiflags", | |
| ], | |
| } | |
| cc_library_shared { | |
| name: "libgui", | |
| vendor_available: true, | |
| double_loadable: true, | |
| defaults: [ | |
| "libgui-defaults", | |
| ], | |
| srcs: [ | |
| ":libgui-sources", | |
| ], | |
| export_static_lib_headers: [ | |
| "libgui_aidl_static", | |
| "libgui_window_info_static", | |
| ], | |
| export_shared_lib_headers: [ | |
| "libbinder", | |
| ], | |
| export_header_lib_headers: [ | |
| "libgui_aidl_headers", | |
| "jni_headers", | |
| ], | |
| aidl: { | |
| export_aidl_headers: true, | |
| }, | |
| header_libs: [ | |
| "jni_headers", | |
| "libgui_aidl_headers", | |
| ], | |
| static_libs: [ | |
| "libsurfaceflingerflags", | |
| ], | |
| shared_libs: [ | |
| "libaconfig_storage_read_api_cc", | |
| ], | |
| afdo: true, | |
| lto: { | |
| thin: true, | |
| }, | |
| cflags: [ | |
| "-Wthread-safety", | |
| ], | |
| } | |
| // Used by media codec services exclusively as a static lib for | |
| // core bufferqueue support only. | |
| cc_library_static { | |
| name: "libgui_bufferqueue_static", | |
| vendor_available: true, | |
| apex_available: [ | |
| "//apex_available:platform", | |
| "com.android.media.swcodec", | |
| ], | |
| min_sdk_version: "29", | |
| cflags: [ | |
| "-DNO_BINDER", | |
| ], | |
| defaults: ["libgui_bufferqueue-defaults"], | |
| srcs: [ | |
| ":libgui_frame_event_aidl", | |
| ":inputconstants_aidl", | |
| ":libgui_bufferqueue_sources", | |
| ], | |
| aidl: { | |
| include_dirs: [ | |
| "frameworks/native/libs/gui", | |
| ], | |
| }, | |
| } | |
| filegroup { | |
| name: "libgui_bufferqueue_sources", | |
| srcs: [ | |
| "BatchBufferOps.cpp", | |
| "BufferItem.cpp", | |
| "BufferItemConsumer.cpp", | |
| "BufferQueue.cpp", | |
| "BufferQueueConsumer.cpp", | |
| "BufferQueueCore.cpp", | |
| "BufferQueueProducer.cpp", | |
| "BufferQueueThreadState.cpp", | |
| "BufferSlot.cpp", | |
| "ConsumerBase.cpp", | |
| "FenceMonitor.cpp", | |
| "FrameRateUtils.cpp", | |
| "FrameTimestamps.cpp", | |
| "GLConsumerUtils.cpp", | |
| "HdrMetadata.cpp", | |
| "IGraphicBufferProducerFlattenables.cpp", | |
| "Surface.cpp", | |
| "bufferqueue/1.0/Conversion.cpp", | |
| "bufferqueue/1.0/H2BProducerListener.cpp", | |
| "bufferqueue/1.0/WProducerListener.cpp", | |
| "bufferqueue/2.0/B2HGraphicBufferProducer.cpp", | |
| "bufferqueue/2.0/H2BProducerListener.cpp", | |
| "bufferqueue/2.0/types.cpp", | |
| ], | |
| } | |
| // Common build config shared by libgui and libgui_bufferqueue_static. | |
| cc_defaults { | |
| name: "libgui_bufferqueue-defaults", | |
| defaults: ["android.hardware.graphics.common-ndk_shared"], | |
| cflags: [ | |
| "-Wall", | |
| "-Werror", | |
| ], | |
| cppflags: [ | |
| "-Wextra", | |
| "-DDEBUG_ONLY_CODE=0", | |
| ], | |
| product_variables: { | |
| eng: { | |
| cppflags: [ | |
| "-UDEBUG_ONLY_CODE", | |
| "-DDEBUG_ONLY_CODE=1", | |
| ], | |
| }, | |
| }, | |
| whole_static_libs: [ | |
| "libLibGuiProperties", | |
| ], | |
| shared_libs: [ | |
| "android.hardware.graphics.bufferqueue@1.0", | |
| "android.hardware.graphics.bufferqueue@2.0", | |
| "android.hardware.graphics.common@1.1", | |
| "android.hardware.graphics.common@1.2", | |
| "android.hidl.token@1.0-utils", | |
| "libbase", | |
| "libcutils", | |
| "libEGL", | |
| "libhidlbase", | |
| "liblog", | |
| "libnativewindow", | |
| "libsync", | |
| "libui", | |
| "libutils", | |
| ], | |
| static_libs: [ | |
| "libbinderthreadstateutils", | |
| ], | |
| header_libs: [ | |
| "libgui_headers", | |
| "libnativebase_headers", | |
| ], | |
| include_dirs: [ | |
| "frameworks/native/include", | |
| ], | |
| export_shared_lib_headers: [ | |
| "libEGL", | |
| "libnativewindow", | |
| "libui", | |
| "android.hardware.graphics.bufferqueue@1.0", | |
| "android.hardware.graphics.bufferqueue@2.0", | |
| "android.hardware.graphics.common@1.1", | |
| "android.hardware.graphics.common@1.2", | |
| "android.hidl.token@1.0-utils", | |
| ], | |
| export_header_lib_headers: [ | |
| "libgui_headers", | |
| ], | |
| export_include_dirs: [ | |
| "include", | |
| ], | |
| } | |
| // GMocks for use by external code | |
| cc_library_static { | |
| name: "libgui_mocks", | |
| vendor_available: false, | |
| defaults: ["libgui_bufferqueue-defaults"], | |
| static_libs: [ | |
| "libgtest", | |
| "libgmock", | |
| "libguiflags", | |
| ], | |
| srcs: [ | |
| ":libgui_frame_event_aidl", | |
| "mock/GraphicBufferConsumer.cpp", | |
| "mock/GraphicBufferProducer.cpp", | |
| ], | |
| } | |
| subdirs = ["tests"] |