Call StopScan() when ScanSession goes out of scope and make sure stop can only be called once.

PiperOrigin-RevId: 488717591
This commit is contained in:
Anay Wadhera
2022-11-15 11:46:34 -08:00
committed by Copybara-Service
parent 7a918e8310
commit beb67fc02a
5 changed files with 82 additions and 23 deletions
@@ -21,8 +21,7 @@ namespace presence {
std::unique_ptr<ScanSession> ServiceControllerImpl::StartScan(
ScanRequest scan_request, ScanCallback callback) {
return std::make_unique<ScanSession>(
scan_manager_.StartScan(scan_request, callback));
return scan_manager_.StartScan(scan_request, callback);
}
std::unique_ptr<BroadcastSession> ServiceControllerImpl::StartBroadcast(
BroadcastRequest broadcast_request, BroadcastCallback callback) {