diff options
author | Linux Build Service Account <lnxbuild@localhost> | 2014-11-25 16:28:45 -0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2014-11-25 16:28:45 -0800 |
commit | f37569b313bf6cdb50fa177fa151592592fa6959 (patch) | |
tree | 8c928304c447fe63839620316bbf81fbc528978b | |
parent | 93ab0cc91bc60790507e132333fd6b679734b26a (diff) | |
parent | 7999129408ce543eebe65d0e0d1d8f44f6ba7303 (diff) | |
download | android_packages_apps_BluetoothExt-f37569b313bf6cdb50fa177fa151592592fa6959.tar.gz android_packages_apps_BluetoothExt-f37569b313bf6cdb50fa177fa151592592fa6959.tar.bz2 android_packages_apps_BluetoothExt-f37569b313bf6cdb50fa177fa151592592fa6959.zip |
Merge "SAP: Flush RfcommOutputStream"
-rw-r--r-- | src/org/codeaurora/bluetooth/sap/BluetoothSapService.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/org/codeaurora/bluetooth/sap/BluetoothSapService.java b/src/org/codeaurora/bluetooth/sap/BluetoothSapService.java index 7ffec37..cd90fad 100644 --- a/src/org/codeaurora/bluetooth/sap/BluetoothSapService.java +++ b/src/org/codeaurora/bluetooth/sap/BluetoothSapService.java @@ -1017,6 +1017,7 @@ public class BluetoothSapService extends Service { /* Read the SAP request from Rfcomm channel */ NumRead = mRfcommInputStream.read(IpcMsgBuffer.array(), SAP_IPC_MSG_OFF_MSG + TotalRead, SAP_MAX_MSG_LEN - TotalRead); + if (VERBOSE) Log.v(TAG, "NumRead from rfcomm = " + NumRead); if ( NumRead < 0) { break; } @@ -1134,7 +1135,7 @@ public class BluetoothSapService extends Service { if (VERBOSE) Log.v(TAG, "Reading the SAP responses from Sapd"); /* Read the SAP responses from SAP server */ NumRead = mSapdInputStream.read(IpcMsgBuffer.array(),0, SAP_MAX_IPC_MSG_LEN); - if (VERBOSE) Log.v(TAG, "NumRead" + NumRead); + if (VERBOSE) Log.v(TAG, "NumRead from sapd = " + NumRead); if ( NumRead < 0) { break; } @@ -1153,12 +1154,14 @@ public class BluetoothSapService extends Service { try { mRfcommOutputStream.write(IpcMsgBuffer.array(), ReadIndex + SAP_IPC_MSG_OFF_MSG, IpcMsgBuffer.getShort(ReadIndex + SAP_IPC_MSG_OFF_MSG_LEN)); + mRfcommOutputStream.flush(); } catch (IOException ex) { stopped = true; break; } if (VERBOSE) - Log.v(TAG, "DownlinkThread Msg written to Rfcomm"); + Log.v(TAG, "Length of DownlinkThread Msg written to Rfcomm" + + IpcMsgBuffer.getShort(ReadIndex + SAP_IPC_MSG_OFF_MSG_LEN)); } else if (IpcMsgBuffer.get(ReadIndex + SAP_IPC_MSG_OFF_MSG_TYPE) == SAP_IPC_MSG_CTRL_RESPONSE) { @@ -1290,8 +1293,10 @@ public class BluetoothSapService extends Service { IpcMsgBuffer.put(SAP_HEADER_SIZE + SAP_MSG_OFF_PARAM_VAL, CONN_ERR); try { - if (mRfcommOutputStream != null) + if (mRfcommOutputStream != null) { mRfcommOutputStream.write(IpcMsgBuffer.array(), 0, WriteLen); + mRfcommOutputStream.flush(); + } } catch (IOException ex) { if (VERBOSE) Log.v(TAG, "mRfcommOutputStream wrtie exception: " + ex.toString()); } |