From df50228be25201592ccc837160fdd4d932083ba4 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Sun, 2 May 2021 09:52:25 -0700 Subject: [PATCH] Straighten out tBTA_GATT_REASON Bug: 183374320 Test: gd/cert/run Tag: #refactor Change-Id: Ib66bbdbc753480bc6a69136b3bbe1d08e11730b3 --- bta/gatt/bta_gattc_act.cc | 2 +- bta/hh/bta_hh_int.h | 4 +--- bta/include/bta_gatt_api.h | 3 +-- bta/vc/vc.cc | 3 ++- bta/vc/vc_test.cc | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/bta/gatt/bta_gattc_act.cc b/bta/gatt/bta_gattc_act.cc index bd54a76c2..76a3ce1b7 100644 --- a/bta/gatt/bta_gattc_act.cc +++ b/bta/gatt/bta_gattc_act.cc @@ -546,7 +546,7 @@ void bta_gattc_close(tBTA_GATTC_CLCB* p_clcb, tBTA_GATTC_DATA* p_data) { cb_data.close.client_if = p_clcb->p_rcb->client_if; cb_data.close.conn_id = p_clcb->bta_conn_id; - cb_data.close.reason = 0; + cb_data.close.reason = GATT_CONN_OK; cb_data.close.remote_bda = p_clcb->bda; cb_data.close.status = GATT_SUCCESS; diff --git a/bta/hh/bta_hh_int.h b/bta/hh/bta_hh_int.h index d9e506284..a1a8df34f 100644 --- a/bta/hh/bta_hh_int.h +++ b/bta/hh/bta_hh_int.h @@ -130,9 +130,7 @@ typedef struct { typedef struct { BT_HDR_RIGID hdr; uint16_t conn_id; - tBTA_GATT_REASON reason; /* disconnect reason code, not useful when connect - event is reported */ - + tGATT_DISCONN_REASON reason; } tBTA_HH_LE_CLOSE; typedef struct { diff --git a/bta/include/bta_gatt_api.h b/bta/include/bta_gatt_api.h index 2aabcdca7..65cf2756d 100644 --- a/bta/include/bta_gatt_api.h +++ b/bta/include/bta_gatt_api.h @@ -183,8 +183,7 @@ typedef struct { tGATT_STATUS status; tGATT_IF client_if; RawAddress remote_bda; - tBTA_GATT_REASON reason; /* disconnect reason code, not useful when connect - event is reported */ + tGATT_DISCONN_REASON reason; } tBTA_GATTC_CLOSE; typedef struct { diff --git a/bta/vc/vc.cc b/bta/vc/vc.cc index 97b8266e9..ee9461395 100644 --- a/bta/vc/vc.cc +++ b/bta/vc/vc.cc @@ -344,7 +344,8 @@ class VolumeControlImpl : public VolumeControl { } void OnGattDisconnected(uint16_t connection_id, tGATT_IF /*client_if*/, - RawAddress remote_bda, tBTA_GATT_REASON /*reason*/) { + RawAddress remote_bda, + tGATT_DISCONN_REASON /*reason*/) { VolumeControlDevice* device = volume_control_devices_.FindByConnId(connection_id); if (!device) { diff --git a/bta/vc/vc_test.cc b/bta/vc/vc_test.cc index 30eef87fa..1d45fa881 100644 --- a/bta/vc/vc_test.cc +++ b/bta/vc/vc_test.cc @@ -344,7 +344,7 @@ class VolumeControlTest : public ::testing::Test { .conn_id = conn_id, .client_if = gatt_if, .remote_bda = address, - .reason = HCI_ERR_PEER_USER, + .reason = GATT_CONN_TERMINATE_PEER_USER, }; gatt_callback(BTA_GATTC_CLOSE_EVT, (tBTA_GATTC*)&event_data); -- 2.11.0