mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge changes Iab6235b5,I19b7d1af,I1806d8a2,I8589ef14 into main am: 61ef14ec09 am: bf0c331d59
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2901010 Change-Id: I619e123f5721004b342ca27937eef5d5642c1913 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -736,8 +736,7 @@ TEST_P(BluetoothAudioProviderFactoryAidl, getProviderInfo_leAudioSessionTypes) {
|
|||||||
ASSERT_NE(codec_info.id.getTag(), CodecId::a2dp);
|
ASSERT_NE(codec_info.id.getTag(), CodecId::a2dp);
|
||||||
// The codec info must contain the information
|
// The codec info must contain the information
|
||||||
// for le audio transport.
|
// for le audio transport.
|
||||||
// ASSERT_EQ(codec_info.transport.getTag(),
|
ASSERT_EQ(codec_info.transport.getTag(), CodecInfo::Transport::leAudio);
|
||||||
// CodecInfo::Transport::le_audio);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1664,7 +1663,7 @@ TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
||||||
StartAndEndA2dpSbcEncodingHardwareSession) {
|
StartAndEndA2dpSbcEncodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
CodecConfiguration codec_config = {
|
CodecConfiguration codec_config = {
|
||||||
@@ -1694,7 +1693,7 @@ TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
||||||
StartAndEndA2dpAacEncodingHardwareSession) {
|
StartAndEndA2dpAacEncodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
CodecConfiguration codec_config = {
|
CodecConfiguration codec_config = {
|
||||||
@@ -1724,7 +1723,7 @@ TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
||||||
StartAndEndA2dpLdacEncodingHardwareSession) {
|
StartAndEndA2dpLdacEncodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
CodecConfiguration codec_config = {
|
CodecConfiguration codec_config = {
|
||||||
@@ -1754,7 +1753,7 @@ TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
||||||
StartAndEndA2dpOpusEncodingHardwareSession) {
|
StartAndEndA2dpOpusEncodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
CodecConfiguration codec_config = {
|
CodecConfiguration codec_config = {
|
||||||
@@ -1784,7 +1783,7 @@ TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
||||||
StartAndEndA2dpAptxEncodingHardwareSession) {
|
StartAndEndA2dpAptxEncodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto codec_type : {CodecType::APTX, CodecType::APTX_HD}) {
|
for (auto codec_type : {CodecType::APTX, CodecType::APTX_HD}) {
|
||||||
@@ -1820,7 +1819,7 @@ TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpEncodingHardwareAidl,
|
||||||
StartAndEndA2dpEncodingHardwareSessionInvalidCodecConfig) {
|
StartAndEndA2dpEncodingHardwareSessionInvalidCodecConfig) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
ASSERT_NE(audio_provider_, nullptr);
|
ASSERT_NE(audio_provider_, nullptr);
|
||||||
|
|
||||||
@@ -2420,7 +2419,7 @@ TEST_P(
|
|||||||
BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
||||||
StartAndEndLeAudioOutputSessionWithPossibleUnicastConfigFromProviderInfo) {
|
StartAndEndLeAudioOutputSessionWithPossibleUnicastConfigFromProviderInfo) {
|
||||||
if (!IsOffloadOutputProviderInfoSupported()) {
|
if (!IsOffloadOutputProviderInfoSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lc3_codec_configs = GetUnicastLc3SupportedListFromProviderInfo();
|
auto lc3_codec_configs = GetUnicastLc3SupportedListFromProviderInfo();
|
||||||
@@ -2548,7 +2547,7 @@ TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
||||||
StartAndEndLeAudioOutputSessionWithPossibleUnicastConfig) {
|
StartAndEndLeAudioOutputSessionWithPossibleUnicastConfig) {
|
||||||
if (!IsOffloadOutputSupported()) {
|
if (!IsOffloadOutputSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lc3_codec_configs =
|
auto lc3_codec_configs =
|
||||||
@@ -2581,7 +2580,7 @@ TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
||||||
DISABLED_StartAndEndLeAudioOutputSessionWithInvalidAudioConfiguration) {
|
DISABLED_StartAndEndLeAudioOutputSessionWithInvalidAudioConfiguration) {
|
||||||
if (!IsOffloadOutputSupported()) {
|
if (!IsOffloadOutputSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lc3_codec_configs =
|
auto lc3_codec_configs =
|
||||||
@@ -2619,7 +2618,7 @@ static std::vector<uint8_t> vendorMetadata = {0x0B, // Length
|
|||||||
TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
||||||
StartAndEndLeAudioOutputSessionWithAptxAdaptiveLeUnicastConfig) {
|
StartAndEndLeAudioOutputSessionWithAptxAdaptiveLeUnicastConfig) {
|
||||||
if (!IsOffloadOutputSupported()) {
|
if (!IsOffloadOutputSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
for (auto codec_type :
|
for (auto codec_type :
|
||||||
{CodecType::APTX_ADAPTIVE_LE, CodecType::APTX_ADAPTIVE_LEX}) {
|
{CodecType::APTX_ADAPTIVE_LE, CodecType::APTX_ADAPTIVE_LEX}) {
|
||||||
@@ -2656,7 +2655,7 @@ TEST_P(
|
|||||||
BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
BluetoothAudioProviderLeAudioOutputHardwareAidl,
|
||||||
BluetoothAudioProviderLeAudioOutputHardwareAidl_StartAndEndLeAudioOutputSessionWithInvalidAptxAdaptiveLeAudioConfiguration) {
|
BluetoothAudioProviderLeAudioOutputHardwareAidl_StartAndEndLeAudioOutputSessionWithInvalidAptxAdaptiveLeAudioConfiguration) {
|
||||||
if (!IsOffloadOutputSupported()) {
|
if (!IsOffloadOutputSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto codec_type :
|
for (auto codec_type :
|
||||||
@@ -2742,7 +2741,7 @@ TEST_P(
|
|||||||
BluetoothAudioProviderLeAudioInputHardwareAidl,
|
BluetoothAudioProviderLeAudioInputHardwareAidl,
|
||||||
StartAndEndLeAudioInputSessionWithPossibleUnicastConfigFromProviderInfo) {
|
StartAndEndLeAudioInputSessionWithPossibleUnicastConfigFromProviderInfo) {
|
||||||
if (!IsOffloadOutputProviderInfoSupported()) {
|
if (!IsOffloadOutputProviderInfoSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lc3_codec_configs = GetUnicastLc3SupportedListFromProviderInfo();
|
auto lc3_codec_configs = GetUnicastLc3SupportedListFromProviderInfo();
|
||||||
@@ -2772,7 +2771,7 @@ TEST_P(
|
|||||||
TEST_P(BluetoothAudioProviderLeAudioInputHardwareAidl,
|
TEST_P(BluetoothAudioProviderLeAudioInputHardwareAidl,
|
||||||
StartAndEndLeAudioInputSessionWithPossibleUnicastConfig) {
|
StartAndEndLeAudioInputSessionWithPossibleUnicastConfig) {
|
||||||
if (!IsOffloadInputSupported()) {
|
if (!IsOffloadInputSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lc3_codec_configs =
|
auto lc3_codec_configs =
|
||||||
@@ -2805,7 +2804,7 @@ TEST_P(BluetoothAudioProviderLeAudioInputHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderLeAudioInputHardwareAidl,
|
TEST_P(BluetoothAudioProviderLeAudioInputHardwareAidl,
|
||||||
DISABLED_StartAndEndLeAudioInputSessionWithInvalidAudioConfiguration) {
|
DISABLED_StartAndEndLeAudioInputSessionWithInvalidAudioConfiguration) {
|
||||||
if (!IsOffloadInputSupported()) {
|
if (!IsOffloadInputSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto lc3_codec_configs =
|
auto lc3_codec_configs =
|
||||||
@@ -3259,7 +3258,7 @@ TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
||||||
StartAndEndA2dpSbcDecodingHardwareSession) {
|
StartAndEndA2dpSbcDecodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
CodecConfiguration codec_config = {
|
CodecConfiguration codec_config = {
|
||||||
@@ -3289,7 +3288,7 @@ TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
||||||
StartAndEndA2dpAacDecodingHardwareSession) {
|
StartAndEndA2dpAacDecodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
CodecConfiguration codec_config = {
|
CodecConfiguration codec_config = {
|
||||||
@@ -3319,7 +3318,7 @@ TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
||||||
StartAndEndA2dpLdacDecodingHardwareSession) {
|
StartAndEndA2dpLdacDecodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
CodecConfiguration codec_config = {
|
CodecConfiguration codec_config = {
|
||||||
@@ -3349,7 +3348,7 @@ TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
||||||
StartAndEndA2dpOpusDecodingHardwareSession) {
|
StartAndEndA2dpOpusDecodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
CodecConfiguration codec_config = {
|
CodecConfiguration codec_config = {
|
||||||
@@ -3379,7 +3378,7 @@ TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
||||||
StartAndEndA2dpAptxDecodingHardwareSession) {
|
StartAndEndA2dpAptxDecodingHardwareSession) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto codec_type : {CodecType::APTX, CodecType::APTX_HD}) {
|
for (auto codec_type : {CodecType::APTX, CodecType::APTX_HD}) {
|
||||||
@@ -3415,7 +3414,7 @@ TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
|||||||
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
TEST_P(BluetoothAudioProviderA2dpDecodingHardwareAidl,
|
||||||
StartAndEndA2dpDecodingHardwareSessionInvalidCodecConfig) {
|
StartAndEndA2dpDecodingHardwareSessionInvalidCodecConfig) {
|
||||||
if (!IsOffloadSupported()) {
|
if (!IsOffloadSupported()) {
|
||||||
return;
|
GTEST_SKIP();
|
||||||
}
|
}
|
||||||
ASSERT_NE(audio_provider_, nullptr);
|
ASSERT_NE(audio_provider_, nullptr);
|
||||||
|
|
||||||
|
|||||||
@@ -428,7 +428,7 @@ std::vector<CodecInfo> BluetoothAudioCodecs::GetLeAudioOffloadCodecInfo(
|
|||||||
if (kDefaultOffloadLeAudioCodecInfoMap.empty()) {
|
if (kDefaultOffloadLeAudioCodecInfoMap.empty()) {
|
||||||
auto le_audio_offload_setting =
|
auto le_audio_offload_setting =
|
||||||
BluetoothLeAudioCodecsProvider::ParseFromLeAudioOffloadSettingFile();
|
BluetoothLeAudioCodecsProvider::ParseFromLeAudioOffloadSettingFile();
|
||||||
auto kDefaultOffloadLeAudioCodecInfoMap =
|
kDefaultOffloadLeAudioCodecInfoMap =
|
||||||
BluetoothLeAudioCodecsProvider::GetLeAudioCodecInfo(
|
BluetoothLeAudioCodecsProvider::GetLeAudioCodecInfo(
|
||||||
le_audio_offload_setting);
|
le_audio_offload_setting);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,9 +43,6 @@ static bool isInvalidFileContent = false;
|
|||||||
|
|
||||||
std::optional<setting::LeAudioOffloadSetting>
|
std::optional<setting::LeAudioOffloadSetting>
|
||||||
BluetoothLeAudioCodecsProvider::ParseFromLeAudioOffloadSettingFile() {
|
BluetoothLeAudioCodecsProvider::ParseFromLeAudioOffloadSettingFile() {
|
||||||
if (!leAudioCodecCapabilities.empty() || isInvalidFileContent) {
|
|
||||||
return std::nullopt;
|
|
||||||
}
|
|
||||||
auto le_audio_offload_setting =
|
auto le_audio_offload_setting =
|
||||||
setting::readLeAudioOffloadSetting(kLeAudioCodecCapabilitiesFile);
|
setting::readLeAudioOffloadSetting(kLeAudioCodecCapabilitiesFile);
|
||||||
if (!le_audio_offload_setting.has_value()) {
|
if (!le_audio_offload_setting.has_value()) {
|
||||||
@@ -77,8 +74,6 @@ BluetoothLeAudioCodecsProvider::GetLeAudioCodecInfo(
|
|||||||
for (auto& p : configuration_map_) {
|
for (auto& p : configuration_map_) {
|
||||||
// Initialize new CodecInfo for the config
|
// Initialize new CodecInfo for the config
|
||||||
auto config_name = p.first;
|
auto config_name = p.first;
|
||||||
if (config_codec_info_map_.count(config_name) == 0)
|
|
||||||
config_codec_info_map_[config_name] = CodecInfo();
|
|
||||||
|
|
||||||
// Getting informations from codecConfig and strategyConfig
|
// Getting informations from codecConfig and strategyConfig
|
||||||
const auto codec_config_name = p.second.getCodecConfiguration();
|
const auto codec_config_name = p.second.getCodecConfiguration();
|
||||||
@@ -92,6 +87,9 @@ BluetoothLeAudioCodecsProvider::GetLeAudioCodecInfo(
|
|||||||
if (strategy_configuration_map_iter == strategy_configuration_map_.end())
|
if (strategy_configuration_map_iter == strategy_configuration_map_.end())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (config_codec_info_map_.count(config_name) == 0)
|
||||||
|
config_codec_info_map_[config_name] = CodecInfo();
|
||||||
|
|
||||||
const auto& codec_config = codec_configuration_map_iter->second;
|
const auto& codec_config = codec_configuration_map_iter->second;
|
||||||
const auto codec = codec_config.getCodec();
|
const auto codec = codec_config.getCodec();
|
||||||
const auto& strategy_config = strategy_configuration_map_iter->second;
|
const auto& strategy_config = strategy_configuration_map_iter->second;
|
||||||
@@ -137,12 +135,19 @@ BluetoothLeAudioCodecsProvider::GetLeAudioCodecInfo(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Goes through every scenario, deduplicate configuration
|
// Goes through every scenario, deduplicate configuration, skip the invalid
|
||||||
|
// config references (e.g. the "invalid" entries in the xml file).
|
||||||
std::set<std::string> encoding_config, decoding_config, broadcast_config;
|
std::set<std::string> encoding_config, decoding_config, broadcast_config;
|
||||||
for (auto& s : supported_scenarios_) {
|
for (auto& s : supported_scenarios_) {
|
||||||
if (s.hasEncode()) encoding_config.insert(s.getEncode());
|
if (s.hasEncode() && config_codec_info_map_.count(s.getEncode())) {
|
||||||
if (s.hasDecode()) decoding_config.insert(s.getDecode());
|
encoding_config.insert(s.getEncode());
|
||||||
if (s.hasBroadcast()) broadcast_config.insert(s.getBroadcast());
|
}
|
||||||
|
if (s.hasDecode() && config_codec_info_map_.count(s.getDecode())) {
|
||||||
|
decoding_config.insert(s.getDecode());
|
||||||
|
}
|
||||||
|
if (s.hasBroadcast() && config_codec_info_map_.count(s.getBroadcast())) {
|
||||||
|
broadcast_config.insert(s.getBroadcast());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Split by session types and add results
|
// Split by session types and add results
|
||||||
|
|||||||
Reference in New Issue
Block a user