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

Commit c6ee23ed authored by Hansong Zhang's avatar Hansong Zhang Committed by Automerger Merge Worker
Browse files

LE L2cap shim: Implement fixed channel timeout am: a6835939

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1538089

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I659e4a0f116b3fc57d42c22b14c2da22accf6b1f
parents d2a3bee2 a6835939
Loading
Loading
Loading
Loading
+22 −4
Original line number Diff line number Diff line
@@ -637,9 +637,19 @@ bool L2CA_ConnectCreditBasedRsp(const RawAddress& bd_addr, uint8_t id,
 */
bool L2CA_SetIdleTimeoutByBdAddr(const RawAddress& bd_addr, uint16_t timeout,
                                 tBT_TRANSPORT transport) {
  if (transport == BT_TRANSPORT_BR_EDR) {
    LOG_INFO("UNIMPLEMENTED %s", __func__);
    return false;
  }
  constexpr int GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP = 1;
  if (timeout == 0 || timeout == GATT_LINK_IDLE_TIMEOUT_WHEN_NO_APP) {
    bluetooth::shim::L2CA_RemoveFixedChnl(kLeAttributeCid, bd_addr);
    return true;
  } else {
    LOG_INFO("UNIMPLEMENTED %s", __func__);
    return false;
  }
}

bool L2CA_SetAclPriority(const RawAddress& bd_addr, tL2CAP_PRIORITY priority) {
  LOG_INFO("UNIMPLEMENTED %s", __func__);
@@ -845,9 +855,17 @@ bool L2CA_SetTxPriority(uint16_t cid, tL2CAP_CHNL_PRIORITY priority) {

bool L2CA_SetFixedChannelTout(const RawAddress& rem_bda, uint16_t fixed_cid,
                              uint16_t idle_tout) {
  if (fixed_cid != kLeAttributeCid) {
    LOG_INFO("UNIMPLEMENTED %s", __func__);
    return false;
  }
  if (idle_tout == 0xffff) {
    bluetooth::shim::L2CA_ConnectFixedChnl(kLeAttributeCid, rem_bda);
  } else {
    bluetooth::shim::L2CA_RemoveFixedChnl(kLeAttributeCid, rem_bda);
  }
  return true;
}

bool L2CA_SetChnlFlushability(uint16_t cid, bool is_flushable) {
  LOG_INFO("UNIMPLEMENTED %s", __func__);