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

Commit b4f10fc0 authored by Myles Watson's avatar Myles Watson
Browse files

LE Advertising: RESOLVABLE_ types are not supported

These types require the controller to manage advertising.

Bug: 207151267
Test: cert/run
Tag: #gd-refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines
Change-Id: Ie3d35cc666058d80369049fd5ce5f8c023267cdf
parent bdc32b68
Loading
Loading
Loading
Loading
+34 −28
Original line number Diff line number Diff line
@@ -329,7 +329,8 @@ struct LeAdvertisingManager::impl : public bluetooth::hci::LeAddressManagerCallb
    set_parameters(id, config);

    auto address_policy = le_address_manager_->GetAddressPolicy();
    if (config.own_address_type == OwnAddressType::RANDOM_DEVICE_ADDRESS) {
    switch (config.own_address_type) {
      case OwnAddressType::RANDOM_DEVICE_ADDRESS:
        if (address_policy == LeAddressManager::AddressPolicy::USE_NON_RESOLVABLE_ADDRESS ||
            address_policy == LeAddressManager::AddressPolicy::USE_RESOLVABLE_ADDRESS) {
          AddressWithType address_with_type = le_address_manager_->GetAnotherAddress();
@@ -354,9 +355,14 @@ struct LeAdvertisingManager::impl : public bluetooth::hci::LeAddressManagerCallb
                  id, advertising_sets_[id].current_address.GetAddress()),
              module_handler_->BindOnce(impl::check_status<LeSetExtendedAdvertisingRandomAddressCompleteView>));
        }
    } else {
        break;
      case OwnAddressType::PUBLIC_DEVICE_ADDRESS:
        advertising_sets_[id].current_address =
            AddressWithType(controller_->GetMacAddress(), AddressType::PUBLIC_DEVICE_ADDRESS);
        break;
      default:
        // For resolvable address types, set the Peer address and type, and the controller generates the address.
        LOG_ALWAYS_FATAL("Unsupported Advertising Type %s", OwnAddressTypeText(config.own_address_type).c_str());
    }
    if (config.advertising_type == AdvertisingType::ADV_IND ||
        config.advertising_type == AdvertisingType::ADV_NONCONN_IND) {