diff --git a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp index 24eb4d0871..88b39d6c32 100644 --- a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp +++ b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp @@ -974,7 +974,16 @@ TEST_P(BluetoothAidlTest, CallInitializeTwice) { ASSERT_EQ(status, std::future_status::ready); } +// @VsrTest = 5.3.14-001 +// @VsrTest = 5.3.14-002 +// @VsrTest = 5.3.14-004 TEST_P(BluetoothAidlTest, Vsr_Bluetooth5Requirements) { + int api_level = get_vsr_api_level(); + if (api_level < __ANDROID_API_U__) { + GTEST_SKIP() << "API level is lower than 34"; + return; + } + std::vector version_event; send_and_wait_for_cmd_complete(ReadLocalVersionInformationBuilder::Create(), version_event); @@ -984,10 +993,12 @@ TEST_P(BluetoothAidlTest, Vsr_Bluetooth5Requirements) { ASSERT_TRUE(version_view.IsValid()); ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, version_view.GetStatus()); auto version = version_view.GetLocalVersionInformation(); + if (version.hci_version_ < ::bluetooth::hci::HciVersion::V_5_0) { - // This test does not apply to controllers below 5.0 + GTEST_SKIP() << "Bluetooth version is lower than 5.0"; return; - }; + } + // When HCI version is 5.0, LMP version must also be at least 5.0 ASSERT_GE(static_cast(version.lmp_version_), static_cast(version.hci_version_)); @@ -1000,6 +1011,16 @@ TEST_P(BluetoothAidlTest, Vsr_Bluetooth5Requirements) { std::make_shared>(le_features_event))))); ASSERT_TRUE(le_features_view.IsValid()); ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, le_features_view.GetStatus()); + + // CHIPSETs that set ro.board.api_level to 34 and report 5.0 or higher for + // the Bluetooth version through the IBluetoothHci HAL: + // + // [VSR-5.3.14-001] Must return TRUE for + // - LE 2M PHY + // - LE Coded PHY + // - LE Advertising Extension + // - LE Periodic Advertising + // - LE Link Layer Privacy auto le_features = le_features_view.GetLeFeatures(); ASSERT_TRUE(le_features & static_cast(LLFeaturesBits::LL_PRIVACY)); ASSERT_TRUE(le_features & static_cast(LLFeaturesBits::LE_2M_PHY)); @@ -1007,6 +1028,8 @@ TEST_P(BluetoothAidlTest, Vsr_Bluetooth5Requirements) { static_cast(LLFeaturesBits::LE_CODED_PHY)); ASSERT_TRUE(le_features & static_cast(LLFeaturesBits::LE_EXTENDED_ADVERTISING)); + ASSERT_TRUE(le_features & + static_cast(LLFeaturesBits::LE_PERIODIC_ADVERTISING)); std::vector num_adv_set_event; send_and_wait_for_cmd_complete( @@ -1020,6 +1043,10 @@ TEST_P(BluetoothAidlTest, Vsr_Bluetooth5Requirements) { ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, num_adv_set_view.GetStatus()); auto num_adv_set = num_adv_set_view.GetNumberSupportedAdvertisingSets(); + // CHIPSETs that set ro.board.api_level to 34 and report 5.0 or higher for + // the Bluetooth version through the IBluetoothHci HAL: + // + // [VSR-5.3.14-002] MUST support at least 10 advertising sets. if (isTv() && get_vsr_api_level() == __ANDROID_API_U__) { ASSERT_GE(num_adv_set, kMinLeAdvSetForBt5FoTv); } else { @@ -1036,6 +1063,11 @@ TEST_P(BluetoothAidlTest, Vsr_Bluetooth5Requirements) { ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, num_resolving_list_view.GetStatus()); auto num_resolving_list = num_resolving_list_view.GetResolvingListSize(); + + // CHIPSETs that set ro.board.api_level to 34 and report 5.0 or higher for + // the Bluetooth version through the IBluetoothHci HAL: + // + // [VSR-5.3.14-004] MUST support a resolving list size of at least 8 entries. ASSERT_GE(num_resolving_list, kMinLeResolvingListForBt5); }