From d9709f256ac265e6943cdf53a2a3f8c8309dfb73 Mon Sep 17 00:00:00 2001 From: Abhishek Pandit-Subedi Date: Tue, 11 May 2021 17:20:36 +0000 Subject: [PATCH] Fix incorrect enum comparison of LE close reason The LE close reason is tGATT_DISCONN_REASON but it's compared against tHCI_ERROR_CODE. Besides just being different types, they are also backed by different primitives (u16 for gatt vs u8 for hci). This fails in stricter build environments (i.e. ChromeOS). Bug: 187836537 Tag: #floss Test: atest --host bluetooth_test_gd Change-Id: I0f926b6fad9f20adde5e1e7ff89bcc7c8da01f93 --- bta/hh/bta_hh_le.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bta/hh/bta_hh_le.cc b/bta/hh/bta_hh_le.cc index efc6bb8a7..360805898 100644 --- a/bta/hh/bta_hh_le.cc +++ b/bta/hh/bta_hh_le.cc @@ -1625,7 +1625,7 @@ void bta_hh_gatt_close(tBTA_HH_DEV_CB* p_cb, const tBTA_HH_DATA* p_data) { if (bta_hh_cb.cnt_num == 0 && bta_hh_cb.w4_disable) { bta_hh_disc_cmpl(); } else if (kBTA_HH_LE_RECONN && - p_data->le_close.reason == HCI_ERR_CONNECTION_TOUT) { + p_data->le_close.reason == GATT_CONN_TIMEOUT) { bta_hh_le_add_dev_bg_conn(p_cb, false); } } -- 2.11.0