package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "hardware_interfaces_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["hardware_interfaces_license"],
}

filegroup {
    name: "android.hardware.audio-impl_srcs",
    srcs: [
        "Device.cpp",
        "DevicesFactory.cpp",
        "ParametersUtil.cpp",
        "PrimaryDevice.cpp",
        "Stream.cpp",
        "StreamIn.cpp",
        "StreamOut.cpp",
    ],
}

cc_library_headers {
    name: "android.hardware.audio-impl_headers",
    proprietary: true,
    vendor: true,
    export_include_dirs: ["include"],
}

cc_defaults {
    name: "android.hardware.audio-impl_default",
    relative_install_path: "hw",
    proprietary: true,
    vendor: true,
    srcs: [":android.hardware.audio-impl_srcs"],

    defaults: ["hidl_defaults"],

    static_libs: [
        "libaudiofoundation",
    ],

    shared_libs: [
        "libbase",
        "libcutils",
        "libfmq",
        "libhardware",
        "libhidlbase",
        "liblog",
        "libmedia_helper",
        "libutils",
        "android.hardware.audio.common-util",
    ],

    header_libs: [
        "android.hardware.audio-impl_headers",
        "android.hardware.audio.common.util@all-versions",
        "libaudioutils_headers",
        "libaudio_system_headers",
        "libhardware_headers",
        "libmedia_headers",
        "libmediautils_headers",
    ],

    export_header_lib_headers: [
        "android.hardware.audio-impl_headers",
    ],
}

cc_library_shared {
    name: "android.hardware.audio@2.0-impl",
    defaults: ["android.hardware.audio-impl_default"],
    shared_libs: [
        "android.hardware.audio@2.0",
        "android.hardware.audio@2.0-util",
        "android.hardware.audio.common@2.0",
        "android.hardware.audio.common@2.0-util",
    ],
    cflags: [
        "-DMAJOR_VERSION=2",
        "-DMINOR_VERSION=0",
        "-include common/all-versions/VersionMacro.h",
    ],
}

cc_library_shared {
    name: "android.hardware.audio@4.0-impl",
    defaults: ["android.hardware.audio-impl_default"],

    shared_libs: [
        "android.hardware.audio@4.0",
        "android.hardware.audio@4.0-util",
        "android.hardware.audio.common@4.0",
        "android.hardware.audio.common@4.0-util",
    ],
    cflags: [
        "-DMAJOR_VERSION=4",
        "-DMINOR_VERSION=0",
        "-include common/all-versions/VersionMacro.h",
    ],
}

cc_library_shared {
    name: "android.hardware.audio@5.0-impl",
    defaults: ["android.hardware.audio-impl_default"],
    shared_libs: [
        "android.hardware.audio@5.0",
        "android.hardware.audio@5.0-util",
        "android.hardware.audio.common@5.0",
        "android.hardware.audio.common@5.0-util",
    ],
    cflags: [
        "-DMAJOR_VERSION=5",
        "-DMINOR_VERSION=0",
        "-include common/all-versions/VersionMacro.h",
    ],
}

cc_defaults {
    name: "android.hardware.audio@6.0-impl_default",
    defaults: ["android.hardware.audio-impl_default"],
    shared_libs: [
        "android.hardware.audio@6.0",
        "android.hardware.audio@6.0-util",
        "android.hardware.audio.common@6.0",
        "android.hardware.audio.common@6.0-util",
    ],
    cflags: [
        "-DMAJOR_VERSION=6",
        "-DMINOR_VERSION=0",
        "-include common/all-versions/VersionMacro.h",
    ],
}

cc_library_shared {
    name: "android.hardware.audio@6.0-impl",
    defaults: ["android.hardware.audio@6.0-impl_default"],
}

cc_defaults {
    name: "android.hardware.audio@7.0-impl_default",
    defaults: ["android.hardware.audio-impl_default"],
    shared_libs: [
        "android.hardware.audio@7.0",
        "android.hardware.audio@7.0-util",
        "android.hardware.audio.common@7.0",
        "android.hardware.audio.common@7.0-enums",
        "android.hardware.audio.common@7.0-util",
        "libbase",
    ],
    cflags: [
        "-DMAJOR_VERSION=7",
        "-DMINOR_VERSION=0",
        "-include common/all-versions/VersionMacro.h",
    ],
}

cc_library_shared {
    name: "android.hardware.audio@7.0-impl",
    defaults: ["android.hardware.audio@7.0-impl_default"],
}
