Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: select-bluetooth-device on Windows #29613

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion shell/browser/lib/bluetooth_chooser.cc
Expand Up @@ -60,6 +60,7 @@ void BluetoothChooser::SetAdapterPresence(AdapterPresence presence) {
event_handler_.Run(content::BluetoothChooserEvent::CANCELLED, "");
break;
case AdapterPresence::POWERED_ON:
rescan_ = true;
break;
}
}
Expand Down Expand Up @@ -92,7 +93,7 @@ void BluetoothChooser::ShowDiscoveryState(DiscoveryState state) {
case DiscoveryState::DISCOVERING:
// The first time this state fires is due to a rescan triggering so set a
// flag to ignore devices
if (!refreshing_) {
if (rescan_ && !refreshing_) {
refreshing_ = true;
} else {
// The second time this state fires we are now safe to pick a device
Expand Down
1 change: 1 addition & 0 deletions shell/browser/lib/bluetooth_chooser.h
Expand Up @@ -42,6 +42,7 @@ class BluetoothChooser : public content::BluetoothChooser {
EventHandler event_handler_;
int num_retries_ = 0;
bool refreshing_ = false;
bool rescan_ = false;

DISALLOW_COPY_AND_ASSIGN(BluetoothChooser);
};
Expand Down