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

Commit 453f2dda authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Do not set random address when public address is in use"

parents febf550c 83a2df89
Loading
Loading
Loading
Loading
+36 −26
Original line number Diff line number Diff line
@@ -422,6 +422,12 @@ class BleAdvertisingManagerImpl

            c->self->adv_inst[c->inst_id].tx_power = tx_power;

            if (c->self->adv_inst[c->inst_id].own_address_type == BLE_ADDR_PUBLIC) {
              c->self->StartAdvertisingSetAfterAddressPart(std::move(c));
              return;
            }

            //own_address_type == BLE_ADDR_RANDOM
            const RawAddress& rpa = c->self->adv_inst[c->inst_id].own_address;
            c->self->GetHciInterface()->SetRandomAddress(c->inst_id, rpa, Bind(
              [](c_type c, uint8_t status) {
@@ -432,6 +438,14 @@ class BleAdvertisingManagerImpl
                  return;
                }

                c->self->StartAdvertisingSetAfterAddressPart(std::move(c));
          }, base::Passed(&c)));
        }, base::Passed(&c)));
    }, base::Passed(&c)));
    // clang-format on
  }

  void StartAdvertisingSetAfterAddressPart(c_type c) {
    c->self->SetData(c->inst_id, false, std::move(c->advertise_data), Bind(
      [](c_type c, uint8_t status) {
        if (status != 0) {
@@ -457,10 +471,6 @@ class BleAdvertisingManagerImpl
            }
        }, base::Passed(&c)));
    }, base::Passed(&c)));
            }, base::Passed(&c)));
        }, base::Passed(&c)));
    }, base::Passed(&c)));
    // clang-format on
  }

  void StartAdvertisingSetPeriodicPart(c_type c) {