mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Pause Bluetooth classic discovery
PiperOrigin-RevId: 647333108
This commit is contained in:
committed by
Copybara-Service
parent
f63912cc28
commit
32cee3439b
@@ -160,6 +160,8 @@ Exception BleV2ServerSocket::DoClose() {
|
||||
BleV2Medium::BleV2Medium(api::BluetoothAdapter& adapter)
|
||||
: adapter_(static_cast<BluetoothAdapter*>(&adapter)) {
|
||||
adapter_->SetBleV2Medium(this);
|
||||
is_extended_advertisements_available_ =
|
||||
MediumEnvironment::Instance().IsBleExtendedAdvertisementsAvailable();
|
||||
|
||||
MediumEnvironment::Instance().RegisterBleV2Medium(*this, &peripheral_);
|
||||
}
|
||||
@@ -326,7 +328,7 @@ std::unique_ptr<api::ble_v2::GattClient> BleV2Medium::ConnectToGattServer(
|
||||
}
|
||||
|
||||
bool BleV2Medium::IsExtendedAdvertisementsAvailable() {
|
||||
return MediumEnvironment::Instance().IsBleExtendedAdvertisementsAvailable();
|
||||
return is_extended_advertisements_available_;
|
||||
}
|
||||
|
||||
bool BleV2Medium::GetRemotePeripheral(const std::string& mac_address,
|
||||
|
||||
@@ -332,6 +332,7 @@ class BleV2Medium : public api::ble_v2::BleMedium {
|
||||
ABSL_GUARDED_BY(mutex_);
|
||||
absl::flat_hash_set<std::pair<Uuid, std::uint32_t>>
|
||||
scanning_internal_session_ids_ ABSL_GUARDED_BY(mutex_);
|
||||
bool is_extended_advertisements_available_ = false;
|
||||
};
|
||||
|
||||
} // namespace g3
|
||||
|
||||
Reference in New Issue
Block a user