From: Chris Manton Date: Wed, 13 Jan 2021 01:19:57 +0000 (-0800) Subject: gd: Include hci handle in unsuccessful mode change event X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=1abed54019d8e76d52a71657c436a9232018385a;p=android-x86%2Fsystem-bt.git gd: Include hci handle in unsuccessful mode change event Bug: 177296647 Test: cert Tag: #refactor Change-Id: I685a32202edbf95ee285cc577497ea0d0f18e036 --- diff --git a/gd/hci/acl_manager/classic_impl.h b/gd/hci/acl_manager/classic_impl.h index 9f2f21df5..8a36e75e1 100644 --- a/gd/hci/acl_manager/classic_impl.h +++ b/gd/hci/acl_manager/classic_impl.h @@ -407,13 +407,14 @@ struct classic_impl : public security::ISecurityManagerListener { if (!mode_change_view.IsValid()) { LOG_ERROR("Received on_mode_change with invalid packet"); return; - } else if (mode_change_view.GetStatus() != ErrorCode::SUCCESS) { - auto status = mode_change_view.GetStatus(); + } + auto status = mode_change_view.GetStatus(); + uint16_t handle = mode_change_view.GetConnectionHandle(); + if (status != ErrorCode::SUCCESS) { std::string error_code = ErrorCodeText(status); - LOG_ERROR("Received on_mode_change with error code %s", error_code.c_str()); + LOG_ERROR("Received on_mode_change on handle 0x0%04hx with error code %s", handle, error_code.c_str()); return; } - uint16_t handle = mode_change_view.GetConnectionHandle(); auto callbacks = get_callbacks(handle); if (callbacks == nullptr) { LOG_WARN("Unknown connection handle 0x%04hx", handle);