Set the BLE phy to 2M if the BT controller and peer Hearing Aid device
indicate phy 2M support, otherwise, use default phy channel.
Bug:
135769508
Test: 1.Forget/Repair Hearing Aid device check whether phy is expected.
2.Disconnect/Reconnect Hearing Aid device check whether phy is expected.
3.HearingAid device power off/on, check whether phy is expected.
Change-Id: Ib410a8885f3a68c361bb97d5c9a3833f2a1be528
hearingDevice->connection_update_status = AWAITING;
}
+ tACL_CONN* p_acl = btm_bda_to_acl(address, BT_TRANSPORT_LE);
+ if (p_acl != nullptr && controller_get_interface()->supports_ble_2m_phy() &&
+ HCI_LE_2M_PHY_SUPPORTED(p_acl->peer_le_features)) {
+ LOG(INFO) << address << " set preferred PHY to 2M";
+ BTM_BleSetPhy(address, PHY_LE_2M, PHY_LE_2M, 0);
+ }
+
// Set data length
// TODO(jpawlowski: for 16khz only 87 is required, optimize
BTM_SetBleDataLength(address, 167);