mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
Call pairing result in background
This prevents calling the callback twice and out of order. PiperOrigin-RevId: 547562324
This commit is contained in:
committed by
Copybara-Service
parent
ffdd25a194
commit
0d2e75f2a2
@@ -52,10 +52,10 @@ FastPairSeekerImpl::~FastPairSeekerImpl() {
|
||||
NEARBY_LOGS(INFO) << "~FastPairSeekerImpl start";
|
||||
pairer_broker_->RemoveObserver(this);
|
||||
mediums_.GetBluetoothClassic().RemoveObserver(this);
|
||||
FinishPairing(absl::AbortedError("Pairing terminated"));
|
||||
auto unused = StopFastPairScan();
|
||||
CountDownLatch latch(1);
|
||||
executor_->Execute("~FastPairSeekerImpl", [this, latch]() mutable {
|
||||
FinishPairing(absl::AbortedError("Pairing terminated"));
|
||||
pairer_broker_.reset();
|
||||
executor_->Execute("sync", [latch]() mutable { latch.CountDown(); });
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user