V3.1.5 - fixed bug that crashed main activity screen when server was shutdown (introduced in 3.1.3)

This commit is contained in:
Graham Jones
2019-04-27 20:16:30 +01:00
parent 85d6d94f73
commit b33b0015bf
6 changed files with 30 additions and 23 deletions

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="58"
android:versionName="3.1.4"
android:versionCode="59"
android:versionName="3.1.5"
>
<!--android:allowBackup="false"-->

View File

@@ -366,7 +366,7 @@ public class MainActivity extends AppCompatActivity {
*/
final Runnable serverStatusRunnable = new Runnable() {
public void run() {
Log.v(TAG,"serverStatusRunnable()");
Log.v(TAG, "serverStatusRunnable()");
TextView tv;
if (mUtil.isServerRunning()) {
@@ -434,7 +434,7 @@ public class MainActivity extends AppCompatActivity {
// Pebble Connected Phrase - use for HR if active instead.
tv = (TextView) findViewById(R.id.pebbleTv);
if (mConnection.mSdServer.mSdData.mHRAlarmActive) {
tv.setText("HR = "+mConnection.mSdServer.mSdData.mHR);
tv.setText("HR = " + mConnection.mSdServer.mSdData.mHR);
if (!mConnection.mSdServer.mSdData.mHRAlarmStanding) {
tv.setBackgroundColor(okColour);
tv.setTextColor(okTextColour);
@@ -534,7 +534,6 @@ public class MainActivity extends AppCompatActivity {
pb.setProgressDrawable(pbDrawable);
// Fault Conditions - We override the values in the UI because we do not know
// if the stored ones are correct or not with a fault present.
if ((mConnection.mSdServer.mSdData.alarmState == 4) ||
@@ -614,24 +613,29 @@ public class MainActivity extends AppCompatActivity {
// deal with latch alarms button
Button acceptAlarmButton = (Button) findViewById(R.id.acceptAlarmButton);
if ((mConnection.mSdServer.mSmsTimer != null)
&& (mConnection.mSdServer.mSmsTimer.mTimeLeft > 0 )){
acceptAlarmButton.setText("SMS Will Be Sent in "+
mConnection.mSdServer.mSmsTimer.mTimeLeft/1000 +
" s - CANCEL?");
acceptAlarmButton.setBackgroundColor(alarmColour);
acceptAlarmButton.setEnabled(true);
if (mConnection.mBound) {
if ((mConnection.mSdServer.mSmsTimer != null)
&& (mConnection.mSdServer.mSmsTimer.mTimeLeft > 0)) {
acceptAlarmButton.setText("SMS Will Be Sent in " +
mConnection.mSdServer.mSmsTimer.mTimeLeft / 1000 +
" s - CANCEL?");
acceptAlarmButton.setBackgroundColor(alarmColour);
acceptAlarmButton.setEnabled(true);
} else {
acceptAlarmButton.setText("Accept Alarm");
acceptAlarmButton.setBackgroundColor(Color.DKGRAY);
if (mConnection.mBound)
if ((mConnection.mSdServer.isLatchAlarms())
|| mConnection.mSdServer.mSdData.mFallActive) {
acceptAlarmButton.setEnabled(true);
} else {
acceptAlarmButton.setEnabled(false);
}
}
} else {
acceptAlarmButton.setText("Accept Alarm");
acceptAlarmButton.setBackgroundColor(Color.DKGRAY);
if (mConnection.mBound)
if ((mConnection.mSdServer.isLatchAlarms())
|| mConnection.mSdServer.mSdData.mFallActive) {
acceptAlarmButton.setEnabled(true);
} else {
acceptAlarmButton.setEnabled(false);
}
acceptAlarmButton.setEnabled(false);
}
// Deal with Cancel Audible button

View File

@@ -503,7 +503,7 @@ public class StartupActivity extends Activity {
+ "\n\nChanges in this version:"
+ "\n- V3.1.0 - Added fall detection algorithm into Garmin/Fitbit Data Source "
+ "\n V3.1.3 - Added delay to SMS sending to give the user chance to cancel a false alarm."
+ "\n V3.1.4 - Added repeat alarm beeps during SMS delay to alert user.."
+ "\n V3.1.5 - Added repeat alarm beeps during SMS delay to alert user.."
);
// This makes the links display as links, but they do not respond to clicks for some reason...
Linkify.addLinks(s, Linkify.ALL);
@@ -535,7 +535,7 @@ public class StartupActivity extends Activity {
+ "\n\nChanges in this version:"
+ "\n- V3.1.0 - Added fall detection algorithm into Garmin/Fitbit Data Source "
+ "\n V3.1.3 - Added delay to SMS sending to give the user chance to cancel a false alarm."
+ "\n V3.1.4 - Added repeat alarm beeps during SMS delay to alert user.."
+ "\n V3.1.5 - Added repeat alarm beeps during SMS delay to alert user.."
+ "\n "
);
// This makes the links display as links, but they do not respond to clicks for some reason...