OSDN Git Service

Check power mode only on classic links
authorChris Manton <cmanton@google.com>
Wed, 23 Sep 2020 17:11:30 +0000 (10:11 -0700)
committerChris Manton <cmanton@google.com>
Thu, 8 Oct 2020 15:34:48 +0000 (15:34 +0000)
Towards loggable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Test: act.py -tc BleCocTest
Change-Id: Ie70a5fecea4909a4755f98b9393843371009a2a3

stack/acl/btm_pm.cc

index 8945a95..5eef579 100644 (file)
@@ -146,8 +146,11 @@ tBTM_STATUS BTM_SetPowerMode(uint8_t pm_id, const RawAddress& remote_bda,
 
   int acl_ind = btm_pm_find_acl_ind(remote_bda);
   if (acl_ind == MAX_L2CAP_LINKS) {
-    LOG_ERROR("addr %s is unknown", remote_bda.ToString().c_str());
-    return (BTM_UNKNOWN_ADDR);
+    if (btm_pm_is_le_link(remote_bda)) {
+      return BTM_MODE_UNSUPPORTED;
+    }
+    LOG_ERROR("br_edr acl addr %s is unknown", remote_bda.ToString().c_str());
+    return BTM_UNKNOWN_ADDR;
   }
 
   // per ACL link