audio: clean up makefiles

* Restructure to remove dependencies elsewhere in the AOSP tree, move APEX
  definition from subdirectory, 'bpfmt -s -w Andoid.bp', etc.
* Remove package license definitions that are not visible in this context.
This commit is contained in:
Konsta
2025-10-22 18:34:31 +03:00
parent 375a38c961
commit a0f3530f2e
8 changed files with 85 additions and 204 deletions

View File

@@ -1,34 +1,35 @@
package { // Copyright (C) 2022 The Android Open Source Project
default_team: "trendy_team_android_media_audio_framework", // Copyright (C) 2025 KonstaKANG
// See: http://go/android-license-faq //
// A large-scale-change added 'default_applicable_licenses' to import // SPDX-License-Identifier: Apache-2.0
// 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"],
}
cc_defaults { cc_defaults {
name: "aidlaudioservice_rpi_defaults", name: "aidlaudioservice_rpi_defaults",
vendor: true, vendor: true,
shared_libs: [ shared_libs: [
"android.hardware.audio.core-V3-ndk",
"android.hardware.audio.core.sounddose-V3-ndk",
"android.hardware.bluetooth.audio-V5-ndk",
"android.hardware.bluetooth.audio-impl",
"android.hardware.common-V2-ndk",
"android.hardware.common.fmq-V1-ndk",
"android.media.audio.common.types-V4-ndk",
"libalsautilsv2-rpi", "libalsautilsv2-rpi",
"libaudio_aidl_conversion_common_ndk", "libaudio_aidl_conversion_common_ndk",
"libaudioaidlcommon", "libaudioaidlcommon",
"libaudioutils", "libaudioutils",
"libbase", "libbase",
"libbinder_ndk", "libbinder_ndk",
"libbluetooth_audio_session_aidl",
"libcutils", "libcutils",
"libfmq", "libfmq",
"libnbaio_mono",
"liblog", "liblog",
"libmedia_helper", "libmedia_helper",
"libnbaio_mono",
"libstagefright_foundation", "libstagefright_foundation",
"libtinyalsav2", "libtinyalsav2",
"libutils", "libutils",
"libxml2", "libxml2",
"android.hardware.common-V2-ndk",
"android.hardware.common.fmq-V1-ndk",
], ],
header_libs: [ header_libs: [
"libaudio_system_headers", "libaudio_system_headers",
@@ -37,18 +38,16 @@ cc_defaults {
], ],
cflags: [ cflags: [
"-DBACKEND_NDK", "-DBACKEND_NDK",
"-Wall",
"-Werror",
"-Wextra",
"-Wthread-safety",
], ],
} }
cc_library { cc_library {
name: "libaudioserviceimpl-rpi", name: "libaudioserviceimpl-rpi",
defaults: [ defaults: ["aidlaudioservice_rpi_defaults"],
"aidlaudioservice_rpi_defaults",
"latest_android_media_audio_common_types_ndk_shared",
"latest_android_hardware_audio_core_ndk_shared",
"latest_android_hardware_audio_core_sounddose_ndk_shared",
"latest_android_hardware_bluetooth_audio_ndk_shared",
],
export_include_dirs: ["include"], export_include_dirs: ["include"],
srcs: [ srcs: [
"AidlConversionXsdc.cpp", "AidlConversionXsdc.cpp",
@@ -75,8 +74,8 @@ cc_library {
"primary/PrimaryMixer.cpp", "primary/PrimaryMixer.cpp",
"primary/StreamPrimary.cpp", "primary/StreamPrimary.cpp",
"r_submix/ModuleRemoteSubmix.cpp", "r_submix/ModuleRemoteSubmix.cpp",
"r_submix/SubmixRoute.cpp",
"r_submix/StreamRemoteSubmix.cpp", "r_submix/StreamRemoteSubmix.cpp",
"r_submix/SubmixRoute.cpp",
"stub/ApeHeader.cpp", "stub/ApeHeader.cpp",
"stub/DriverStubImpl.cpp", "stub/DriverStubImpl.cpp",
"stub/ModuleStub.cpp", "stub/ModuleStub.cpp",
@@ -103,49 +102,22 @@ cc_library {
"audio_policy_engine_configuration_aidl_rpi", "audio_policy_engine_configuration_aidl_rpi",
], ],
shared_libs: [ shared_libs: [
"android.hardware.bluetooth.audio-impl",
"libaudio_aidl_conversion_common_ndk",
"libaudioutils",
"libbluetooth_audio_session_aidl",
"liblog",
"libmedia_helper",
"libmediautils_vendor", "libmediautils_vendor",
"libstagefright_foundation",
], ],
export_shared_lib_headers: [ export_shared_lib_headers: [
"libaudio_aidl_conversion_common_ndk", "libaudio_aidl_conversion_common_ndk",
], ],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
"-Wthread-safety",
"-DBACKEND_NDK",
],
} }
cc_library { cc_library {
name: "libeffectconfig-rpi", name: "libeffectconfig-rpi",
defaults: ["aidlaudioeffectservice_rpi_defaults"],
srcs: [ srcs: [
"EffectConfig.cpp", "EffectConfig.cpp",
], ],
defaults: [
"latest_android_hardware_audio_effect_ndk_shared",
"latest_android_media_audio_common_types_ndk_shared",
],
shared_libs: [ shared_libs: [
"libaudioutils",
"libaudio_aidl_conversion_common_ndk",
"libbase",
"libbinder_ndk",
"liblog",
"libmedia_helper", "libmedia_helper",
"libtinyxml2", "libtinyxml2",
"libutils",
],
header_libs: [
"libaudio_system_headers",
"libaudioaidl_rpi_headers",
], ],
export_shared_lib_headers: [ export_shared_lib_headers: [
"libtinyxml2", "libtinyxml2",
@@ -153,86 +125,42 @@ cc_library {
export_include_dirs: [ export_include_dirs: [
"include", "include",
], ],
cflags: [
"-Wall",
"-Wextra",
"-Werror",
"-DBACKEND_NDK",
],
vendor: true,
host_supported: true,
target: {
android: {
shared_libs: [
"libapexsupport",
],
},
},
} }
cc_binary { cc_binary {
name: "android.hardware.audio.service.rpi", name: "android.hardware.audio.service.rpi",
relative_install_path: "hw", relative_install_path: "hw",
defaults: [ defaults: ["aidlaudioservice_rpi_defaults"],
"aidlaudioservice_rpi_defaults",
"latest_android_hardware_audio_core_sounddose_ndk_shared",
"latest_android_hardware_audio_core_ndk_shared",
"latest_android_hardware_bluetooth_audio_ndk_shared",
"latest_android_media_audio_common_types_ndk_shared",
],
static_libs: [ static_libs: [
"libaudioserviceimpl-rpi", "libaudioserviceimpl-rpi",
], ],
shared_libs: [
"android.hardware.bluetooth.audio-impl",
"libaudio_aidl_conversion_common_ndk",
"libbluetooth_audio_session_aidl",
"liblog",
"libmedia_helper",
"libstagefright_foundation",
],
srcs: ["main.cpp"], srcs: ["main.cpp"],
cflags: [ installable: false,
"-Wall",
"-Wextra",
"-Werror",
"-Wthread-safety",
"-DBACKEND_NDK",
],
installable: false, //installed in apex com.android.hardware.audio.rpi5
} }
cc_defaults { cc_defaults {
name: "aidlaudioeffectservice_rpi_defaults", name: "aidlaudioeffectservice_rpi_defaults",
defaults: [
"latest_android_media_audio_common_types_ndk_shared",
"latest_android_hardware_audio_effect_ndk_shared",
],
vendor: true, vendor: true,
shared_libs: [ shared_libs: [
"android.hardware.audio.effect-V3-ndk",
"android.media.audio.common.types-V4-ndk",
"libapexsupport",
"libaudio_aidl_conversion_common_ndk", "libaudio_aidl_conversion_common_ndk",
"libaudioaidlcommon",
"libaudioutils", "libaudioutils",
"libbase", "libbase",
"libbinder_ndk", "libbinder_ndk",
"libcutils",
"libfmq",
"liblog", "liblog",
"libutils", "libutils",
"android.hardware.common-V2-ndk",
"android.hardware.common.fmq-V1-ndk",
], ],
header_libs: [ header_libs: [
"libaudioaidl_rpi_headers",
"libaudio_system_headers", "libaudio_system_headers",
"libsystem_headers", "libaudioaidl_rpi_headers",
], ],
cflags: [ cflags: [
"-Wall",
"-Wextra",
"-Werror",
"-Wthread-safety",
"-DBACKEND_NDK", "-DBACKEND_NDK",
"-Wall",
"-Werror",
"-Wextra",
], ],
} }
@@ -241,21 +169,30 @@ cc_binary {
relative_install_path: "hw", relative_install_path: "hw",
defaults: ["aidlaudioeffectservice_rpi_defaults"], defaults: ["aidlaudioeffectservice_rpi_defaults"],
shared_libs: [ shared_libs: [
"libapexsupport", "android.hardware.common-V2-ndk",
"android.hardware.common.fmq-V1-ndk",
"libaudioaidlcommon",
"libcutils",
"libeffectconfig-rpi", "libeffectconfig-rpi",
"libfmq",
],
header_libs: [
"libsystem_headers",
], ],
srcs: [ srcs: [
"EffectFactory.cpp", "EffectFactory.cpp",
"EffectMain.cpp", "EffectMain.cpp",
], ],
installable: false, //installed in apex com.android.hardware.audio.rpi5 cflags: [
"-Wthread-safety",
],
installable: false,
} }
cc_library_headers { cc_library_headers {
name: "libaudioaidl_rpi_headers", name: "libaudioaidl_rpi_headers",
export_include_dirs: ["include"], export_include_dirs: ["include"],
vendor_available: true, vendor_available: true,
host_supported: true,
} }
prebuilt_etc { prebuilt_etc {
@@ -270,3 +207,30 @@ prebuilt_etc {
sub_dir: "vintf", sub_dir: "vintf",
installable: false, installable: false,
} }
apex {
name: "com.android.hardware.audio.rpi5",
manifest: "manifest.json",
file_contexts: "file_contexts",
key: "com.android.hardware.key",
certificate: ":com.android.hardware.certificate",
updatable: false,
vendor: true,
binaries: [
"android.hardware.audio.effect.service.rpi",
"android.hardware.audio.service.rpi",
],
prebuilts: [
"android.hardware.audio.service.rpi.rc",
"android.hardware.audio.service.rpi.xml",
"android.hardware.bluetooth.audio.xml",
],
required: [
"aidl_audio_set_configurations_bfbs",
"aidl_audio_set_scenarios_bfbs",
"aidl_default_audio_set_configurations_json",
"aidl_default_audio_set_scenarios_json",
"hfp_codec_capabilities_xml",
],
}

View File

@@ -1,27 +1,10 @@
// Copyright (C) 2015 The Android Open Source Project // Copyright (C) 2015 The Android Open Source Project
// Copyright (C) 2025 KonstaKANG
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // SPDX-License-Identifier: Apache-2.0
// 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 { cc_library {
// http://go/android-license-faq name: "libalsautilsv2-rpi",
// A large-scale-change added 'default_applicable_licenses' to import
// the below license kinds from "system_media_license":
// SPDX-license-identifier-Apache-2.0
default_applicable_licenses: ["system_media_license"],
}
cc_defaults {
name: "libalsautils_rpi_defaults",
vendor_available: true, vendor_available: true,
srcs: [ srcs: [
"alsa_device_profile.c", "alsa_device_profile.c",
@@ -40,6 +23,7 @@ cc_defaults {
"libaudioutils", "libaudioutils",
"libcutils", "libcutils",
"liblog", "liblog",
"libtinyalsav2",
], ],
cflags: [ cflags: [
"-Wall", "-Wall",
@@ -47,19 +31,3 @@ cc_defaults {
"-Wno-unused-parameter", "-Wno-unused-parameter",
], ],
} }
cc_library {
name: "libalsautils-rpi",
defaults: ["libalsautils_rpi_defaults"],
shared_libs: [
"libtinyalsa",
],
}
cc_library {
name: "libalsautilsv2-rpi",
defaults: ["libalsautils_rpi_defaults"],
shared_libs: [
"libtinyalsav2",
],
}

View File

@@ -1,36 +0,0 @@
package {
default_team: "trendy_team_android_media_audio_framework",
// 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"],
}
apex {
name: "com.android.hardware.audio.rpi5",
manifest: "manifest.json",
file_contexts: "file_contexts",
key: "com.android.hardware.key",
certificate: ":com.android.hardware.certificate",
updatable: false,
vendor: true,
binaries: [
"android.hardware.audio.service.rpi",
"android.hardware.audio.effect.service.rpi",
],
prebuilts: [
"android.hardware.audio.service.rpi.rc",
"android.hardware.audio.service.rpi.xml",
"android.hardware.bluetooth.audio.xml",
],
required: [
"aidl_audio_set_configurations_bfbs",
"aidl_default_audio_set_configurations_json",
"aidl_audio_set_scenarios_bfbs",
"aidl_default_audio_set_scenarios_json",
"hfp_codec_capabilities_xml",
],
}

View File

@@ -1,12 +1,7 @@
package { // Copyright (C) 2022 The Android Open Source Project
default_team: "trendy_team_android_media_audio_framework", // Copyright (C) 2025 KonstaKANG
// See: http://go/android-license-faq //
// A large-scale-change added 'default_applicable_licenses' to import // SPDX-License-Identifier: Apache-2.0
// 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"],
}
xsd_config { xsd_config {
name: "audio_policy_configuration_aidl_rpi", name: "audio_policy_configuration_aidl_rpi",

View File

@@ -1,12 +1,7 @@
package { // Copyright (C) 2022 The Android Open Source Project
default_team: "trendy_team_android_media_audio_framework", // Copyright (C) 2025 KonstaKANG
// See: http://go/android-license-faq //
// A large-scale-change added 'default_applicable_licenses' to import // SPDX-License-Identifier: Apache-2.0
// 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"],
}
xsd_config { xsd_config {
name: "audio_policy_capengine_configuration_aidl_rpi", name: "audio_policy_capengine_configuration_aidl_rpi",

View File

@@ -1,12 +1,7 @@
package { // Copyright (C) 2022 The Android Open Source Project
default_team: "trendy_team_android_media_audio_framework", // Copyright (C) 2025 KonstaKANG
// See: http://go/android-license-faq //
// A large-scale-change added 'default_applicable_licenses' to import // SPDX-License-Identifier: Apache-2.0
// 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"],
}
xsd_config { xsd_config {
name: "audio_policy_engine_configuration_aidl_rpi", name: "audio_policy_engine_configuration_aidl_rpi",