gta4xl-common: Convert libaudioproxy to soong
Change-Id: I0f92df83a4d6cc042ce2aad04331b0b06669984d
diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index be21ddc..0000000
--- a/Android.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Copyright (C) 2020 The LineageOS 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-ifneq ($(filter gta4xlwifi gta4xl, $(TARGET_DEVICE)),)
-include $(call all-subdir-makefiles,$(LOCAL_PATH))
-endif
diff --git a/audio/Android.mk b/audio/Android.mk
deleted file mode 100644
index fc2a3b2..0000000
--- a/audio/Android.mk
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# Copyright (C) 2023 The LineageOS 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.
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/audio/proxy/Android.bp b/audio/proxy/Android.bp
new file mode 100644
index 0000000..ed60ed2
--- /dev/null
+++ b/audio/proxy/Android.bp
@@ -0,0 +1,99 @@
+// Copyright (C) 2017 The Android Open Source Project
+// Copyright (C) 2024 The LineageOS 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.
+
+soong_config_module_type {
+ name: "audioproxy",
+ module_type: "cc_defaults",
+ config_namespace: "exynos9820AudioVars",
+ bool_variables: [
+ "use_bta2dp_offload",
+ "use_direct_rcvspk_path",
+ "use_soundtrigger_hal",
+ "use_quad_mic",
+ ],
+ properties: [
+ "cflags",
+ "shared_libs",
+ "srcs",
+ ],
+}
+
+audioproxy {
+ name: "audioproxy_defaults",
+ soong_config_variables: {
+ use_bta2dp_offload: {
+ cflags: ["-DSUPPORT_BTA2DP_OFFLOAD"],
+ shared_libs: [
+ "libbase",
+ "libhidlbase",
+ "libhidlmemory",
+ "libhwbinder",
+ "libutils",
+ "android.hidl.allocator@1.0",
+ "android.hidl.memory@1.0",
+ "vendor.samsung_slsi.hardware.ExynosA2DPOffload@1.0",
+ ],
+ srcs: ["audio_a2dp_proxy.cpp"],
+ },
+ use_direct_rcvspk_path: {
+ cflags: ["-DSUPPORT_DIRECT_RCVSPK_PATH"],
+ },
+ use_soundtrigger_hal: {
+ cflags: [
+ "-DSUPPORT_STHAL_INTERFACE",
+ "-DTARGET_SOC_NAME=exynos9611",
+ ],
+ },
+ use_quad_mic: {
+ cflags: ["-DSUPPORT_QUAD_MIC"],
+ },
+ },
+}
+
+cc_library_shared {
+ name: "libaudioproxy",
+ defaults: ["audioproxy_defaults"],
+ vendor: true,
+
+ srcs: [
+ "audio_proxy.c",
+ "audio_usb_proxy.c",
+ ],
+ include_dirs: [
+ "hardware/samsung_slsi-linaro/exynos/include/libaudio/audiohal",
+ "external/tinyalsa/include",
+ "external/tinycompress/include",
+ "external/kernel-headers/original/uapi/sound",
+ "external/expat/lib",
+ ],
+
+ header_libs: ["libhardware_headers"],
+ shared_libs: [
+ "liblog",
+ "libcutils",
+ "libtinyalsa",
+ "libtinycompress",
+ "libaudioutils",
+ "libaudioroute",
+ "libalsautils",
+ "libexpat",
+ ],
+ cflags: [
+ "-Wno-unused-parameter",
+ "-Wno-unused-variable",
+ "-Wno-unused-function",
+ "-DSUPPORT_MCD_FEATURE",
+ ],
+}
diff --git a/audio/proxy/Android.mk b/audio/proxy/Android.mk
deleted file mode 100644
index bfebdaf..0000000
--- a/audio/proxy/Android.mk
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright (C) 2017 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.
-
-LOCAL_PATH := $(call my-dir)
-SOC_BASE_PATH := $(TOP)/hardware/samsung_slsi-linaro/exynos
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := \
- audio_proxy.c \
- audio_usb_proxy.c
-
-LOCAL_C_INCLUDES += \
- $(SOC_BASE_PATH)/include/libaudio/audiohal \
- external/tinyalsa/include \
- external/tinycompress/include \
- external/kernel-headers/original/uapi/sound \
- $(call include-path-for, audio-utils) \
- $(call include-path-for, audio-route) \
- $(call include-path-for, alsa-utils) \
- external/expat/lib
-
-LOCAL_HEADER_LIBRARIES := libhardware_headers
-LOCAL_SHARED_LIBRARIES := liblog libcutils libtinyalsa libtinycompress libaudioutils libaudioroute libalsautils libexpat
-
-# BT A2DP Offload HAL Interface
-ifeq ($(BOARD_USE_BTA2DP_OFFLOAD),true)
-LOCAL_CFLAGS += -DSUPPORT_BTA2DP_OFFLOAD
-LOCAL_SRC_FILES += audio_a2dp_proxy.cpp
-LOCAL_SHARED_LIBRARIES += libbase libhidlbase libhidlmemory libhwbinder libutils android.hidl.allocator@1.0 android.hidl.memory@1.0
-LOCAL_SHARED_LIBRARIES += vendor.samsung_slsi.hardware.ExynosA2DPOffload@1.0
-endif
-
-LOCAL_CFLAGS += -Wno-unused-parameter -Wno-unused-variable -Wno-unused-function
-
-# To use MCD specific definitions
-LOCAL_CFLAGS += -DSUPPORT_MCD_FEATURE
-
-ifeq ($(BOARD_USE_SOUNDTRIGGER_HAL),true)
-LOCAL_CFLAGS += -DSUPPORT_STHAL_INTERFACE
-LOCAL_CFLAGS += -DTARGET_SOC_NAME=$(TARGET_SOC)
-endif
-
-ifeq ($(BOARD_USE_QUAD_MIC),true)
-LOCAL_CFLAGS += -DSUPPORT_QUAD_MIC
-endif
-
-ifeq ($(BOARD_USE_DIRECT_RCVSPK_PATH),true)
-LOCAL_CFLAGS += -DSUPPORT_DIRECT_RCVSPK_PATH
-endif
-
-LOCAL_MODULE := libaudioproxy
-LOCAL_MODULE_TAGS := optional
-
-LOCAL_PROPRIETARY_MODULE := true
-
-include $(BUILD_SHARED_LIBRARY)