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

Commit d5abef50 authored by Myles Watson's avatar Myles Watson
Browse files

Add Postable getter to common/main_handler

Allow tests to compile with code that uses

get_main()->BindOnce (and friends)

Bug: 330419766
Test: mma -j32
Flag: EXEMPT, Mechanical Refactor
Change-Id: If576c74ab00362d13b0f50791b4dc2ee98e13bad
parent f132c029
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
#include <future>

#include "common/message_loop_thread.h"
#include "common/postable_context.h"
#include "include/hardware/bluetooth.h"
#include "os/log.h"

@@ -73,3 +74,7 @@ void main_thread_shut_down() { main_thread.ShutDown(); }

// osi_alarm
bluetooth::common::MessageLoopThread* get_main_thread() { return &main_thread; }

bluetooth::common::PostableContext* get_main() {
  return main_thread.Postable();
}
+2 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <functional>

#include "common/message_loop_thread.h"
#include "common/postable_context.h"
#include "include/hardware/bluetooth.h"

using bluetooth::common::MessageLoopThread;
@@ -38,3 +39,4 @@ void main_thread_shut_down();
extern const int sync_timeout_in_ms;
void sync_main_handler();
bluetooth::common::MessageLoopThread* get_main_thread();
bluetooth::common::PostableContext* get_main();