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

Commit 97e1c484 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11498394 from 573c2ad8 to 24Q2-release

Change-Id: Iecd80dbb874568d62ba095046e0ee650672248fd
parents 1196120c 573c2ad8
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ import com.android.bluetooth.ObexServerSockets;
import com.android.bluetooth.btservice.AdapterService;
import com.android.bluetooth.btservice.ProfileService;
import com.android.bluetooth.content_profiles.ContentProfileErrorReportUtils;
import com.android.bluetooth.flags.Flags;
import com.android.bluetooth.sdp.SdpManagerNativeInterface;
import com.android.internal.annotations.VisibleForTesting;
import com.android.obex.ObexTransport;
@@ -289,7 +290,11 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti
                    1);
        }
        setBluetoothOppService(null);
        if (Flags.oppServiceFixIndexOutOfBoundsExceptionInUpdateThread()) {
            stopInternal();
        } else {
            mHandler.sendMessage(mHandler.obtainMessage(STOP_LISTENER));
        }

        setComponentAvailable(OPP_PROVIDER, false);
        setComponentAvailable(INCOMING_FILE_CONFIRM_ACTIVITY, false);
@@ -555,7 +560,9 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti
        if (V) {
            Log.v(TAG, "onDestroy");
        }
        if (!Flags.oppServiceFixIndexOutOfBoundsExceptionInUpdateThread()) {
            stopListeners();
        }
        if (mBatches != null) {
            mBatches.clear();
        }
@@ -685,7 +692,9 @@ public class BluetoothOppService extends ProfileService implements IObexConnecti
                        if (V) {
                            Log.v(TAG, "Bluetooth state changed: STATE_TURNING_OFF");
                        }
                        if (!Flags.oppServiceFixIndexOutOfBoundsExceptionInUpdateThread()) {
                            mHandler.sendMessage(mHandler.obtainMessage(STOP_LISTENER));
                        }
                        break;
                }
            }
+7 −0
Original line number Diff line number Diff line
@@ -7,3 +7,10 @@ flag {
    description: "Provide l2cap transmit complete information b/301168932"
    bug: "314819704"
}

flag {
    name: "l2cap_p_ccb_check_rewrite"
    namespace: "bluetooth"
    description: "Rewrite logic of p_ccb check in l2c_link_sec_comp"
    bug: "326686472"
}
+22 −30
Original line number Diff line number Diff line
@@ -23,6 +23,8 @@
 *
 ******************************************************************************/

#include <bluetooth/log.h>

#include "bta/hf_client/bta_hf_client_int.h"
#include "bta/include/bta_dm_api.h"
#include "os/log.h"
@@ -31,6 +33,8 @@
#include "stack/include/sdp_status.h"
#include "types/raw_address.h"

using namespace bluetooth;

/*****************************************************************************
 *  Constants
 ****************************************************************************/
@@ -52,8 +56,7 @@ void bta_hf_client_start_close(tBTA_HF_CLIENT_DATA* p_data) {
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: wrong handle to control block %d", __func__,
              p_data->hdr.layer_specific);
    log::error("wrong handle to control block {}", p_data->hdr.layer_specific);
    return;
  }

@@ -86,8 +89,7 @@ void bta_hf_client_start_open(tBTA_HF_CLIENT_DATA* p_data) {
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: wrong handle to control block %d", __func__,
              p_data->hdr.layer_specific);
    log::error("wrong handle to control block {}", p_data->hdr.layer_specific);
    return;
  }

