summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKausik Sinnaswamy <kausik@broadcom.com>2012-09-13 22:15:28 +0530
committerMatthew Xie <mattx@google.com>2012-09-13 17:56:52 -0700
commit557040bc55438df4c1e41c906c9d075a6b2c1e92 (patch)
treec5a9ea3cbf391e924dc439cd13470c954fce7ec6
parentf3abcaa13c144b638bceeabd6de180a7ef4e2348 (diff)
downloadexternal_bluetooth_bluedroid-557040bc55438df4c1e41c906c9d075a6b2c1e92.zip
external_bluetooth_bluedroid-557040bc55438df4c1e41c906c9d075a6b2c1e92.tar.gz
external_bluetooth_bluedroid-557040bc55438df4c1e41c906c9d075a6b2c1e92.tar.bz2
BTIF Media task not terminated during BT off
During BT disable, the BTIF AV media task was not shutdown cleanly, this could result in bad state on subsequent BT enable. bug 7142673 Change-Id: I6177baec5804720e96adcf9aa9445cc2bb438b07
-rw-r--r--btif/src/btif_media_task.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/btif/src/btif_media_task.c b/btif/src/btif_media_task.c
index 9de74d5..d7e372d 100644
--- a/btif/src/btif_media_task.c
+++ b/btif/src/btif_media_task.c
@@ -107,7 +107,7 @@
#define BTIF_MEDIA_TASK_CMD TASK_MBOX_0_EVT_MASK
#define BTIF_MEDIA_TASK_DATA TASK_MBOX_1_EVT_MASK
-#define BTIF_MEDIA_TASK_KILL TASK_MBOX_3_EVT_MASK
+#define BTIF_MEDIA_TASK_KILL EVENT_MASK(GKI_SHUTDOWN_EVT)
#define BTIF_MEDIA_AA_TASK_TIMER_ID TIMER_0
#define BTIF_MEDIA_AV_TASK_TIMER_ID TIMER_1
@@ -573,7 +573,7 @@ static void btif_a2dp_ctrl_cb(tUIPC_CH_ID ch_id, tUIPC_EVENT event)
case UIPC_CLOSE_EVT:
/* restart ctrl server unless we are shutting down */
- if (media_task_running != MEDIA_TASK_STATE_SHUTTING_DOWN)
+ if (media_task_running == MEDIA_TASK_STATE_ON)
UIPC_Open(UIPC_CH_ID_AV_CTRL , btif_a2dp_ctrl_cb);
break;
@@ -765,7 +765,7 @@ int btif_a2dp_start_media_task(void)
void btif_a2dp_stop_media_task(void)
{
APPL_TRACE_EVENT0("## A2DP STOP MEDIA TASK ##");
- GKI_send_event(BT_MEDIA_TASK, BTIF_MEDIA_TASK_KILL);
+ GKI_destroy_task(BT_MEDIA_TASK);
}
/*****************************************************************************