Set FastPairDevice version

PiperOrigin-RevId: 541030067
This commit is contained in:
Janusz Sobczak
2023-06-16 16:00:31 -07:00
committed by Copybara-Service
parent e46b19c798
commit 4914cbc2f9
@@ -179,10 +179,13 @@ void FastPairDiscoverableScannerImpl::OnDeviceMetadataRetrieved(
"Ignoring this advertisement";
return;
}
auto fast_pair_device = std::make_unique<FastPairDevice>(
model_id, address, Protocol::kFastPairInitialPairing);
fast_pair_device->SetVersion(device_metadata.GetFastPairVersion());
executor_->Execute(
"add-device",
[this, fast_pair_device = std::make_unique<FastPairDevice>(
model_id, address, Protocol::kFastPairInitialPairing)]()
[this, fast_pair_device = std::move(fast_pair_device)]()
ABSL_EXCLUSIVE_LOCKS_REQUIRED(*executor_) mutable {
FastPairDevice* device =
device_repository_->AddDevice(std::move(fast_pair_device));