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