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

Commit 9b7ce2af authored by Sal Savage's avatar Sal Savage
Browse files

Exit notification timeouts immediately for disconnected devices

When a device disconnects it frees up the list of supported
notifications but is unable to free the timeout timer as well. This
change makes it so crashes won't occur when a timeout occurs for a
device that doesn't have any associated supported events.

Tag: #stability
Bug: 179741365
Test: atest BluetoothInstrumentationTests
Change-Id: I634717615a932a9d6f275bbf5b94ec5a9bd880e0
parent 6f9bf8d5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -2844,6 +2844,12 @@ static void rc_notification_interim_timout(uint8_t label,
  cntxt.label = label;
  cntxt.rc_addr = p_dev->rc_addr;

  /* Device disconnections clear the event list but can't free the timer */
  if (p_dev == NULL || p_dev->rc_supported_event_list) {
    BTIF_TRACE_WARNING("%s: timeout for null device or event list", __func__);
    return;
  }

  list_foreach(p_dev->rc_supported_event_list,
               iterate_supported_event_list_for_timeout, &cntxt);
  /* Timeout happened for interim response for the registered event,