From: Jaganath Kanakkassery Date: Wed, 6 Jan 2016 07:27:51 +0000 (+0800) Subject: Suspend properly when receiving events without response X-Git-Tag: android-x86-8.1-r1~1736^2~103 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=d722e2ff1e9b54aee0c373ac8a6fadadfd0a84d9;p=android-x86%2Fsystem-bt.git Suspend properly when receiving events without response In the BTU handler for messages from the controller, rn event may be received that the stack does not have to respond to. In this case, the stack should go to sleep. This patch calls the provided function in the BTU to enter sleep. Signed-off-by: Jaganath Kanakkassery Signed-off-by: Yingkai Cheng Signed-off-by: Zhiquan Liu Change-Id: Ie7c3fcae418eb2480338509e86b7cc870177a965 --- diff --git a/stack/btu/btu_task.c b/stack/btu/btu_task.c index c8abc485a..6c2a7a805 100644 --- a/stack/btu/btu_task.c +++ b/stack/btu/btu_task.c @@ -120,6 +120,11 @@ static void btu_hci_msg_process(BT_HDR *p_msg) { { case BTU_POST_TO_TASK_NO_GOOD_HORRIBLE_HACK: // TODO(zachoverflow): remove this ((post_to_task_hack_t *)(&p_msg->data[0]))->callback(p_msg); +#if (defined(HCILP_INCLUDED) && HCILP_INCLUDED == TRUE) + /* If the host receives events which it doesn't responsd to, */ + /* it should start an idle timer to enter sleep mode. */ + btu_check_bt_sleep (); +#endif break; case BT_EVT_TO_BTU_HCI_ACL: /* All Acl Data goes to L2CAP */