Replace std::function with AnyInvocable

PiperOrigin-RevId: 556090653
This commit is contained in:
Janusz Sobczak
2023-08-11 14:27:08 -07:00
committed by Copybara-Service
parent 85bf78ef70
commit 8ccb9fcfec
20 changed files with 134 additions and 116 deletions
@@ -28,9 +28,10 @@
namespace nearby {
namespace connections {
BluetoothBwuHandler::BluetoothBwuHandler(Mediums& mediums,
BwuNotifications notifications)
: BaseBwuHandler(std::move(notifications)), mediums_(mediums) {}
BluetoothBwuHandler::BluetoothBwuHandler(
Mediums& mediums, IncomingConnectionCallback incoming_connection_callback)
: BaseBwuHandler(std::move(incoming_connection_callback)),
mediums_(mediums) {}
// Called by BWU target. Retrieves a new medium info from incoming message,
// and establishes connection over BT using this info.
@@ -153,7 +154,7 @@ void BluetoothBwuHandler::OnIncomingBluetoothConnection(
upgrade_service_id, socket),
.channel = std::move(channel),
}};
bwu_notifications_.incoming_connection_cb(client, std::move(connection));
NotifyOnIncomingConnection(client, std::move(connection));
}
} // namespace connections