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

Commit 0f5a29ae authored by zzy's avatar zzy Committed by Android Git Automerger
Browse files

am 3005e0ed: When rfcomm incoming queue is not empty, waiting for app ready to drain the data

* commit '3005e0ed':
  When rfcomm incoming queue is not empty, waiting for app ready to drain the data
parents 6d6d8055 3005e0ed
Loading
Loading
Loading
Loading
+22 −18
Original line number Diff line number Diff line
@@ -939,7 +939,10 @@ int bta_co_rfc_data_incoming(void *user_data, BT_HDR *p_buf)
    rfc_slot_t* rs = find_rfc_slot_by_id(id);
    if(rs)
    {

        if(!GKI_queue_is_empty(&rs->incoming_que))
            GKI_enqueue(&rs->incoming_que, p_buf);
        else
        {
            int sent = send_data_to_app(rs->fd, p_buf);
            switch(sent)
            {
@@ -960,6 +963,7 @@ int bta_co_rfc_data_incoming(void *user_data, BT_HDR *p_buf)
                    break;
            }
        }
     }
    unlock_slot(&slot_lock);
    return ret;//return 0 to disable data flow
}