Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 033112e5 authored by Chienyuan's avatar Chienyuan
Browse files

gd HCI: assign client_handler_ before execute queued callbacks

Tag: #gd-refactor
Bug: 145832107
Test: atest bluetooth_test_gd
Test: ./cert/run --host
Change-Id: Id45980cb1975fd8a893c262099e64f1cf4b65b3e
parent 58457e3d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -31,13 +31,13 @@ class AclConnectionTracker : public ConnectionManagementCallbacks {
    ASSERT(client_callbacks_ == nullptr || queued_callbacks_.empty());
  }
  void RegisterCallbacks(ConnectionManagementCallbacks* callbacks, os::Handler* handler) {
    client_handler_ = handler;
    client_callbacks_ = callbacks;
    while (!queued_callbacks_.empty()) {
      auto iter = queued_callbacks_.begin();
      handler->Post(std::move(*iter));
      queued_callbacks_.erase(iter);
    }
    client_handler_ = handler;
    client_callbacks_ = callbacks;
  }

#define SAVE_OR_CALL(f, ...)                                                                                        \