android_device_peter_gsi/device.mk
Peter Cai c71693def3 gsi: Initial implementation of sysbta, a system-side bluetooth audio HAL
On platform release T, the legacy `audio.a2dp.default` HAL no longer
exists, and cannot be trivially restored for generic system-side A2DP
audio support. Rather than trying to cling on to its existence (which
does not even work anymore even if one did so), it is time to come up
with a new solution.

This commit introduces a system-side implementation of the generic
bluetooth audio HAL. The HAL itself is modelled after the default
bluetooth audio HAL, while substantial components of the default audio
HAL are also included as it has to also implement the audio HAL
interfaces.

The audio HAL implementation is delegated to `audio.sysbta.default`,
forked from `audio.bluetooth.default` from the Bluetooth apex package.
It then communicates with the bluetooth audio HAL interfaces, which need
to live in the same process (in this case, the process of the sysbta
HAL). This is why we cannot just load `audio.sysbta.default` into the
default audio HAL or the audioserver process directly, but rather have
to include our own simplistic audio HAL implementation.

For now, the audio HAL implementation only includes one for the 6.0
version, but technically, an interface for *every* audio HAL version
needs to exist. This, along with other messiness in the sysbta
implementation, will be addressed in a future commit.

Note that to actually make use of the sysbta audio hal, patches in
frameworks/av and packages/modules/Bluetooth are required to introduce
support for the property `persist.bluetooth.system_audio_hal.enabled`.
2022-08-24 15:47:06 -04:00

73 lines
2.3 KiB
Makefile

# All components inherited here go to system image
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic_system.mk)
# All components inherited here go to system_ext image
$(call inherit-product, $(SRC_TARGET_DIR)/product/handheld_system_ext.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/telephony_system_ext.mk)
$(call inherit-product, device/generic/common/gsi_system_ext.mk)
# All components inherited here go to product image
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_product.mk)
$(call inherit-product, device/generic/common/gsi_product.mk)
# Special settings for GSI releasing
$(call inherit-product, $(SRC_TARGET_DIR)/product/gsi_release.mk)
# This is whitelisted by product name -- unset it
PRODUCT_INSTALL_DEBUG_POLICY_TO_SYSTEM_EXT :=
# Enable dynamically-sized images
PRODUCT_USE_DYNAMIC_PARTITION_SIZE := true
# Soong namespaces
PRODUCT_SOONG_NAMESPACES += device/peter/gsi
# Reuiqred for system-side HALs like sysbta
# TODO: Can we work around this?
SELINUX_IGNORE_NEVERALLOWS := true
# Overlay
PRODUCT_PACKAGES += \
GsiFrameworkResTarget \
GsiLauncher3Target
# Device-specific overlays from phhusson
include vendor/hardware_overlay/overlay.mk
# Init
PRODUCT_PACKAGES += \
init_gsi
# Quirks
include device/peter/gsi/quirks/quirks.mk
# Euicc -- enabled by default, won't work without eSIM slot definition anyway
PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.telephony.euicc.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.hardware.telephony.euicc.xml
PRODUCT_PACKAGES += \
OpenEUICC
# vendor/foss
include vendor/foss/foss.mk
# Launcher3
PRODUCT_PACKAGES += \
Launcher3QuickStep \
ThemePicker
# Bluetooth Audio (System-side HAL, sysbta)
PRODUCT_PACKAGES += \
audio.sysbta.default \
android.hardware.bluetooth.audio-service-system
PRODUCT_COPY_FILES += \
device/peter/gsi/bluetooth/audio/config/sysbta_audio_policy_configuration.xml:$(TARGET_COPY_OUT_SYSTEM)/etc/sysbta_audio_policy_configuration.xml \
device/peter/gsi/bluetooth/audio/config/sysbta_audio_policy_configuration_7_0.xml:$(TARGET_COPY_OUTY_SYSTEM)/etc/sysbta_audio_policy_configuration_7_0.xml
# Enable ro.adb.secure on userdebug and user
ifeq (,$(filter eng,$(TARGET_BUILD_VARIANT)))
PRODUCT_SYSTEM_EXT_PROPERTIES += \
ro.adb.secure=1
endif