diff options
author | Nitin Shivpure <nshivpur@codeaurora.org> | 2014-10-16 16:01:06 +0530 |
---|---|---|
committer | Nitin Shivpure <nshivpur@codeaurora.org> | 2014-11-19 15:19:02 +0530 |
commit | 28e23d48a202dde059f4421b2bd8c0e512fd057c (patch) | |
tree | b27ae915cd0fbeee63a456e414fea036e2abbe2f | |
parent | 4ee50302450ad34f44d3516323f36b4c6f1e25f0 (diff) | |
download | android_packages_apps_BluetoothExt-28e23d48a202dde059f4421b2bd8c0e512fd057c.tar.gz android_packages_apps_BluetoothExt-28e23d48a202dde059f4421b2bd8c0e512fd057c.tar.bz2 android_packages_apps_BluetoothExt-28e23d48a202dde059f4421b2bd8c0e512fd057c.zip |
Bluetooth: Fix KW issues for DUN profile
This patch fixes P1 Klockwork issues in DunService.
Change-Id: I11f724451858d51825ad1a1d8b9dc1fd5ef21c20
CRs-fixed: 759267
-rw-r--r-- | src/org/codeaurora/bluetooth/dun/BluetoothDunService.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/org/codeaurora/bluetooth/dun/BluetoothDunService.java b/src/org/codeaurora/bluetooth/dun/BluetoothDunService.java index 58bba02..92ec785 100644 --- a/src/org/codeaurora/bluetooth/dun/BluetoothDunService.java +++ b/src/org/codeaurora/bluetooth/dun/BluetoothDunService.java @@ -529,7 +529,7 @@ public class BluetoothDunService extends Service { removeTimeoutMsg = false; } - if (removeTimeoutMsg) { + if (removeTimeoutMsg && mDunHandler != null) { mDunHandler.removeMessages(MESSAGE_DUN_USER_TIMEOUT); } } @@ -1264,7 +1264,8 @@ public class BluetoothDunService extends Service { IpcMsgBuffer.putShort(DUN_IPC_MSG_OFF_MSG_LEN,DUN_IPC_CTRL_MSG_SIZE); IpcMsgBuffer.put(DUN_IPC_MSG_OFF_MSG, DUN_CRTL_MSG_DISCONNECT_REQ); try { - mDundOutputStream.write(IpcMsgBuffer.array(), 0, WriteLen); + if (mDundOutputStream != null) + mDundOutputStream.write(IpcMsgBuffer.array(), 0, WriteLen); } catch (IOException ex) { Log.w(TAG, "disconnect: Handled mDundOutputStream write exception: " + ex.toString()); } @@ -1293,7 +1294,8 @@ public class BluetoothDunService extends Service { IpcMsgBuffer.putShort(DUN_IPC_MSG_OFF_MSG_LEN,DUN_IPC_MDM_STATUS_MSG_SIZE); IpcMsgBuffer.put(DUN_IPC_MSG_OFF_MSG, status); try { - mDundOutputStream.write(IpcMsgBuffer.array(), 0, WriteLen); + if (mDundOutputStream != null) + mDundOutputStream.write(IpcMsgBuffer.array(), 0, WriteLen); } catch (IOException ex) { Log.e(TAG, "Handled mDundOutputStream write exception: " + ex.toString()); } |