From 7547df3ebf73ee331ab2da2e483082966587dff4 Mon Sep 17 00:00:00 2001 From: Chris Manton Date: Wed, 7 Oct 2020 15:45:07 -0700 Subject: [PATCH] Streamline stack/acl/btm_acl::BTM_IsAclConnectionUp Bug: 163134718 Tag: #refactor Test: act.py -tc BleCocTest Test: ble paired 2 phones Test: classic paired Bose SoundLink Change-Id: I25899a6ee5a5b36c2731da3dba83179158ae74bb --- stack/acl/btm_acl.cc | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/stack/acl/btm_acl.cc b/stack/acl/btm_acl.cc index f19ee269c..7560f50cf 100644 --- a/stack/acl/btm_acl.cc +++ b/stack/acl/btm_acl.cc @@ -1211,30 +1211,9 @@ tBTM_STATUS BTM_SetLinkSuperTout(const RawAddress& remote_bda, return (BTM_UNKNOWN_ADDR); } -/******************************************************************************* - * - * Function BTM_IsAclConnectionUp - * - * Description This function is called to check if an ACL connection exists - * to a specific remote BD Address. - * - * Returns true if connection is up, else false. - * - ******************************************************************************/ bool BTM_IsAclConnectionUp(const RawAddress& remote_bda, tBT_TRANSPORT transport) { - tACL_CONN* p; - - VLOG(2) << __func__ << " RemBdAddr: " << remote_bda; - - p = internal_.btm_bda_to_acl(remote_bda, transport); - if (p != (tACL_CONN*)NULL) { - LOG_WARN("Unable to find active acl"); - return (true); - } - - /* If here, no BD Addr found */ - return (false); + return internal_.btm_bda_to_acl(remote_bda, transport) != nullptr; } bool BTM_IsAclConnectionUpAndHandleValid(const RawAddress& remote_bda, -- 2.11.0