Minor Update to V4.1.x to fix silent crash issue #135 in production version

This commit is contained in:
Graham Jones
2024-01-28 08:29:27 +00:00
parent 0d74ddfb5d
commit 09f33ee16f
4 changed files with 96 additions and 76 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="127"
android:versionName="4.1.12">
android:versionCode="131"
android:versionName="4.1.13">
<!-- android:allowBackup="false" -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View File

@@ -757,6 +757,7 @@ public abstract class SdDataSource {
* and sets class variables for use by other functions.
*/
public void getStatus() {
try {
Time tnow = new Time(Time.getCurrentTimezone());
long tdiff;
tnow.setToNow();
@@ -790,13 +791,14 @@ public abstract class SdDataSource {
// Check we have seen a fidget within the required period, or else assume a fault because watch is not being worn
if (mFidgetDetectorEnabled) {
if (mLastFidget == null) mLastFidget = tnow; // Initialise last fidget time on startup.
if (mLastFidget == null)
mLastFidget = tnow; // Initialise last fidget time on startup.
double accStd = calcRawDataStd(mSdData);
if (accStd > mFidgetThreshold) {
mLastFidget = tnow;
} else {
Log.d(TAG,"onStatus() - Fidget Detector - low movement - is watch being worn?");
Log.d(TAG, "onStatus() - Fidget Detector - low movement - is watch being worn?");
tdiff = (tnow.toMillis(false) - mLastFidget.toMillis(false));
if (tdiff > (mFidgetPeriod) * 60 * 1000) {
Log.e(TAG, "onStatus() - Fidget Not Detected - is watch being worn?");
@@ -816,12 +818,22 @@ public abstract class SdDataSource {
if (!mSdData.haveSettings) {
Log.v(TAG, "getStatus() - no settings received yet");
}
} catch(Exception e) {
Log.e(TAG,"getStatus - Exception: "+e.toString());
Log.e(TAG,e.getMessage());
mSdData.watchAppRunning = false;
mSdData.roiPower = -1;
mSdData.specPower = -1;
mSdDataReceiver.onSdDataFault(mSdData);
}
}
/**
* faultCheck - determines alarm state based on seizure detector data SdData. Called every second.
*/
private void faultCheck() {
try {
Time tnow = new Time(Time.getCurrentTimezone());
long tdiff;
tnow.setToNow();
@@ -843,13 +855,21 @@ public abstract class SdDataSource {
mSdData.mHrFrozenFaultStanding = false;
} else {
tdiff = (tnow.toMillis(false) - mHrStatusTime.toMillis(false));
if (tdiff > mHrFrozenPeriod *1000.) {
if (tdiff > mHrFrozenPeriod * 1000.) {
mSdData.mHrFrozenFaultStanding = true;
} else {
mSdData.mHrFrozenFaultStanding = false;
}
}
}
} catch(Exception e) {
Log.e(TAG,"faultCheck - Exception: "+e.toString());
Log.e(TAG,e.getMessage());
mSdData.watchAppRunning = false;
mSdData.roiPower = -1;
mSdData.specPower = -1;
mSdDataReceiver.onSdDataFault(mSdData);
}
}
void nnAnalysis() {