@@ -125,12 +127,11 @@ void bta_hf_client_start_open(tBTA_HF_CLIENT_DATA* p_data) {
 *
 ******************************************************************************/
void bta_hf_client_rfc_open(tBTA_HF_CLIENT_DATA* p_data) {
  LOG_VERBOSE("%s", __func__);
  log::verbose("");
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }

@@ -151,25 +152,24 @@ void bta_hf_client_rfc_open(tBTA_HF_CLIENT_DATA* p_data) {
 *
 ******************************************************************************/
void bta_hf_client_rfc_acp_open(tBTA_HF_CLIENT_DATA* p_data) {
  LOG_VERBOSE("%s", __func__);
  log::verbose("");
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }
  /* set role */
  client_cb->role = BTA_HF_CLIENT_ACP;

  LOG_VERBOSE("%s: conn_handle %d", __func__, client_cb->conn_handle);
  log::verbose("conn_handle {}", client_cb->conn_handle);

  /* get bd addr of peer */
  uint16_t lcid = 0;
  RawAddress dev_addr = RawAddress::kEmpty;
  int status = PORT_CheckConnection(client_cb->conn_handle, &dev_addr, &lcid);
  if (status != PORT_SUCCESS) {
    LOG_ERROR("PORT_CheckConnection returned status:%d", status);
    log::error("PORT_CheckConnection returned status:{}", status);
  }

  /* Collision Handling */
@@ -209,8 +209,7 @@ void bta_hf_client_rfc_fail(tBTA_HF_CLIENT_DATA* p_data) {
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }

@@ -239,8 +238,7 @@ void bta_hf_client_disc_fail(tBTA_HF_CLIENT_DATA* p_data) {
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }
}
@@ -259,8 +257,7 @@ void bta_hf_client_open_fail(tBTA_HF_CLIENT_DATA* p_data) {
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }
}
@@ -279,8 +276,7 @@ void bta_hf_client_rfc_close(tBTA_HF_CLIENT_DATA* p_data) {
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }

@@ -322,12 +318,11 @@ void bta_hf_client_rfc_close(tBTA_HF_CLIENT_DATA* p_data) {
void bta_hf_client_disc_int_res(tBTA_HF_CLIENT_DATA* p_data) {
  uint16_t event = BTA_HF_CLIENT_DISC_FAIL_EVT;

  LOG_VERBOSE("%s: Status: %d", __func__, p_data->disc_result.status);
  log::verbose("Status: {}", p_data->disc_result.status);
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }

@@ -361,8 +356,7 @@ void bta_hf_client_disc_acp_res(tBTA_HF_CLIENT_DATA* p_data) {
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }

@@ -391,8 +385,7 @@ void bta_hf_client_rfc_data(tBTA_HF_CLIENT_DATA* p_data) {
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }

@@ -427,12 +420,11 @@ void bta_hf_client_rfc_data(tBTA_HF_CLIENT_DATA* p_data) {
 *
 ******************************************************************************/
void bta_hf_client_svc_conn_open(tBTA_HF_CLIENT_DATA* p_data) {
  LOG_VERBOSE("%s", __func__);
  log::verbose("");
  tBTA_HF_CLIENT_CB* client_cb =
      bta_hf_client_find_cb_by_handle(p_data->hdr.layer_specific);
  if (client_cb == NULL) {
    LOG_ERROR("%s: cb not found for handle %d", __func__,
              p_data->hdr.layer_specific);
    log::error("cb not found for handle {}", p_data->hdr.layer_specific);
    return;
  }

+5 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include "bta/include/bta_hf_client_api.h"

#include <android_bluetooth_sysprop.h>
#include <bluetooth/log.h>

#include <cstdint>

@@ -38,6 +39,8 @@
#include "stack/include/bt_hdr.h"
#include "types/raw_address.h"

using namespace bluetooth;

/*****************************************************************************
 *  External Function Declarations
 ****************************************************************************/
@@ -85,12 +88,12 @@ void BTA_HfClientDisable(void) { bta_hf_client_api_disable(); }
 *
 ******************************************************************************/
bt_status_t BTA_HfClientOpen(const RawAddress& bd_addr, uint16_t* p_handle) {
  LOG_VERBOSE("%s", __func__);
  log::verbose("");
  tBTA_HF_CLIENT_API_OPEN* p_buf =
      (tBTA_HF_CLIENT_API_OPEN*)osi_malloc(sizeof(tBTA_HF_CLIENT_API_OPEN));

  if (!bta_hf_client_allocate_handle(bd_addr, p_handle)) {
    LOG_ERROR("%s: could not allocate handle", __func__);
    log::error("could not allocate handle");
    return BT_STATUS_FAIL;
  }

+114 −115

File changed.

Preview size limit exceeded, changes collapsed.

Loading