From 51215e6465525ec71fafd9dbc0c0f526c6feef49 Mon Sep 17 00:00:00 2001 From: Pulkit Bhuwalka <pulkitb@google.com> Date: Tue, 28 Feb 2017 16:11:34 -0800 Subject: [PATCH] Allow framework to compile with BTM_IO_CAP_NONE Using BTM_IO_CAP_NONE currently causes compilation to fail since bta_dm_sp_cback ends up unused out a previous #ifdef that only kicks in if BTM_IO_CAP_NONE is not set. Plugging the entire function into a #ifdef so consistency is maintained and the framework can compile. Bug: 35257446 Test: Built locally and run on device. Pairing without display using JustWorks works. Change-Id: Ibd7af6454253ccd731ff79602f327a52b8fe585b --- system/bta/dm/bta_dm_act.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/system/bta/dm/bta_dm_act.cc b/system/bta/dm/bta_dm_act.cc index 983248865d3..0dd3d86fa1c 100644 --- a/system/bta/dm/bta_dm_act.cc +++ b/system/bta/dm/bta_dm_act.cc @@ -81,7 +81,9 @@ static void bta_dm_policy_cback(tBTA_SYS_CONN_STATUS status, uint8_t id, uint8_t app_id, BD_ADDR peer_addr); /* Extended Inquiry Response */ +#if (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data); +#endif static void bta_dm_set_eir(char* local_name); @@ -2610,6 +2612,7 @@ static uint8_t bta_dm_authentication_complete_cback( return BTM_SUCCESS; } +#if (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) /******************************************************************************* * * Function bta_dm_sp_cback @@ -2630,20 +2633,16 @@ static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) { /* TODO_SP */ switch (event) { case BTM_SP_IO_REQ_EVT: -#if (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) /* translate auth_req */ bta_dm_co_io_req(p_data->io_req.bd_addr, &p_data->io_req.io_cap, &p_data->io_req.oob_data, &p_data->io_req.auth_req, p_data->io_req.is_orig); -#endif APPL_TRACE_EVENT("io mitm: %d oob_data:%d", p_data->io_req.auth_req, p_data->io_req.oob_data); break; case BTM_SP_IO_RSP_EVT: -#if (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) bta_dm_co_io_rsp(p_data->io_rsp.bd_addr, p_data->io_rsp.io_cap, p_data->io_rsp.oob_data, p_data->io_rsp.auth_req); -#endif break; case BTM_SP_CFM_REQ_EVT: @@ -2656,12 +2655,10 @@ static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) { sec_event.cfm_req.rmt_io_caps = p_data->cfm_req.rmt_io_caps; /* continue to next case */ -#if (BTM_LOCAL_IO_CAPS != BTM_IO_CAP_NONE) /* Passkey entry mode, mobile device with output capability is very unlikely to receive key request, so skip this event */ /*case BTM_SP_KEY_REQ_EVT: */ case BTM_SP_KEY_NOTIF_EVT: -#endif bta_dm_cb.num_val = sec_event.key_notif.passkey = p_data->key_notif.passkey; @@ -2773,6 +2770,7 @@ static uint8_t bta_dm_sp_cback(tBTM_SP_EVT event, tBTM_SP_EVT_DATA* p_data) { APPL_TRACE_EVENT("dm status: %d", status); return status; } +#endif /******************************************************************************* * -- GitLab