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

Commit 9b7145f7 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/20606225',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/20606225', 'googleplex-android-review.googlesource.com/20617177', 'googleplex-android-review.googlesource.com/20617178', 'googleplex-android-review.googlesource.com/21421885', 'googleplex-android-review.googlesource.com/20995769', 'googleplex-android-review.googlesource.com/21328653'] into tm-qpr2-release.

Change-Id: Ie67b587ac3412fef382856a926110dbc7c3a9381
parents 491183fe 138fed29
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -4004,6 +4004,11 @@ static void bta_dm_gatt_disc_complete(uint16_t conn_id, tGATT_STATUS status) {
                        BTA_DM_GATT_CLOSE_DELAY_TOUT,
                        BTA_DM_DISC_CLOSE_TOUT_EVT, 0);
    bta_dm_search_cb.pending_close_bda = bta_dm_search_cb.peer_bdaddr;
  } else {
    if (bluetooth::common::init_flags::
            bta_dm_clear_conn_id_on_client_close_is_enabled()) {
      bta_dm_search_cb.conn_id = GATT_INVALID_CONN_ID;
    }
  }
  bta_dm_search_cb.gatt_disc_active = false;
}
@@ -4136,7 +4141,8 @@ static void bta_dm_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {
      break;

    case BTA_GATTC_CLOSE_EVT:
      LOG_DEBUG("BTA_GATTC_CLOSE_EVT reason = %d", p_data->close.reason);
      LOG_INFO("BTA_GATTC_CLOSE_EVT reason = %d", p_data->close.reason);

      /* in case of disconnect before search is completed */
      if ((bta_dm_search_cb.state != BTA_DM_SEARCH_IDLE) &&
          (bta_dm_search_cb.state != BTA_DM_SEARCH_ACTIVE) &&
+22 −2
Original line number Diff line number Diff line
@@ -61,8 +61,8 @@ uint8_t bta_dm_search_get_state() { return bta_dm_search_cb.state; }
 *
 ******************************************************************************/
bool bta_dm_search_sm_execute(BT_HDR_RIGID* p_msg) {
  APPL_TRACE_EVENT("bta_dm_search_sm_execute state:%d, event:0x%x",
                   bta_dm_search_cb.state, p_msg->event);
  LOG_INFO("bta_dm_search_sm_execute state:%d, event:0x%x",
           bta_dm_search_get_state(), p_msg->event);

  tBTA_DM_MSG* message = (tBTA_DM_MSG*)p_msg;
  switch (bta_dm_search_cb.state) {
@@ -123,6 +123,16 @@ bool bta_dm_search_sm_execute(BT_HDR_RIGID* p_msg) {
          bta_dm_search_cancel_notify();
          bta_dm_execute_queued_request();
          break;
        case BTA_DM_DISC_CLOSE_TOUT_EVT:
          if (bluetooth::common::init_flags::
                  bta_dm_clear_conn_id_on_client_close_is_enabled()) {
            bta_dm_close_gatt_conn(message);
            break;
          }
          [[fallthrough]];
        default:
          LOG_INFO("Received unexpected event 0x%x in state %d", p_msg->event,
                   bta_dm_search_cb.state);
      }
      break;
    case BTA_DM_DISCOVER_ACTIVE:
@@ -145,6 +155,16 @@ bool bta_dm_search_sm_execute(BT_HDR_RIGID* p_msg) {
        case BTA_DM_API_DISCOVER_EVT:
          bta_dm_queue_disc(message);
          break;
        case BTA_DM_DISC_CLOSE_TOUT_EVT:
          if (bluetooth::common::init_flags::
                  bta_dm_clear_conn_id_on_client_close_is_enabled()) {
            bta_dm_close_gatt_conn(message);
            break;
          }
          [[fallthrough]];
        default:
          LOG_INFO("Received unexpected event 0x%x in state %d", p_msg->event,
                   bta_dm_search_cb.state);
      }
      break;
  }
+13 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "bta/hh/bta_hh_int.h"
#include "btif/include/btif_debug_conn.h"
#include "device/include/controller.h"
#include "device/include/interop.h"
#include "main/shim/dumpsys.h"
#include "osi/include/allocator.h"
#include "osi/include/log.h"
@@ -802,6 +803,18 @@ void bta_gattc_start_discover(tBTA_GATTC_CLCB* p_clcb,
        p_clcb->p_srcb->srvc_hdl_db_hash = false;
      }

      // Some LMP 5.2 devices also don't support robust caching. This workaround
      // conditionally disables the feature based on a combination of LMP
      // version and OUI prefix.
      if (lmp_version < 0x0c &&
          interop_match_addr(INTEROP_DISABLE_ROBUST_CACHING, &p_clcb->bda)) {
        LOG_WARN(
            "Device LMP version 0x%02x <= Bluetooth 5.2 and MAC addr on "
            "interop list, skipping robust caching",
            lmp_version);
        p_clcb->p_srcb->srvc_hdl_db_hash = false;
      }

      /* read db hash if db hash characteristic exists */
      if (bta_gattc_is_robust_caching_enabled() &&
          p_clcb->p_srcb->srvc_hdl_db_hash &&
+5 −0
Original line number Diff line number Diff line
@@ -1959,6 +1959,11 @@ static bt_status_t register_notification_rsp(
                   dump_rc_notification_event_id(event_id));
  std::unique_lock<std::mutex> lock(btif_rc_cb.lock);

  if (event_id > MAX_RC_NOTIFICATIONS) {
    BTIF_TRACE_ERROR("Invalid event id");
    return BT_STATUS_PARM_INVALID;
  }

  memset(&(avrc_rsp.reg_notif), 0, sizeof(tAVRC_REG_NOTIF_RSP));

  avrc_rsp.reg_notif.event_id = event_id;
+8 −1
Original line number Diff line number Diff line
@@ -118,7 +118,14 @@ typedef enum {
  INTEROP_SLC_SKIP_BIND_COMMAND,

  // Respond AVRCP profile version only 1.3 for some device.
  INTEROP_AVRCP_1_3_ONLY
  INTEROP_AVRCP_1_3_ONLY,

  // Some remote devices have LMP version in[5.0, 5.2] but do not support
  // robust
  // caching or correctly response with an error. We disable the
  // database hash
  // lookup for such devices.
  INTEROP_DISABLE_ROBUST_CACHING,
} interop_feature_t;

// Check if a given |addr| matches a known interoperability workaround as
Loading