diff --git a/app/release/app-release-2.6.1.apk b/app/release/app-release-2.6.1.apk
new file mode 100644
index 0000000..e512200
Binary files /dev/null and b/app/release/app-release-2.6.1.apk differ
diff --git a/app/release/output.json b/app/release/output.json
index ff0f231..fbcd3e3 100644
--- a/app/release/output.json
+++ b/app/release/output.json
@@ -1 +1 @@
-[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":42,"versionName":"2.6.0","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":43,"versionName":"2.6.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
\ No newline at end of file
diff --git a/app/src/main/java/uk/org/openseizuredetector/PrefActivity.java b/app/src/main/java/uk/org/openseizuredetector/PrefActivity.java
index 63d8a37..d338d0a 100644
--- a/app/src/main/java/uk/org/openseizuredetector/PrefActivity.java
+++ b/app/src/main/java/uk/org/openseizuredetector/PrefActivity.java
@@ -140,6 +140,12 @@ public class PrefActivity extends PreferenceActivity implements SharedPreference
}
}, 100);
+ if (s.equals("DataSource")) {
+ Log.i(TAG,"DataSource Changed - re-starting PrefActivity to refresh list");
+ finish();
+ startActivity(getIntent());
+ }
+
}
diff --git a/app/src/main/java/uk/org/openseizuredetector/SdServer.java b/app/src/main/java/uk/org/openseizuredetector/SdServer.java
index 0af2976..332221a 100644
--- a/app/src/main/java/uk/org/openseizuredetector/SdServer.java
+++ b/app/src/main/java/uk/org/openseizuredetector/SdServer.java
@@ -747,34 +747,39 @@ public class SdServer extends Service implements SdDataReceiver, SdLocationRecei
*/
public void sendSMSAlarm() {
if (mSMSAlarm) {
- mLocationFinder.getLocation(this);
- Location loc = mLocationFinder.getLastLocation();
- if (loc != null) {
- mUtil.showToast("Send SMS - last location is "
- + loc.getLongitude() + ","
- + loc.getLatitude());
+ if (!mUtil.areSMSPermissionsOK()) {
+ mUtil.showToast("ERROR - Permission for SMS or Location Denied - Not Sending SMS");
+ Log.e(TAG,"ERROR - Permission for SMS or Location Denied - Not Sending SMS");
} else {
- Log.i(TAG, "sendSMSAlarm() - Last Location is Null so sending first SMS without location.");
- }
- Log.i(TAG, "sendSMSAlarm() - Sending to " + mSMSNumbers.length + " Numbers");
- mUtil.writeToSysLogFile("SdServer.sendSMSAlarm()");
- Time tnow = new Time(Time.getCurrentTimezone());
- tnow.setToNow();
- String dateStr = tnow.format("%H:%M:%S %d/%m/%Y");
- // SmsManager sm = SmsManager.getDefault();
- for (int i = 0; i < mSMSNumbers.length; i++) {
- Log.i(TAG, "sendSMSAlarm() - Sending to " + mSMSNumbers[i]);
- sendSMS(new String(mSMSNumbers[i]),mSMSMsgStr + " - " + dateStr);
- // sm.sendTextMessage(mSMSNumbers[i], null, mSMSMsgStr + " - " + dateStr, null, null);
- //Intent intent = new Intent(Intent.ACTION_SEND);
- //intent.setDataAndType(Uri.parse("smsto:"), "text/plain");
- //intent.putExtra("sms_body", mSMSMsgStr + " - " + dateStr);
- //intent.putExtra("address", new String(mSMSNumbers[i]));
- //if (intent.resolveActivity(getPackageManager()) != null) {
- // startActivity(intent);
- //} else {
- // Log.e(TAG, "sendSMSAlarm() - Failed to send SMS - can not find activity do do it");
- //}
+ mLocationFinder.getLocation(this);
+ Location loc = mLocationFinder.getLastLocation();
+ if (loc != null) {
+ mUtil.showToast("Send SMS - last location is "
+ + loc.getLongitude() + ","
+ + loc.getLatitude());
+ } else {
+ Log.i(TAG, "sendSMSAlarm() - Last Location is Null so sending first SMS without location.");
+ }
+ Log.i(TAG, "sendSMSAlarm() - Sending to " + mSMSNumbers.length + " Numbers");
+ mUtil.writeToSysLogFile("SdServer.sendSMSAlarm()");
+ Time tnow = new Time(Time.getCurrentTimezone());
+ tnow.setToNow();
+ String dateStr = tnow.format("%H:%M:%S %d/%m/%Y");
+ // SmsManager sm = SmsManager.getDefault();
+ for (int i = 0; i < mSMSNumbers.length; i++) {
+ Log.i(TAG, "sendSMSAlarm() - Sending to " + mSMSNumbers[i]);
+ sendSMS(new String(mSMSNumbers[i]), mSMSMsgStr + " - " + dateStr);
+ // sm.sendTextMessage(mSMSNumbers[i], null, mSMSMsgStr + " - " + dateStr, null, null);
+ //Intent intent = new Intent(Intent.ACTION_SEND);
+ //intent.setDataAndType(Uri.parse("smsto:"), "text/plain");
+ //intent.putExtra("sms_body", mSMSMsgStr + " - " + dateStr);
+ //intent.putExtra("address", new String(mSMSNumbers[i]));
+ //if (intent.resolveActivity(getPackageManager()) != null) {
+ // startActivity(intent);
+ //} else {
+ // Log.e(TAG, "sendSMSAlarm() - Failed to send SMS - can not find activity do do it");
+ //}
+ }
}
} else {
Log.i(TAG, "sendSMSAlarm() - SMS Alarms Disabled - not doing anything!");
diff --git a/app/src/main/java/uk/org/openseizuredetector/StartupActivity.java b/app/src/main/java/uk/org/openseizuredetector/StartupActivity.java
index 32a4205..1e5ee40 100644
--- a/app/src/main/java/uk/org/openseizuredetector/StartupActivity.java
+++ b/app/src/main/java/uk/org/openseizuredetector/StartupActivity.java
@@ -110,7 +110,6 @@ public class StartupActivity extends Activity {
PreferenceManager.setDefaultValues(this, R.xml.general_prefs, true);
PreferenceManager.setDefaultValues(this, R.xml.network_datasource_prefs, true);
PreferenceManager.setDefaultValues(this, R.xml.pebble_datasource_prefs, true);
- PreferenceManager.setDefaultValues(this, R.xml.garmin_datasource_prefs, true);
PreferenceManager.setDefaultValues(this, R.xml.seizure_detector_prefs, true);
PreferenceManager.setDefaultValues(this, R.xml.network_passive_datasource_prefs, true);
@@ -491,6 +490,8 @@ public class StartupActivity extends Activity {
+ "\n\nChanges in this version:"
+ "\n- Upgraded to be compatible with Android Version 8 (a requirement of Google Play Store)"
+ "\n- Added support for an experimental Gramin based seizure detector with Heart Rate alarm "
+ + "\n Fixed problem with app not restarting properly when settings were changed"
+ + "\n- Explicitly asks for SMS permission, and displays warning in notification if SMS alarms are active"
+ "\n "
+ "\n PLEASE NOTE - THIS IS A BETA TEST VERSION SO MAY NOT WORK!"
+ "\n ."
@@ -525,9 +526,11 @@ public class StartupActivity extends Activity {
+ "\n\nChanges in this version:"
+ "\n- Upgraded to be compatible with Android Version 8 (a requirement of Google Play Store)"
+ "\n- Added support for an experimental Gramin based seizure detector with Heart Rate alarm "
+ + "\n- Fixed problem with app not restarting properly when settings were changed"
+ + "\n- Explicitly asks for SMS permission, and displays warning in notification if SMS alarms are active"
+ "\n "
+ "\n PLEASE NOTE - THIS IS A BETA TEST VERSION SO MAY NOT WORK!"
- + "\n- "
+ + "\n "
);
// This makes the links display as links, but they do not respond to clicks for some reason...
Linkify.addLinks(s, Linkify.ALL);
diff --git a/app/src/main/res/xml/garmin_datasource_prefs.xml b/app/src/main/res/xml/garmin_datasource_prefs.xml
deleted file mode 100644
index 972ee7a..0000000
--- a/app/src/main/res/xml/garmin_datasource_prefs.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/xml/preference_headers.xml b/app/src/main/res/xml/preference_headers.xml
index da8965e..4edd64f 100644
--- a/app/src/main/res/xml/preference_headers.xml
+++ b/app/src/main/res/xml/preference_headers.xml
@@ -19,8 +19,8 @@
+ android:title="Pebble Datasource"
+ android:summary="Pebble Datasource Preferences" />