Skip to content

Commit

Permalink
bluetooth: Fix BLE discovery not working issue on MacOS
Browse files Browse the repository at this point in the history
In the sequence of
BluetoothLowEnergyAdapterApple::RequestSystemPermission followed by
BluetoothLowEnergyAdapterApple::LazyInitialize,
low_energy_discovery_manager_ is not linked with the proper
CentralManager, and it results in no BLE devices in BLE discovery
session. This CL fixes the issue by properly set the CentralManager
for low_energy_discovery_manager_ during lazy initialization.

Bug: 349393380
Change-Id: Ibac58c22e8d9c5f2f46f815b414dd9b74dfb79ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5656271
Auto-Submit: Jack Hsieh <[email protected]>
Reviewed-by: Nina Satragno <[email protected]>
Commit-Queue: Nina Satragno <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1319841}
  • Loading branch information
chengweih001 authored and Chromium LUCI CQ committed Jun 26, 2024
1 parent f7bfb8b commit eecb345
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions device/bluetooth/bluetooth_low_energy_adapter_apple.mm
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,8 @@
low_energy_central_manager_ = [[CBCentralManager alloc]
initWithDelegate:low_energy_central_manager_delegate_
queue:dispatch_get_main_queue()];
low_energy_discovery_manager_->SetCentralManager(
low_energy_central_manager_);
}
low_energy_discovery_manager_->SetCentralManager(low_energy_central_manager_);

low_energy_peripheral_manager_ = [[CBPeripheralManager alloc]
initWithDelegate:low_energy_peripheral_manager_delegate_
Expand Down

0 comments on commit eecb345

Please sign in to comment.