OSDN Git Service

Replace BT_HDR => BT_HDR_RIGID
[android-x86/system-bt.git] / bta / sys / bta_sys_main.cc
index f6f7622..9448606 100644 (file)
 #define LOG_TAG "bt_bta_sys_main"
 
 #include <base/bind.h>
-#include <base/logging.h>
-#include <string.h>
-
-#include "bt_common.h"
-#include "bta_api.h"
-#include "bta_sys.h"
-#include "bta_sys_int.h"
-#include "btm_api.h"
-#include "btu.h"
+#include <cstring>
+
+#include "bt_target.h"  // Must be first to define build configuration
+
+#include "bta/sys/bta_sys.h"
+#include "bta/sys/bta_sys_int.h"
+#include "include/hardware/bluetooth.h"
 #include "osi/include/alarm.h"
-#include "osi/include/fixed_queue.h"
+#include "osi/include/allocator.h"
 #include "osi/include/log.h"
-#include "osi/include/osi.h"
-#include "utl.h"
+#include "stack/include/bt_types.h"
+#include "stack/include/btu.h"  // do_in_main_thread
 
 void BTIF_dm_on_hw_error();
 
@@ -84,7 +82,7 @@ void BTA_sys_signal_hw_error() {
  * Returns          void
  *
  ******************************************************************************/
-void bta_sys_event(BT_HDR* p_msg) {
+static void bta_sys_event(BT_HDR_RIGID* p_msg) {
   uint8_t id;
   bool freebuf = true;
 
@@ -165,7 +163,8 @@ bool bta_sys_is_register(uint8_t id) { return bta_sys_cb.is_reg[id]; }
  ******************************************************************************/
 void bta_sys_sendmsg(void* p_msg) {
   if (do_in_main_thread(
-          FROM_HERE, base::Bind(&bta_sys_event, static_cast<BT_HDR*>(p_msg))) !=
+          FROM_HERE,
+          base::Bind(&bta_sys_event, static_cast<BT_HDR_RIGID*>(p_msg))) !=
       BT_STATUS_SUCCESS) {
     LOG(ERROR) << __func__ << ": do_in_main_thread failed";
   }
@@ -173,7 +172,8 @@ void bta_sys_sendmsg(void* p_msg) {
 
 void bta_sys_sendmsg_delayed(void* p_msg, const base::TimeDelta& delay) {
   if (do_in_main_thread_delayed(
-          FROM_HERE, base::Bind(&bta_sys_event, static_cast<BT_HDR*>(p_msg)),
+          FROM_HERE,
+          base::Bind(&bta_sys_event, static_cast<BT_HDR_RIGID*>(p_msg)),
           delay) != BT_STATUS_SUCCESS) {
     LOG(ERROR) << __func__ << ": do_in_main_thread_delayed failed";
   }
@@ -191,7 +191,7 @@ void bta_sys_sendmsg_delayed(void* p_msg, const base::TimeDelta& delay) {
  ******************************************************************************/
 void bta_sys_start_timer(alarm_t* alarm, uint64_t interval_ms, uint16_t event,
                          uint16_t layer_specific) {
-  BT_HDR* p_buf = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
+  BT_HDR_RIGID* p_buf = (BT_HDR_RIGID*)osi_malloc(sizeof(BT_HDR_RIGID));
 
   p_buf->event = event;
   p_buf->layer_specific = layer_specific;