OSDN Git Service

Bluetooth: On Suspend ignore media task timer event
authorHemant Gupta <hemantg@codeaurora.org>
Thu, 5 Sep 2013 14:12:50 +0000 (19:42 +0530)
committerPrerepa Viswanadham <dham@google.com>
Thu, 12 Jun 2014 01:34:48 +0000 (01:34 +0000)
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

btif/src/btif_media_task.c

index 0b9b613..39eb705 100644 (file)
@@ -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)
-    btif_media_send_aa_frame();
+    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,7 +2189,10 @@ 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)