mirror of
https://github.com/Evolution-X-Devices/device_xiaomi_rosemary
synced 2026-01-27 13:35:09 +00:00
rosemary: Provide a shim for libsink
added opPackageName as a parameter to the constructor of AudioTrack which breaks our libsink which was compiled for an older libaudioclient. * fixes the following error: CANNOT LINK EXECUTABLE "/system/bin/vtservice": cannot locate symbol "_ZN7android10AudioTrackC1E19audio_stream_type_tj14audio_format_tjj20audio_output_flags_tPFviPvS4_ES4_i15audio_session_tNS0_13transfer_typeEPK20audio_offload_info_tjiPK18audio_attributes_tbfi" referenced by "/system/lib/libsink.so" https: //github.com/LineageOS/android_frameworks_av/commit/fd90fdfe2a611ae824a32e236da288b1fdfd445d Change-Id: I290e1beca02d46c4393d17356fa22741d771f847
This commit is contained in:
@@ -185,6 +185,9 @@ PRODUCT_BOOT_JARS += \
|
||||
mediatek-telephony-base \
|
||||
mediatek-telephony-common
|
||||
|
||||
PRODUCT_PACKAGES += \
|
||||
libshim_vtservice
|
||||
|
||||
# IR
|
||||
PRODUCT_PACKAGES += \
|
||||
android.hardware.ir@1.0-impl \
|
||||
|
||||
@@ -67,6 +67,9 @@ function blob_fixup {
|
||||
lib/libshowlogo.so)
|
||||
"${PATCHELF}" --add-needed "libshim_showlogo.so" "${2}"
|
||||
;;
|
||||
lib/libsink.so)
|
||||
"${PATCHELF}" --add-needed "libshim_vtservice.so" "${2}"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
||||
@@ -38,3 +38,14 @@ cc_library_shared {
|
||||
],
|
||||
local_include_dirs: ["include"]
|
||||
}
|
||||
|
||||
cc_library_shared {
|
||||
name: "libshim_vtservice",
|
||||
srcs: ["libshim_vtservice.cpp"],
|
||||
shared_libs: ["libaudioclient"],
|
||||
header_libs: [
|
||||
"libaudioclient_headers",
|
||||
"libmedia_headers",
|
||||
"libmediametrics_headers",
|
||||
],
|
||||
}
|
||||
|
||||
32
libshims/libshim_vtservice.cpp
Normal file
32
libshims/libshim_vtservice.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <media/AudioTrack.h>
|
||||
|
||||
using namespace android;
|
||||
|
||||
extern "C" {
|
||||
// Old constructor without opPackageName
|
||||
void _ZN7android10AudioTrackC1E19audio_stream_type_tj14audio_format_tjj20audio_output_flags_tPFviPvS4_ES4_i15audio_session_tNS0_13transfer_typeEPK20audio_offload_info_tjiPK18audio_attributes_tbfi(
|
||||
audio_stream_type_t streamType,
|
||||
uint32_t sampleRate,
|
||||
audio_format_t format,
|
||||
audio_channel_mask_t channelMask,
|
||||
size_t frameCount,
|
||||
audio_output_flags_t flags,
|
||||
android::AudioTrack::callback_t cbf,
|
||||
void* user,
|
||||
int32_t notificationFrames,
|
||||
audio_session_t sessionId,
|
||||
android::AudioTrack::transfer_type transferType,
|
||||
const audio_offload_info_t *offloadInfo,
|
||||
uid_t uid,
|
||||
pid_t pid,
|
||||
const audio_attributes_t* pAttributes,
|
||||
bool doNotReconnect,
|
||||
float maxRequiredSpeed,
|
||||
audio_port_handle_t selectedDeviceId) {
|
||||
const std::string& opPackageName = "com.mediatek.ims";
|
||||
new android::AudioTrack(streamType, sampleRate, format, channelMask, frameCount, flags, cbf,
|
||||
user, notificationFrames, sessionId, transferType, offloadInfo, uid,
|
||||
pid, pAttributes, doNotReconnect, maxRequiredSpeed, selectedDeviceId,
|
||||
opPackageName);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user