In case A2DP is not enabled we are still executing the shut down path
which is leading to a race condition and posting to a thread queue which
is never created.
Bug: b/
32610895
Change-Id: Id0cf95f4c7b5be26be28db5e837fbca3a0a87072
}
void btif_a2dp_source_shutdown(void) {
+ if ((btif_a2dp_source_state == BTIF_A2DP_SOURCE_STATE_OFF) ||
+ (btif_a2dp_source_state == BTIF_A2DP_SOURCE_STATE_SHUTTING_DOWN)) {
+ return;
+ }
+
/* Make sure no channels are restarted while shutting down */
btif_a2dp_source_state = BTIF_A2DP_SOURCE_STATE_SHUTTING_DOWN;