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

Commit 6ae6bcfd authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

gd: Always register for gd_acl events am: 3b1979d3 am: 3ef32d51

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/1914576

Change-Id: Ib36fb7876d9fd60f147e50698598068e699f2fe2
parents 3ee98f16 3ef32d51
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -35,10 +35,8 @@ struct Controller::impl {
  void Start(hci::HciLayer* hci) {
    hci_ = hci;
    Handler* handler = module_.GetHandler();
    if (common::init_flags::gd_acl_is_enabled() || common::init_flags::gd_l2cap_is_enabled()) {
    hci_->RegisterEventHandler(
        EventCode::NUMBER_OF_COMPLETED_PACKETS, handler->BindOn(this, &Controller::impl::NumberOfCompletedPackets));
    }

    le_set_event_mask(kDefaultLeEventMask);
    set_event_mask(kDefaultEventMask);
+4 −7
Original line number Diff line number Diff line
@@ -603,13 +603,10 @@ void HciLayer::Start() {
  RegisterEventHandler(EventCode::COMMAND_COMPLETE, handler->BindOn(impl_, &impl::on_command_complete));
  RegisterEventHandler(EventCode::COMMAND_STATUS, handler->BindOn(impl_, &impl::on_command_status));
  RegisterLeMetaEventHandler(handler->BindOn(impl_, &impl::on_le_meta_event));
  if (bluetooth::common::init_flags::gd_acl_is_enabled() || bluetooth::common::init_flags::gd_l2cap_is_enabled()) {
    RegisterEventHandler(
        EventCode::DISCONNECTION_COMPLETE, handler->BindOn(this, &HciLayer::on_disconnection_complete));
  RegisterEventHandler(EventCode::DISCONNECTION_COMPLETE, handler->BindOn(this, &HciLayer::on_disconnection_complete));
  RegisterEventHandler(
      EventCode::READ_REMOTE_VERSION_INFORMATION_COMPLETE,
      handler->BindOn(this, &HciLayer::on_read_remote_version_complete));
  }
  auto drop_packet = handler->BindOn(impl_, &impl::drop);
  RegisterEventHandler(EventCode::PAGE_SCAN_REPETITION_MODE_CHANGE, drop_packet);
  RegisterEventHandler(EventCode::MAX_SLOTS_CHANGE, drop_packet);
+0 −4
Original line number Diff line number Diff line
@@ -153,13 +153,9 @@ void LeAddressManager::register_client(LeAddressManagerCallback* callback) {
  } else if (
      address_policy_ == AddressPolicy::USE_RESOLVABLE_ADDRESS ||
      address_policy_ == AddressPolicy::USE_NON_RESOLVABLE_ADDRESS) {
    if (bluetooth::common::init_flags::gd_acl_is_enabled() || bluetooth::common::init_flags::gd_l2cap_is_enabled()) {
      if (registered_clients_.size() == 1) {
        schedule_rotate_random_address();
      }
    } else {
      prepare_to_rotate();
    }
  }
}