Set scan mode was starting advertising whether we should or not.

SetScanMode now only starts advertising if the radio is discoverable.

PiperOrigin-RevId: 452461975
This commit is contained in:
jfcarroll
2022-06-01 22:48:57 -07:00
committed by Copybara-Service
parent 09c04d4cc8
commit 8f067bba98
@@ -96,7 +96,9 @@ class BluetoothServerSocket : public api::BluetoothServerSocket {
void SetScanMode(bool radioDiscoverable) {
StopAdvertising();
radio_discoverable_ = radioDiscoverable;
StartAdvertising();
if (radio_discoverable_) {
StartAdvertising();
}
}
private: