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

Commit 66bee3fc authored by Chris Manton's avatar Chris Manton
Browse files

Skip bta_sys to post on main handler BTA_GATTC_Open

Bug: 188297078
Test: gd/cert/run
Tag: #refactor

Change-Id: Idd88190d94d7999880f1a82f1a8f958777e9e251
parent dd206316
Loading
Loading
Loading
Loading
+17 −12
Original line number Diff line number Diff line
@@ -127,18 +127,23 @@ void BTA_GATTC_Open(tGATT_IF client_if, const RawAddress& remote_bda,
void BTA_GATTC_Open(tGATT_IF client_if, const RawAddress& remote_bda,
                    bool is_direct, tBT_TRANSPORT transport, bool opportunistic,
                    uint8_t initiating_phys) {
  tBTA_GATTC_API_OPEN* p_buf =
      (tBTA_GATTC_API_OPEN*)osi_malloc(sizeof(tBTA_GATTC_API_OPEN));

  p_buf->hdr.event = BTA_GATTC_API_OPEN_EVT;
  p_buf->client_if = client_if;
  p_buf->is_direct = is_direct;
  p_buf->transport = transport;
  p_buf->initiating_phys = initiating_phys;
  p_buf->opportunistic = opportunistic;
  p_buf->remote_bda = remote_bda;

  bta_sys_sendmsg(p_buf);
  tBTA_GATTC_DATA data = {
      .api_conn =
          {
              .hdr =
                  {
                      .event = BTA_GATTC_API_OPEN_EVT,
                  },
              .remote_bda = remote_bda,
              .client_if = client_if,
              .is_direct = is_direct,
              .transport = transport,
              .initiating_phys = initiating_phys,
              .opportunistic = opportunistic,
          },
  };

  post_on_bt_main([data]() { bta_gattc_process_api_open(&data); });
}

/*******************************************************************************