OSDN Git Service

Fix for dual-mode devices advertising with a single address
authorJack He <siyuanh@google.com>
Thu, 16 Feb 2017 08:06:15 +0000 (03:06 -0500)
committerJack He <siyuanh@google.com>
Thu, 2 Mar 2017 18:49:34 +0000 (10:49 -0800)
commit8bf2285959ffb8960f1bf01499c15cfa1e2ccf16
treecde9dcb0b25258acb2d4e38a75584769d5c3a300
parent20d25f4a11bc112612dc31395d0fb01f839aeeff
Fix for dual-mode devices advertising with a single address

* BTM_ReadRemoteDeviceName checks if a device is connectable over LE before
  making a connection. However, when it is not connectable over LE, it could
  be connectable over BR/EDR.
* For Dual Mode device, the device type should be 0x3 and is not equal to
  BT_DEVICE_TYPE_BREDR, hence we cannot check equality to determine whether
  a device is BR/EDR, but need to AND them and check the result.
* btm_ble_read_remote_name() already checks if device is connectable in LE,
  and we do not need to do it in BTM_ReadRemoteDeviceName().
* This fix removes the check from BTM_ReadRemoteDeviceName
* This fix also adds error checking to return values of BTM_ReadRemoteDeviceName
* This fix moves inquiry database query to respective remote name
  request procedures, as the result of the query is used in those
  procedures instead of in BTM_ReadRemoteDeviceName()

Bug: 35348392
Test: make, pair with device that advertise on both LE and BR/EDR
Change-Id: I10d1aa9dd6e2447f9b9d40b1fea9370b5088a57d
stack/btm/btm_ble_gap.cc
stack/btm/btm_ble_int.h
stack/btm/btm_inq.cc
stack/btm/btm_int.h
stack/btm/btm_sec.cc