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

Commit 86c6259a authored by Zach Johnson's avatar Zach Johnson
Browse files

Flatten btif_context_switched

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: I565789de3b4d0a21667ff6a7d5f895dcdbc3d93c
parent 199db356
Loading
Loading
Loading
Loading
+3 −24
Original line number Diff line number Diff line
@@ -111,27 +111,6 @@ void btif_dm_enable_service(tBTA_SERVICE_ID service_id, bool enable);
void btif_dm_load_local_oob(void);
#endif

/*******************************************************************************
 *
 * Function         btif_context_switched
 *
 * Description      Callback used to execute transferred context callback
 *
 *                  p_msg : message to be executed in btif context
 *
 * Returns          void
 *
 ******************************************************************************/

static void btif_context_switched(void* p_msg) {
  BTIF_TRACE_VERBOSE("btif_context_switched");

  tBTIF_CONTEXT_SWITCH_CBACK* p = (tBTIF_CONTEXT_SWITCH_CBACK*)p_msg;

  /* each callback knows how to parse the data */
  if (p->p_cb) p->p_cb(p->event, p->p_param);
}

/*******************************************************************************
 *
 * Function         btif_transfer_context
@@ -240,9 +219,9 @@ void btif_init_ok() {
 *
 ******************************************************************************/
static void bt_jni_msg_ready(void* context) {
  BT_HDR* p_msg = (BT_HDR*)context;
  btif_context_switched(p_msg);
  osi_free(p_msg);
  tBTIF_CONTEXT_SWITCH_CBACK* p = (tBTIF_CONTEXT_SWITCH_CBACK*)context;
  if (p->p_cb) p->p_cb(p->event, p->p_param);
  osi_free(p);
}

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