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

Commit d79efe4d authored by Chris Manton's avatar Chris Manton
Browse files

shim: Wrap TRY_POSTING_ON_MAIN conditional

Bug: 185633860
Test: gd/cert/run
Tag: #refactor
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I34afd1b42744f1357f4a5ea6624e343bd7f59ad1
parent 2bb4d879
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
@@ -238,11 +238,13 @@ void ValidateAclInterface(const shim::legacy::acl_interface_t& acl_interface) {
}  // namespace

#define TRY_POSTING_ON_MAIN(cb, ...)                               \
  do {                                                             \
    if (cb == nullptr) {                                           \
      LOG_WARN("Dropping ACL event with no callback");             \
    } else {                                                       \
      do_in_main_thread(FROM_HERE, base::Bind(cb, ##__VA_ARGS__)); \
  }
    }                                                              \
  } while (0)

constexpr HciHandle kInvalidHciHandle = 0xffff;