Skip to content

Commit

Permalink
[floss] Don't reset clients when switching to the same adapter
Browse files Browse the repository at this point in the history
Reset should be performed after the check.

BUG=b:270447662
TEST=CQ

Change-Id: I28a4bf97d684ddf6c4d6beacb19306b27bbb02b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4982471
Commit-Queue: Hsin-chen Chuang <chharry@google.com>
Reviewed-by: Katherine Lai <laikatherine@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1217438}
  • Loading branch information
Hsin-chen Chuang authored and Chromium LUCI CQ committed Oct 31, 2023
1 parent bb3ed82 commit a56aad4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions device/bluetooth/floss/floss_dbus_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -455,17 +455,17 @@ FlossAdminClient* FlossDBusManager::GetAdminClient() {

void FlossDBusManager::InitializeAdapterClients(int adapter,
base::OnceClosure on_ready) {
// Clean up active adapter clients
if (active_adapter_ != kInvalidAdapter) {
client_bundle_->ResetAdapterClients();
}

// Initializing already current adapter.
if (active_adapter_ == adapter) {
std::move(on_ready).Run();
return;
}

// Clean up active adapter clients
if (active_adapter_ != kInvalidAdapter) {
client_bundle_->ResetAdapterClients();
}

// Set current adapter. If it's kInvalidAdapter, this doesn't need to do any
// init.
active_adapter_ = adapter;
Expand Down

0 comments on commit a56aad4

Please sign in to comment.