V3.1.7 - Added mute function from Garmin Data Source watch buttons.

This commit is contained in:
Graham Jones
2019-04-28 22:21:47 +01:00
parent 350f48c167
commit 03402440ad
6 changed files with 24 additions and 10 deletions

Binary file not shown.

View File

@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":60,"versionName":"3.1.6","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":61,"versionName":"3.1.7","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.org.openseizuredetector"
android:versionCode="60"
android:versionName="3.1.6"
android:versionCode="61"
android:versionName="3.1.7"
>
<!--android:allowBackup="false"-->

View File

@@ -105,6 +105,7 @@ public class SdDataSourceGarmin extends SdDataSource {
private short mFallThreshMin;
private short mFallThreshMax;
private short mFallWindow;
private int mMute; // !=0 means muted by keypress on watch.
private int mAlarmCount;
@@ -376,6 +377,12 @@ public class SdDataSourceGarmin extends SdDataSource {
// if we get 'null' HR (For example if the heart rate is not working)
mSdData.mHR = -1;
}
try {
mMute = dataObject.getInt("Mute");
} catch (JSONException e) {
// if we get 'null' HR (For example if the heart rate is not working)
mMute = 0;
}
JSONArray accelVals = dataObject.getJSONArray("data");
Log.v(TAG, "Received " + accelVals.length() + " acceleration values");
int i;
@@ -539,6 +546,10 @@ public class SdDataSourceGarmin extends SdDataSource {
mSdData.fallAlarmStanding = true;
return;
}
if (mMute != 0) {
Log.v(TAG,"Mute Active - setting fall alarm to mute");
mSdData.fallAlarmStanding = false;
}
}
} else {
mSdData.mFallActive = false;
@@ -647,6 +658,7 @@ public class SdDataSourceGarmin extends SdDataSource {
mAlarmCount = 0;
}
}
Log.v(TAG, "inAlarm=" + inAlarm + ", alarmState = " + mSdData.alarmState + " alarmCount=" + mAlarmCount + " mAlarmTime=" + mAlarmTime);
/* Check Heart Rate against alarm settings */
@@ -659,6 +671,12 @@ public class SdDataSourceGarmin extends SdDataSource {
mSdData.mHRAlarmStanding = false;
}
}
if (mMute != 0) {
Log.v(TAG,"Mute Active - setting alarms to mute");
mSdData.alarmState = 6;
mSdData.alarmPhrase = "MUTE";
mSdData.mHRAlarmStanding = false;
}
}
}

View File

@@ -767,14 +767,7 @@ public class SdServer extends Service implements SdDataReceiver {
}
} else {
Log.i(TAG, "sendSMSAlarm() - Cancel Audible Active - not sending SMS");
<<<<<<< HEAD
mUtil.showToast("Cancel Audible Active - not sending SMS");
=======
Toast toast = Toast.makeText(getApplicationContext(),
"Cancel Audible Active - not sending SMS",
Toast.LENGTH_SHORT);
toast.show();
>>>>>>> 6c31fa8aea6a9815f626c17dd29b721c88e9a8c2
}
} else {
Log.i(TAG, "sendSMSAlarm() - SMS Alarms Disabled - not doing anything!");