summaryrefslogtreecommitdiff
path: root/src/android/bluetooth/client/map/BluetoothMasClient.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/android/bluetooth/client/map/BluetoothMasClient.java')
-rw-r--r--src/android/bluetooth/client/map/BluetoothMasClient.java17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/android/bluetooth/client/map/BluetoothMasClient.java b/src/android/bluetooth/client/map/BluetoothMasClient.java
index d6d2a1c..7f71693 100644
--- a/src/android/bluetooth/client/map/BluetoothMasClient.java
+++ b/src/android/bluetooth/client/map/BluetoothMasClient.java
@@ -453,13 +453,9 @@ public class BluetoothMasClient {
}
private void sendToClient(int event, boolean success, Object param) {
- if (success) {
- mCallback.obtainMessage(event, STATUS_OK, mMas.getMasInstanceId(), param)
- .sendToTarget();
- } else {
- mCallback.obtainMessage(event, STATUS_FAILED, mMas.getMasInstanceId(), null)
- .sendToTarget();
- }
+ // Send event, status and notification state for both sucess and failure case.
+ mCallback.obtainMessage(event, success ? STATUS_OK : STATUS_FAILED, mMas.getMasInstanceId(),
+ param).sendToTarget();
}
private class SocketConnectThread extends Thread {
@@ -547,8 +543,11 @@ public class BluetoothMasClient {
}
public void setPeriod(Date filterBegin, Date filterEnd) {
- periodBegin = (new ObexTime(filterBegin)).toString();
- periodEnd = (new ObexTime(filterEnd)).toString();
+ //Handle possible NPE for obexTime constructor utility
+ if(filterBegin != null )
+ periodBegin = (new ObexTime(filterBegin)).toString();
+ if(filterEnd != null)
+ periodEnd = (new ObexTime(filterEnd)).toString();
}
public void setReadStatus(byte readfilter) {