fixed a bug when watch is not connected to a phone, we closed the datastream even its wasn openend

This commit is contained in:
toni
2019-01-27 19:08:35 +01:00
parent a9532f8129
commit 838242ba76

View File

@@ -152,12 +152,15 @@ public class SensorDataFileStreamer implements Runnable{
}
public void close(){
try {
mRunning = false;
mOutputStream.close();
mOutputStreamOpened = false;
} catch (IOException e) {
e.printStackTrace();
if(mChannelOpenend && mNode != null){
try {
mRunning = false;
mOutputStream.close();
mOutputStreamOpened = false;
} catch (IOException e) {
//e.printStackTrace();
Log.d(TAG, "Closing the outputstream failed!");
}
}
}
}