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

Commit 4fe2b45f authored by Hsin-chen Chuang's avatar Hsin-chen Chuang
Browse files

floss: Remove the TARGET_FLOSS that are used for enabling Aflags

Before Aflags are supported on ChromeOS, we use TARGET_FLOSS to enable
them. Now we are able to enable through aflags.conf and remove the
TARGET_FLOSS.

NOTE: Merge this after https://crrev.com/c/5524439 and
      https://r.android.com/3071603

Bug: 339340027
Tag: #floss
Test: mmm packages/modules/Bluetooth
Flag: EXEMPT, Floss-only changes
Change-Id: I3579b6cf66f551e10078b4b5a8100497a0901c76
parent ae4c4168
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -140,12 +140,7 @@ void bta_ag_process_at(tBTA_AG_AT_CB* p_cb, char* p_end) {
      /* if it's a set integer check max, min range */
      if (arg_type == BTA_AG_AT_SET &&
          p_cb->p_at_tbl[idx].fmt == BTA_AG_AT_INT) {
#if TARGET_FLOSS
        if (true)
#else
        if (com::android::bluetooth::flags::bta_ag_cmd_brsf_allow_uint32())
#endif
        {
        if (com::android::bluetooth::flags::bta_ag_cmd_brsf_allow_uint32()) {
          if (p_cb->p_at_tbl[idx].command_id == BTA_AG_LOCAL_EVT_BRSF) {
            // Per HFP v1.9 BRSF could be 32-bit integer and we should ignore
            // all reserved bits rather than responding ERROR.
+1 −33
Original line number Diff line number Diff line
@@ -221,11 +221,7 @@ static void bta_ag_sco_disc_cback(uint16_t sco_idx) {
    /* Restore settings */
    if (bta_ag_cb.sco.p_curr_scb->inuse_codec == UUID_CODEC_MSBC ||
        bta_ag_cb.sco.p_curr_scb->inuse_codec == UUID_CODEC_LC3 || aptx_voice ||
#if TARGET_FLOSS
        (true &&
#else
        (com::android::bluetooth::flags::fix_hfp_qual_1_9() &&
#endif
         bta_ag_cb.sco.p_curr_scb->inuse_codec == UUID_CODEC_CVSD &&
         bta_ag_cb.sco.p_curr_scb->codec_cvsd_settings !=
             BTA_AG_SCO_CVSD_SETTINGS_S1)) {
@@ -239,20 +235,12 @@ static void bta_ag_sco_disc_cback(uint16_t sco_idx) {
       * 'Safe setting' first. If T1 also fails, try CVSD
       * same operations for LC3 settings */
      if (bta_ag_sco_is_opening(bta_ag_cb.sco.p_curr_scb) &&
#if TARGET_FLOSS
          (false ||
#else
          (!com::android::bluetooth::flags::fix_hfp_qual_1_9() ||
#endif
           bta_ag_cb.sco.is_local)) {
        /* Don't bother to edit |p_curr_scb->state| because it is in
         * |BTA_AG_OPEN_ST|, which has the same value as |BTA_AG_SCO_CODEC_ST|
         */
#if TARGET_FLOSS
        if (false) {
#else
        if (!com::android::bluetooth::flags::fix_hfp_qual_1_9()) {
#endif
          bta_ag_cb.sco.p_curr_scb->state = BTA_AG_SCO_CODEC_ST;
        }
        if (bta_ag_cb.sco.p_curr_scb->inuse_codec == UUID_CODEC_LC3) {
@@ -283,7 +271,7 @@ static void bta_ag_sco_disc_cback(uint16_t sco_idx) {
          }
        } else {
          // Entering this block implies
          // - |fix_hfp_qual_1_9| is enabled or is in Floss, AND
          // - |fix_hfp_qual_1_9| is enabled, AND
          // - we just failed CVSD S2+.
          log::warn(
              "eSCO/SCO failed to open, falling back to CVSD S1 settings");
@@ -293,21 +281,13 @@ static void bta_ag_sco_disc_cback(uint16_t sco_idx) {
        }
      }
    } else if (bta_ag_sco_is_opening(bta_ag_cb.sco.p_curr_scb) &&
#if TARGET_FLOSS
               (false ||
#else
               (!com::android::bluetooth::flags::fix_hfp_qual_1_9() ||
#endif
                bta_ag_cb.sco.is_local)) {
      if (com::android::bluetooth::flags::
              retry_esco_with_zero_retransmission_effort() &&
          bta_ag_cb.sco.p_curr_scb->retransmission_effort_retries == 0) {
        bta_ag_cb.sco.p_curr_scb->retransmission_effort_retries++;
#if TARGET_FLOSS
        if (false) {
#else
        if (!com::android::bluetooth::flags::fix_hfp_qual_1_9()) {
#endif
          bta_ag_cb.sco.p_curr_scb->state = BTA_AG_SCO_CODEC_ST;
        }
        log::warn("eSCO/SCO failed to open, retry with retransmission_effort");
@@ -541,11 +521,7 @@ void bta_ag_create_sco(tBTA_AG_SCB* p_scb, bool is_orig) {
      params = esco_parameters_for_codec(ESCO_CODEC_SWB_Q0, true);
    }
  } else {
#if TARGET_FLOSS
    if (true &&
#else
    if (com::android::bluetooth::flags::fix_hfp_qual_1_9() &&
#endif
        p_scb->codec_cvsd_settings == BTA_AG_SCO_CVSD_SETTINGS_S1) {
      params = esco_parameters_for_codec(ESCO_CODEC_CVSD_S1, offload);
    } else {
@@ -676,11 +652,7 @@ void bta_ag_create_pending_sco(tBTA_AG_SCB* p_scb, bool is_local) {
        params = esco_parameters_for_codec(ESCO_CODEC_MSBC_T1, offload);
      }
    } else {
#if TARGET_FLOSS
      if (true &&
#else
      if (com::android::bluetooth::flags::fix_hfp_qual_1_9() &&
#endif
          p_scb->codec_cvsd_settings == BTA_AG_SCO_CVSD_SETTINGS_S1) {
        params = esco_parameters_for_codec(ESCO_CODEC_CVSD_S1, offload);
      } else {
@@ -1590,11 +1562,7 @@ void bta_ag_sco_conn_close(tBTA_AG_SCB* p_scb, const tBTA_AG_DATA& /* data */) {
            retry_esco_with_zero_retransmission_effort() &&
        p_scb->retransmission_effort_retries == 1) ||
       aptx_voice ||
#if TARGET_FLOSS
       (true &&
#else
       (com::android::bluetooth::flags::fix_hfp_qual_1_9() &&
#endif
        p_scb->sco_codec == BTM_SCO_CODEC_CVSD &&
        p_scb->codec_cvsd_settings == BTA_AG_SCO_CVSD_SETTINGS_S1 &&
        p_scb->trying_cvsd_safe_settings))) {
+0 −2
Original line number Diff line number Diff line
@@ -164,13 +164,11 @@ static void bta_dm_search_cancel() {
     active */
  else if (!bta_dm_search_cb.name_discover_done) {
    get_btm_client_interface().peer.BTM_CancelRemoteDeviceName();
#ifndef TARGET_FLOSS
    /* bta_dm_search_cmpl is called when receiving the remote name cancel evt */
    if (!com::android::bluetooth::flags::
            bta_dm_defer_device_discovery_state_change_until_rnr_complete()) {
      bta_dm_search_cmpl();
    }
#endif
  } else {
    bta_dm_inq_cmpl();
  }
+0 −2
Original line number Diff line number Diff line
@@ -322,13 +322,11 @@ static void bta_dm_search_cancel() {
     active */
  else if (!bta_dm_search_cb.name_discover_done) {
    get_btm_client_interface().peer.BTM_CancelRemoteDeviceName();
#ifndef TARGET_FLOSS
    /* bta_dm_search_cmpl is called when receiving the remote name cancel evt */
    if (!com::android::bluetooth::flags::
            bta_dm_defer_device_discovery_state_change_until_rnr_complete()) {
      bta_dm_search_cmpl();
    }
#endif
  } else {
    bta_dm_inq_cmpl();
  }
+1 −6
Original line number Diff line number Diff line
@@ -1473,12 +1473,7 @@ void bta_jv_rfcomm_connect(tBTA_SEC sec_mask, uint8_t remote_scn,
  memset(&evt_data, 0, sizeof(evt_data));
  evt_data.status = tBTA_JV_STATUS::SUCCESS;

#ifdef TARGET_FLOSS
  if (true)
#else
  if (com::android::bluetooth::flags::rfcomm_always_use_mitm())
#endif
  {
  if (com::android::bluetooth::flags::rfcomm_always_use_mitm()) {
    // Update security service record for RFCOMM client so that
    // secure RFCOMM connection will be authenticated with MTIM protection
    // while creating the L2CAP connection.
Loading