Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96423438 authored by weichinweng's avatar weichinweng Committed by android-build-merger
Browse files

Merge "Hearing Aid: set BLE phy to 2M if local and peer indicate PHY 2M support"

am: 053253c0

Change-Id: I5a8c50bff2481280a13dbe5033bab5eafd98d56a
parents c5cdc2f9 053253c0
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -390,6 +390,13 @@ class HearingAidImpl : public HearingAid {
      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);