diff --git a/ims/Android.bp b/ims/Android.bp index 6604ed0cfa3059425c7a0f0f3734f8fae1611c8f..fff2c4dfbd3a94a20226daf72b2eadbaea2582e6 100644 --- a/ims/Android.bp +++ b/ims/Android.bp @@ -16,7 +16,13 @@ cc_library_shared { name: "libshim_vtservice", srcs: ["libshim_vtservice.cpp"], - shared_libs: ["libaudioclient"], + compile_multilib: "32", + shared_libs: [ + "libaudioclient", + "libgui", + "libstagefright", + "libutils", + ], header_libs: [ "libaudioclient_headers", "libmedia_headers", diff --git a/ims/libshim_vtservice.cpp b/ims/libshim_vtservice.cpp index cdaf6674cc03eda495b7d621139f87f470b21855..b99bac503ae6f0ae1e76cea564d12ac02b61e95a 100644 --- a/ims/libshim_vtservice.cpp +++ b/ims/libshim_vtservice.cpp @@ -1,10 +1,33 @@ +#include #include +#include using namespace android; extern "C" { -// Old constructor without opPackageName + +void _ZN7android10AudioTrackC1E19audio_stream_type_tj14audio_format_t20audio_channel_mask_tj20audio_output_flags_tPFviPvS5_ES5_i15audio_session_tNS0_13transfer_typeEPK20audio_offload_info_tRKNS_7content22AttributionSourceStateEPK18audio_attributes_tbfi( + void* thisptr, + 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, + const AttributionSourceState& attributionSource, + const audio_attributes_t* pAttributes, + bool doNotReconnect, + float maxRequiredSpeed, + audio_port_handle_t selectedDeviceId); + void _ZN7android10AudioTrackC1E19audio_stream_type_tj14audio_format_tjj20audio_output_flags_tPFviPvS4_ES4_i15audio_session_tNS0_13transfer_typeEPK20audio_offload_info_tjiPK18audio_attributes_tbfi( + void* thisptr, audio_stream_type_t streamType, uint32_t sampleRate, audio_format_t format, @@ -23,12 +46,29 @@ void _ZN7android10AudioTrackC1E19audio_stream_type_tj14audio_format_tjj20audio_o 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); - } - - void _ZN7android11AudioSourceC1E14audio_source_tRKNS_8String16Ejjjjii28audio_microphone_direction_tf() {} + AttributionSourceState* attributionSource = new AttributionSourceState(); + attributionSource->uid = uid; + attributionSource->pid = pid; + _ZN7android10AudioTrackC1E19audio_stream_type_tj14audio_format_t20audio_channel_mask_tj20audio_output_flags_tPFviPvS5_ES5_i15audio_session_tNS0_13transfer_typeEPK20audio_offload_info_tRKNS_7content22AttributionSourceStateEPK18audio_attributes_tbfi( + thisptr, streamType, sampleRate, format, channelMask, frameCount, flags, cbf, + user, notificationFrames, sessionId, transferType, offloadInfo, + *attributionSource, pAttributes, + doNotReconnect, maxRequiredSpeed, selectedDeviceId); +} + +void _ZN7android11AudioSourceC1E14audio_source_tRKNS_8String16Ejjjjii28audio_microphone_direction_tf() {} + +void _ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEbRKNS1_INS_7IBinderEEE( + void* thisptr, const sp& bufferProducer, bool controlledByApp, const sp& surfaceControlHandle); + +void _ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEb( + void* thisptr, const sp &bufferProducer, bool controlledByApp) { + _ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEbRKNS1_INS_7IBinderEEE(thisptr, bufferProducer, controlledByApp, nullptr); +} + +void _ZN7android10MediaMuxerC1EiNS_14MediaMuxerBase12OutputFormatE(void* thisptr, int fd, android::MediaMuxer::OutputFormat format); + +void _ZN7android10MediaMuxerC1EiNS0_12OutputFormatE(void* thisptr, int fd, android::MediaMuxer::OutputFormat format) { + _ZN7android10MediaMuxerC1EiNS_14MediaMuxerBase12OutputFormatE(thisptr, fd, format); +} }