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

Commit a404eb80 authored by HsingYuan Lo's avatar HsingYuan Lo Committed by Automerger Merge Worker
Browse files

Merge "Expose service changed event to application (1/3)" am: 4a7b5faf

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

Change-Id: If50a9798d140cccaa54f29009cea94afeb991a95
parents 426d6d86 4a7b5faf
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -39,4 +39,5 @@ oneway interface IBluetoothGattCallback {
    void onConfigureMTU(in String address, in int mtu, in int status);
    void onConnectionUpdated(in String address, in int interval, in int latency,
                             in int timeout, in int status);
    void onServiceChanged(in String address);
}
+2 −1
Original line number Diff line number Diff line
@@ -1164,7 +1164,8 @@ bool bta_gattc_process_srvc_chg_ind(uint16_t conn_id, tBTA_GATTC_RCB* p_clrcb,
  /* notify applicationf or service change */
  if (p_clrcb->p_cback) {
    tBTA_GATTC bta_gattc;
    bta_gattc.remote_bda = p_srcb->server_bda;
    bta_gattc.service_changed.remote_bda = p_srcb->server_bda;
    bta_gattc.service_changed.conn_id = conn_id;
    (*p_clrcb->p_cback)(BTA_GATTC_SRVC_CHG_EVT, &bta_gattc);
  }

+1 −1
Original line number Diff line number Diff line
@@ -1729,7 +1729,7 @@ void hearingaid_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {

    case BTA_GATTC_SRVC_DISC_DONE_EVT:
      if (!instance) return;
      instance->OnServiceDiscDoneEvent(p_data->remote_bda);
      instance->OnServiceDiscDoneEvent(p_data->service_changed.remote_bda);
      break;

    default:
+6 −0
Original line number Diff line number Diff line
@@ -202,6 +202,11 @@ typedef struct {
  tGATT_STATUS status;
} tBTA_GATTC_CONN_UPDATE;

typedef struct {
  RawAddress remote_bda;
  uint16_t conn_id;
} tBTA_GATTC_SERVICE_CHANGED;

typedef union {
  tGATT_STATUS status;

@@ -220,6 +225,7 @@ typedef union {
  tBTA_GATTC_CONGEST congest;
  tBTA_GATTC_PHY_UPDATE phy_update;
  tBTA_GATTC_CONN_UPDATE conn_update;
  tBTA_GATTC_SERVICE_CHANGED service_changed;
} tBTA_GATTC;

/* GATTC enable callback function */
+5 −0
Original line number Diff line number Diff line
@@ -190,6 +190,11 @@ void btif_gattc_upstreams_evt(uint16_t event, char* p_param) {
                p_data->conn_update.status);
      break;

    case BTA_GATTC_SRVC_CHG_EVT:
      HAL_CBACK(bt_gatt_callbacks, client->service_changed_cb,
                p_data->service_changed.conn_id);
      break;

    default:
      LOG_ERROR("%s: Unhandled event (%d)!", __func__, event);
      break;
Loading