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

Commit 72728794 authored by Satish Kodishala's avatar Satish Kodishala Committed by Andre Eisenbach
Browse files

Bluetooth: Handle get RSSI timeout gracefully

Usecase:
1. Turn ON BT
2. Pair and connect with Headset
3. Play Music over A2DP
4. Make GetRssi timeout
5. Bt app crashes

Failure:
BT app crashes.

Rootcause:
Calling callback with NULL and in callback handling NULL check with assert.

Fix:
Call the callback with error instead of NULL.

Change-Id: I20a9e504a513697945cd76d218ec12a0ef1e3330
parent 35b01a9a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -2034,9 +2034,12 @@ void btm_read_tx_power_complete(uint8_t* p, bool is_ble) {
 *
 ******************************************************************************/
void btm_read_rssi_timeout(UNUSED_ATTR void* data) {
  tBTM_RSSI_RESULTS  results;
  tBTM_CMPL_CB* p_cb = btm_cb.devcb.p_rssi_cmpl_cb;
  btm_cb.devcb.p_rssi_cmpl_cb = NULL;
  if (p_cb) (*p_cb)((void*)NULL);
  results.status = BTM_DEVICE_TIMEOUT;
  if (p_cb)
      (*p_cb)(&results);
}

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