Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cc5427d3 authored by Chris Manton's avatar Chris Manton
Browse files

btm_log: Streamline hid logging

Bug: 163134718
Test: gd/cert/run
Tag: #refactor
No-Typo-Check: Legacy code mocks
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: If3f967ddabe64c481536debd44a31b989eff1565
parent f13a2245
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -479,8 +479,6 @@ void bta_hh_api_disc_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
              PRIVATE_ADDRESS(p_cb->addr));

    bta_hh_le_api_disc_act(p_cb);
    BTM_LogHistory(kBtmLogTag, p_cb->addr, "Closed",
                   base::StringPrintf("le local initiated"));

  } else {
    const uint8_t hid_handle =
@@ -500,9 +498,6 @@ void bta_hh_api_disc_act(tBTA_HH_DEV_CB* p_cb, tBTA_HH_DATA* p_data) {
                       .handle = hid_handle},
    };
    (*bta_hh_cb.p_cback)(BTA_HH_CLOSE_EVT, &bta_hh);
    BTM_LogHistory(kBtmLogTag, p_cb->addr, "Closed",
                   base::StringPrintf("classic local reason %s",
                                      hid_status_text(status).c_str()));
  }
}

+5 −3
Original line number Diff line number Diff line
@@ -149,7 +149,8 @@ tHID_STATUS hidh_conn_disconnect(uint8_t dhandle) {
    else if (p_hcon->ctrl_cid)
      hidh_l2cif_disconnect(p_hcon->ctrl_cid);

    BTM_LogHistory(kBtmLogTag, hh_cb.devices[dhandle].addr, "Disconnecting");
    BTM_LogHistory(kBtmLogTag, hh_cb.devices[dhandle].addr, "Disconnecting",
                   "local initiated");
  } else {
    p_hcon->conn_state = HID_CONN_STATE_UNUSED;
  }
@@ -502,8 +503,9 @@ static void hidh_l2cif_disconnect_ind(uint16_t l2cap_cid, bool ack_needed) {
  p_hcon->conn_state = HID_CONN_STATE_DISCONNECTING;
  BTM_LogHistory(
      kBtmLogTag, hh_cb.devices[dhandle].addr, "Disconnecting",
      base::StringPrintf(
          "%s", (l2cap_cid == p_hcon->ctrl_cid) ? "control" : "interrupt"));
      base::StringPrintf("%s channel", (l2cap_cid == p_hcon->ctrl_cid)
                                           ? "control"
                                           : "interrupt"));

  if (l2cap_cid == p_hcon->ctrl_cid)
    p_hcon->ctrl_cid = 0;