Fixes bluetooth_medium is not supported then don't continue for BleDiscoveredHandler.

PiperOrigin-RevId: 391418495
This commit is contained in:
edwinwu
2021-08-17 17:55:56 -07:00
committed by Copybara-Service
parent 913a639a5d
commit 56b7daf88d
@@ -407,11 +407,21 @@ BluetoothSocket BluetoothClassic::AttemptToConnect(
BluetoothDevice BluetoothClassic::GetRemoteDevice(
const std::string& mac_address) {
MutexLock lock(&mutex_);
if (!IsAvailableLocked()) {
return {};
}
return medium_.GetRemoteDevice(mac_address);
}
std::string BluetoothClassic::GetMacAddress() const {
MutexLock lock(&mutex_);
if (!IsAvailableLocked()) {
return {};
}
return medium_.GetMacAddress();
}