Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a7e5abe authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 5992631 from 1173e4af to rvc-release

Change-Id: Idce579dc04cdd89c2c5eaaf11193e287d4efd532
parents de945fe6 1173e4af
Loading
Loading
Loading
Loading
+22 −5
Original line number Diff line number Diff line
@@ -29,9 +29,10 @@ fluoride_defaults {
    },
}

// Fuzzable defaults are the subset of defaults that are used in fuzzing, which
// requires no shared libraries, and no explicit sanitization.
fluoride_defaults {
    name: "fluoride_types_defaults",
    defaults: ["libchrome_support_defaults"],
    name: "fluoride_types_defaults_fuzzable",
    cflags: [
        "-DEXPORT_SYMBOL=__attribute__((visibility(\"default\")))",
        "-fvisibility=hidden",
@@ -54,15 +55,22 @@ fluoride_defaults {
}

fluoride_defaults {
    name: "fluoride_defaults",
    name: "fluoride_types_defaults",
    defaults: [
        "fluoride_types_defaults_fuzzable",
        "libchrome_support_defaults"
    ],
}

fluoride_defaults {
    name: "fluoride_defaults_fuzzable",
    target: {
        android: {
            test_config_template: ":BluetoothTestConfigTemplate",
        },
    },
    defaults: ["fluoride_types_defaults"],
    defaults: ["fluoride_types_defaults_fuzzable"],
    header_libs: ["libbluetooth_headers"],
    shared_libs: ["libstatslog"],
    static_libs: [
        "libbluetooth-types",
        "libbt-platform-protos-lite",
@@ -73,6 +81,15 @@ fluoride_defaults {
    },
}

fluoride_defaults {
    name: "fluoride_defaults",
    defaults: ["fluoride_defaults_fuzzable", "fluoride_types_defaults"],
    shared_libs: ["libstatslog"],
    sanitize: {
        misc_undefined: ["bounds"],
    },
}

// Enables code coverage for a set of source files. Must be combined with
// "clang_coverage_bin" in order to work. See //test/gen_coverage.py for more information
// on generating code coverage.
+0 −1
Original line number Diff line number Diff line
@@ -70,7 +70,6 @@ class GdBaseTestClass(BaseTestClass):
            builtin=True)

    def teardown_class(self):
        self.unregister_controllers()
        if self.rootcanal_running:
            self.rootcanal_process.send_signal(signal.SIGINT)
            rootcanal_return_code = self.rootcanal_process.wait()
+0 −7
Original line number Diff line number Diff line
@@ -85,15 +85,8 @@ struct AclManager::impl {
    hci_layer_->RegisterEventHandler(EventCode::CONNECTION_PACKET_TYPE_CHANGED,
                                     Bind(&impl::on_connection_packet_type_changed, common::Unretained(this)),
                                     handler_);
    hci_layer_->RegisterEventHandler(EventCode::MASTER_LINK_KEY_COMPLETE,
                                     Bind(&impl::on_master_link_key_complete, common::Unretained(this)), handler_);
    hci_layer_->RegisterEventHandler(EventCode::AUTHENTICATION_COMPLETE,
                                     Bind(&impl::on_authentication_complete, common::Unretained(this)), handler_);
    hci_layer_->RegisterEventHandler(EventCode::ENCRYPTION_CHANGE,
                                     Bind(&impl::on_encryption_change, common::Unretained(this)), handler_);
    hci_layer_->RegisterEventHandler(EventCode::CHANGE_CONNECTION_LINK_KEY_COMPLETE,
                                     Bind(&impl::on_change_connection_link_key_complete, common::Unretained(this)),
                                     handler_);
    hci_layer_->RegisterEventHandler(EventCode::READ_CLOCK_OFFSET_COMPLETE,
                                     Bind(&impl::on_read_clock_offset_complete, common::Unretained(this)), handler_);
    hci_layer_->RegisterEventHandler(EventCode::MODE_CHANGE, Bind(&impl::on_mode_change, common::Unretained(this)),
+0 −33
Original line number Diff line number Diff line
@@ -676,17 +676,6 @@ TEST_F(AclManagerTest, acl_send_data_credits) {
  connection->Disconnect(DisconnectReason::AUTHENTICATION_FAILURE);
}

TEST_F(AclManagerWithConnectionTest, send_master_link_key) {
  acl_manager_->MasterLinkKey(KeyFlag::TEMPORARY);
  auto packet = test_hci_layer_->GetCommandPacket(OpCode::MASTER_LINK_KEY);
  auto command_view = MasterLinkKeyView::Create(packet);
  ASSERT(command_view.IsValid());
  EXPECT_EQ(command_view.GetKeyFlag(), KeyFlag::TEMPORARY);

  EXPECT_CALL(mock_acl_manager_callbacks_, OnMasterLinkKeyComplete(0x123, KeyFlag::TEMPORARY));
  test_hci_layer_->IncomingEvent(MasterLinkKeyCompleteBuilder::Create(ErrorCode::SUCCESS, 0x123, KeyFlag::TEMPORARY));
}

TEST_F(AclManagerWithConnectionTest, send_switch_role) {
  acl_manager_->SwitchRole(connection_->GetAddress(), Role::SLAVE);
  auto packet = test_hci_layer_->GetCommandPacket(OpCode::SWITCH_ROLE);
@@ -744,28 +733,6 @@ TEST_F(AclManagerWithConnectionTest, send_authentication_requested) {
  test_hci_layer_->IncomingEvent(AuthenticationCompleteBuilder::Create(ErrorCode::SUCCESS, handle_));
}

TEST_F(AclManagerWithConnectionTest, send_set_connection_encryption) {
  connection_->SetConnectionEncryption(Enable::ENABLED);
  auto packet = test_hci_layer_->GetCommandPacket(OpCode::SET_CONNECTION_ENCRYPTION);
  auto command_view = SetConnectionEncryptionView::Create(packet);
  ASSERT(command_view.IsValid());
  EXPECT_EQ(command_view.GetEncryptionEnable(), Enable::ENABLED);

  EXPECT_CALL(mock_connection_management_callbacks_, OnEncryptionChange(EncryptionEnabled::BR_EDR_AES_CCM));
  test_hci_layer_->IncomingEvent(
      EncryptionChangeBuilder::Create(ErrorCode::SUCCESS, handle_, EncryptionEnabled::BR_EDR_AES_CCM));
}

TEST_F(AclManagerWithConnectionTest, send_change_connection_link_key) {
  connection_->ChangeConnectionLinkKey();
  auto packet = test_hci_layer_->GetCommandPacket(OpCode::CHANGE_CONNECTION_LINK_KEY);
  auto command_view = ChangeConnectionLinkKeyView::Create(packet);
  ASSERT(command_view.IsValid());

  EXPECT_CALL(mock_connection_management_callbacks_, OnChangeConnectionLinkKeyComplete);
  test_hci_layer_->IncomingEvent(ChangeConnectionLinkKeyCompleteBuilder::Create(ErrorCode::SUCCESS, handle_));
}

TEST_F(AclManagerWithConnectionTest, send_read_clock_offset) {
  connection_->ReadClockOffset();
  auto packet = test_hci_layer_->GetCommandPacket(OpCode::READ_CLOCK_OFFSET);
+35 −6
Original line number Diff line number Diff line
@@ -2616,12 +2616,33 @@ packet LeSetPeriodicAdvertisingEnable : LeAdvertisingCommand (op_code = LE_SET_P
  _payload_,  // placeholder (unimplemented)
}

packet LeSetExtendedScanParameters : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_SCAN_PARAMETERS) {
  _payload_,  // placeholder (unimplemented)
packet LeSetExtendedScanParameters : LeScanningCommand (op_code = LE_SET_EXTENDED_SCAN_PARAMETERS) {
  le_scan_type : LeScanType,
  le_scan_interval : 32, // 0x0004-0x00FFFFFF Default 0x10 (10ms)
  le_scan_window : 32, // 0x004-0xFFFF Default 0x10 (10ms)
  own_address_type : AddressType,
  scanning_filter_policy : LeSetScanningFilterPolicy,
}

packet LeSetExtendedScanEnable : LeAdvertisingCommand (op_code = LE_SET_EXTENDED_SCAN_ENABLE) {
  _payload_,  // placeholder (unimplemented)
packet LeSetExtendedScanParametersComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_SCAN_PARAMETERS) {
  status : ErrorCode,
}

enum FilterDuplicates : 8 {
  DISABLED = 0,
  ENABLED = 1,
  RESET_EACH_PERIOD = 2,
}

packet LeSetExtendedScanEnable : LeScanningCommand (op_code = LE_SET_EXTENDED_SCAN_ENABLE) {
  enable : Enable,
  filter_duplicates : FilterDuplicates,
  duration : 16, // 0 - Scan continuously,  N * 10 ms
  period : 16, // 0 - Scan continuously,  N * 1.28 sec
}

packet LeSetExtendedScanEnableComplete : CommandComplete (command_op_code = LE_SET_EXTENDED_SCAN_ENABLE) {
  status : ErrorCode,
}

packet LeExtendedCreateConnection : LeConnectionManagementCommand (op_code = LE_EXTENDED_CREATE_CONNECTION) {
@@ -2816,8 +2837,16 @@ packet LeEnergyInfo : VendorCommand (op_code = LE_ENERGY_INFO) {
  _payload_,  // placeholder (unimplemented)
}

packet LeExtendedScanParams : VendorCommand (op_code = LE_EXTENDED_SCAN_PARAMS) {
  _payload_,  // placeholder (unimplemented)
packet LeExtendedScanParams : LeScanningCommand (op_code = LE_EXTENDED_SCAN_PARAMS) {
  le_scan_type : LeScanType,
  le_scan_interval : 32, // 0x0004-0x4000 Default 0x10 (10ms)
  le_scan_window : 32, // Default 0x10 (10ms)
  own_address_type : AddressType,
  scanning_filter_policy : LeSetScanningFilterPolicy,
}

packet LeExtendedScanParamsComplete : CommandComplete (command_op_code = LE_EXTENDED_SCAN_PARAMS) {
  status : ErrorCode,
}

packet ControllerDebugInfo : VendorCommand (op_code = CONTROLLER_DEBUG_INFO) {
Loading