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(){ public void close(){
if(mChannelOpenend && mNode != null){
try { try {
mRunning = false; mRunning = false;
mOutputStream.close(); mOutputStream.close();
mOutputStreamOpened = false; mOutputStreamOpened = false;
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); //e.printStackTrace();
Log.d(TAG, "Closing the outputstream failed!");
}
} }
} }
} }