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

Commit c1ece74b authored by Matthew Xie's avatar Matthew Xie
Browse files

fixed rfc resouce leaking and multi-session issue

also added more debug messages
bug 7486080

Change-Id: Ic21e9d2df5f651b51ea2126a3cac25811808dcfb
parent c17d803d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1025,7 +1025,7 @@ BTA_API extern tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
**                  BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
BTA_API extern tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle);
BTA_API extern tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, void* user_data);

/*******************************************************************************
**
@@ -1057,7 +1057,7 @@ BTA_API extern tBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask,
**                  BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
BTA_API extern tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle);
BTA_API extern tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle, void* user_data);

/*******************************************************************************
**
+200 −196

File changed.

Preview size limit exceeded, changes collapsed.

+4 −2
Original line number Diff line number Diff line
@@ -1358,7 +1358,7 @@ tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
**                  BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle)
tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, void *user_data)
{
    tBTA_JV_STATUS status = BTA_JV_FAILURE;
    tBTA_JV_API_RFCOMM_CLOSE *p_msg;
@@ -1374,6 +1374,7 @@ tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle)
        p_msg->handle = handle;
        p_msg->p_cb = &bta_jv_cb.rfc_cb[hi];
        p_msg->p_pcb = &bta_jv_cb.port_cb[p_msg->p_cb->rfc_hdl[si] - 1];
        p_msg->user_data = user_data;
        bta_sys_sendmsg(p_msg);
        status = BTA_JV_SUCCESS;
    }
@@ -1439,7 +1440,7 @@ tBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask,
**                  BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle)
tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle, void * user_data)
{
    tBTA_JV_STATUS status = BTA_JV_FAILURE;
    tBTA_JV_API_RFCOMM_SERVER *p_msg;
@@ -1448,6 +1449,7 @@ tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle)
    {
        p_msg->hdr.event = BTA_JV_API_RFCOMM_STOP_SERVER_EVT;
        p_msg->rfc_handle = handle;
        p_msg->user_data = user_data; //caller's private data
        bta_sys_sendmsg(p_msg);
        status = BTA_JV_SUCCESS;
    }
+2 −0
Original line number Diff line number Diff line
@@ -196,6 +196,7 @@ typedef struct
    UINT8               handle;     /* index: the handle reported to java app */
    UINT8               scn;        /* the scn of the server */
    UINT8               max_sess;   /* max sessions */
    int                 curr_sess;   /* current sessions count*/
} tBTA_JV_RFC_CB;

/* data type for BTA_JV_API_L2CAP_CONNECT_EVT */
@@ -307,6 +308,7 @@ typedef struct
    UINT16          handle;
    tBTA_JV_RFC_CB  *p_cb;
    tBTA_JV_PCB     *p_pcb;
    void        *user_data;
} tBTA_JV_API_RFCOMM_CLOSE;

/* data type for BTA_JV_API_CREATE_RECORD_EVT */
+25 −14

File changed.

Preview size limit exceeded, changes collapsed.

Loading