From bfdaf36fa8ebb18d4799e0954126611197b2e863 Mon Sep 17 00:00:00 2001
From: Sharvil Nanavati <sharvil@google.com>
Date: Mon, 2 Mar 2015 15:02:39 -0800
Subject: [PATCH] Don't call GKI_send_event on BTU task since it's not a GKI
 task anymore.

---
 system/bta/sys/bta_sys_main.c | 3 ---
 system/include/gki_target.h   | 4 ----
 system/stack/btu/btu_hcif.c   | 2 --
 system/stack/include/btu.h    | 5 -----
 4 files changed, 14 deletions(-)

diff --git a/system/bta/sys/bta_sys_main.c b/system/bta/sys/bta_sys_main.c
index a0833d6bf34..9a4928ac658 100644
--- a/system/bta/sys/bta_sys_main.c
+++ b/system/bta/sys/bta_sys_main.c
@@ -599,8 +599,6 @@ BOOLEAN bta_sys_is_register(UINT8 id)
 void bta_sys_sendmsg(void *p_msg)
 {
     fixed_queue_enqueue(btu_bta_msg_queue, p_msg);
-    // Signal the target thread work is ready.
-    GKI_send_event(BTU_TASK, (UINT16)EVENT_MASK(BTA_MBOX));
 }
 
 /*******************************************************************************
@@ -618,7 +616,6 @@ void bta_alarm_cb(void *data) {
   TIMER_LIST_ENT *p_tle = (TIMER_LIST_ENT *)data;
 
   fixed_queue_enqueue(btu_bta_alarm_queue, p_tle);
-  GKI_send_event(BTU_TASK, TASK_MBOX_0_EVT_MASK);
 }
 
 void bta_sys_start_timer(TIMER_LIST_ENT *p_tle, UINT16 type, INT32 timeout_ms) {
diff --git a/system/include/gki_target.h b/system/include/gki_target.h
index be0eae030b0..32ddf1f0174 100644
--- a/system/include/gki_target.h
+++ b/system/include/gki_target.h
@@ -27,10 +27,6 @@
 ******************************************************************************/
 
 /* Definitions of task IDs for inter-task messaging */
-#ifndef BTU_TASK
-#define BTU_TASK                0
-#endif
-
 #ifndef BTIF_TASK
 #define BTIF_TASK               1
 #endif
diff --git a/system/stack/btu/btu_hcif.c b/system/stack/btu/btu_hcif.c
index e71723e46ea..cadcb849b57 100644
--- a/system/stack/btu/btu_hcif.c
+++ b/system/stack/btu/btu_hcif.c
@@ -940,7 +940,6 @@ static void btu_hcif_command_complete_evt(BT_HDR *response, void *context)
     event->event = BTU_POST_TO_TASK_NO_GOOD_HORRIBLE_HACK;
 
     fixed_queue_enqueue(btu_hci_msg_queue, event);
-    GKI_send_event(BTU_TASK, (UINT16)EVENT_MASK(BTU_HCI_RCV_MBOX));
 }
 
 
@@ -1140,7 +1139,6 @@ static void btu_hcif_command_status_evt(uint8_t status, BT_HDR *command, void *c
     event->event = BTU_POST_TO_TASK_NO_GOOD_HORRIBLE_HACK;
 
     fixed_queue_enqueue(btu_hci_msg_queue, event);
-    GKI_send_event(BTU_TASK, (UINT16)EVENT_MASK(BTU_HCI_RCV_MBOX));
 }
 
 /*******************************************************************************
diff --git a/system/stack/include/btu.h b/system/stack/include/btu.h
index 2da0035d7c8..336f9f990d3 100644
--- a/system/stack/include/btu.h
+++ b/system/stack/include/btu.h
@@ -49,11 +49,6 @@ typedef struct {
   void *context;
 } command_status_hack_t;
 
-/* Define the BTU mailbox usage
-*/
-#define BTU_HCI_RCV_MBOX        TASK_MBOX_0     /* Messages from HCI  */
-#define BTU_BTIF_MBOX           TASK_MBOX_1     /* Messages to BTIF   */
-
 /* callbacks
 */
 typedef void (*tBTU_TIMER_CALLBACK)(TIMER_LIST_ENT *p_tle);
-- 
GitLab