summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2014-11-22 08:32:55 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2014-11-22 08:32:55 -0800
commit45bdb4b54a07d766067954c87b461020c12a1391 (patch)
tree5998f0b1ff5ed7cbd8cb15a4352ad89e02336dd2
parent777a85018986dd6f7707c0b4fad1f46c1dd0d4ba (diff)
parent0e997eb45f34fb8a760a3786e7d16392cf274dd7 (diff)
downloadandroid_packages_apps_BluetoothExt-45bdb4b54a07d766067954c87b461020c12a1391.tar.gz
android_packages_apps_BluetoothExt-45bdb4b54a07d766067954c87b461020c12a1391.tar.bz2
android_packages_apps_BluetoothExt-45bdb4b54a07d766067954c87b461020c12a1391.zip
Merge "SAP: Flush RfcommOutputStream"
-rw-r--r--src/org/codeaurora/bluetooth/sap/BluetoothSapService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/org/codeaurora/bluetooth/sap/BluetoothSapService.java b/src/org/codeaurora/bluetooth/sap/BluetoothSapService.java
index 70697b3..8a3cc54 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) {
@@ -1291,6 +1294,7 @@ public class BluetoothSapService extends Service {
try {
mRfcommOutputStream.write(IpcMsgBuffer.array(), 0, WriteLen);
+ mRfcommOutputStream.flush();
} catch (IOException ex) {
if (VERBOSE) Log.v(TAG, "mRfcommOutputStream wrtie exception: " + ex.toString());
}