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

Commit 0262649f authored by Hemant Gupta's avatar Hemant Gupta
Browse files

Bluetooth: On Suspend ignore media task timer event

On Recieving Suspend confirmation from remote device,
Media task timer reload and tx_timer is made false,
hence media task will not be stopped at that instant.
Media task timer expires causing buffer to be allocated.
Changes done to ensure buffer is allocated only if tx_timer
is true.

Change-Id: I971a82cccc64ba033475ad532b096862968de942
parent ba155e01
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -1048,7 +1048,14 @@ static void btif_media_task_aa_handle_timer(void)
    log_tstamps_us("media task tx timer");

#if (BTA_AV_INCLUDED == TRUE)
    if(btif_media_cb.is_tx_timer == TRUE)
    {
        btif_media_send_aa_frame();
    }
    else
    {
        APPL_TRACE_ERROR0("ERROR Media task Scheduled after Suspend");
    }
#endif
}

@@ -2182,8 +2189,11 @@ static void btif_media_aa_prep_sbc_2_send(UINT8 nb_frame)

                /* break read loop if timer was stopped (media task stopped) */
                if ( btif_media_cb.is_tx_timer == FALSE )
                {
                    GKI_freebuf(p_buf);
                    return;
                }
            }

        } while (((p_buf->len + btif_media_cb.encoder.u16PacketLength) < btif_media_cb.TxAaMtuSize)
                && (p_buf->layer_specific < 0x0F) && nb_frame);