1 /* 2 * Copyright 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #define LOG_TAG "misc_fake" 18 19 #include <dlfcn.h> 20 21 #include "osi/include/log.h" 22 #include "service/common/bluetooth/a2dp_codec_config.h" 23 #include "stack/include/a2dp_vendor_ldac.h" 24 bta_av_get_a2dp_current_codec(void)25bluetooth::A2dpCodecConfig* bta_av_get_a2dp_current_codec(void) { 26 return nullptr; 27 } 28 A2DP_VendorGetTrackSampleRateLdac(const uint8_t * p_codec_info)29int A2DP_VendorGetTrackSampleRateLdac(const uint8_t* p_codec_info) { return 0; } A2DP_VendorGetTrackBitsPerSampleLdac(const uint8_t * p_codec_info)30int A2DP_VendorGetTrackBitsPerSampleLdac(const uint8_t* p_codec_info) { 31 return 0; 32 } A2DP_VendorGetChannelModeCodeLdac(const uint8_t * p_codec_info)33int A2DP_VendorGetChannelModeCodeLdac(const uint8_t* p_codec_info) { return 0; } 34 copyOutOtaCodecConfig(unsigned char *)35bool A2dpCodecConfig::copyOutOtaCodecConfig(unsigned char*) { return false; } getAudioBitsPerSample()36uint8_t A2dpCodecConfig::getAudioBitsPerSample() { return 0; } debug_codec_dump(int)37void A2dpCodecConfig::debug_codec_dump(int) {} 38 A2DP_VendorGetTrackSampleRateAptx(unsigned char const *)39int A2DP_VendorGetTrackSampleRateAptx(unsigned char const*) { return 0; } A2DP_VendorGetTrackChannelCountAptx(unsigned char const *)40int A2DP_VendorGetTrackChannelCountAptx(unsigned char const*) { return 0; } 41 A2DP_VendorGetTrackSampleRateAptxHd(unsigned char const *)42int A2DP_VendorGetTrackSampleRateAptxHd(unsigned char const*) { return 0; } A2DP_VendorGetTrackChannelCountAptxHd(unsigned char const *)43int A2DP_VendorGetTrackChannelCountAptxHd(unsigned char const*) { return 0; } 44 A2DP_VendorCodecLoadExternalLib(const std::string & lib_name,const std::string & friendly_name)45void* A2DP_VendorCodecLoadExternalLib(const std::string& lib_name, 46 const std::string& friendly_name) { 47 void* lib_handle = dlopen(lib_name.c_str(), RTLD_NOW); 48 if (lib_handle == NULL) { 49 LOG(ERROR) << __func__ 50 << ": Failed to load codec library: " << friendly_name 51 << ". Err: [" << dlerror() << "]"; 52 return nullptr; 53 } 54 LOG(INFO) << __func__ << ": Codec library loaded: " << friendly_name; 55 return lib_handle; 56 } 57