V4.2.12a - added menu option to send a 'False Alarm' SMS message
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
OpenSeizureDetector Android App - Change Log
|
OpenSeizureDetector Android App - Change Log
|
||||||
============================================
|
============================================
|
||||||
|
V4.2.12 - Added 'Send False Alarm notification Menu Option'
|
||||||
V4.2.11 - Updated permissions handling to support Android 14 (needed to publish on Play Store)
|
V4.2.11 - Updated permissions handling to support Android 14 (needed to publish on Play Store)
|
||||||
- added a crude 'flap' detector into OSD Algorithm
|
- added a crude 'flap' detector into OSD Algorithm
|
||||||
- Added setting to change the delay before SMS alert is sent (Issue #202)
|
- Added setting to change the delay before SMS alert is sent (Issue #202)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:versionCode="148"
|
android:versionCode="149"
|
||||||
android:versionName="4.2.11b">
|
android:versionName="4.2.12a">
|
||||||
<!-- android:allowBackup="false" -->
|
<!-- android:allowBackup="false" -->
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
|
||||||
|
|
||||||
|
|||||||
@@ -237,6 +237,12 @@ public class MainActivity2 extends AppCompatActivity {
|
|||||||
mConnection.mSdServer.sendSMSAlarm();
|
mConnection.mSdServer.sendSMSAlarm();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
case R.id.action_send_false_alarm_sms:
|
||||||
|
Log.i(TAG, "action_send_false_alarm_sms");
|
||||||
|
if (mConnection.mBound) {
|
||||||
|
mConnection.mSdServer.sendFalseAlarmSMS();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
|
||||||
case R.id.action_authenticate_api:
|
case R.id.action_authenticate_api:
|
||||||
Log.i(TAG, "action_autheticate_api");
|
Log.i(TAG, "action_autheticate_api");
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
private boolean mSMSAlarm = false;
|
private boolean mSMSAlarm = false;
|
||||||
private String[] mSMSNumbers;
|
private String[] mSMSNumbers;
|
||||||
private String mSMSMsgStr = "default SMS Message";
|
private String mSMSMsgStr = "default SMS Message";
|
||||||
|
private String mSMSFalseAlarmMsgStr = "default SMS False Alarm Message";
|
||||||
public Time mSMSTime = null; // last time we sent an SMS Alarm (limited to one per minute)
|
public Time mSMSTime = null; // last time we sent an SMS Alarm (limited to one per minute)
|
||||||
public SmsTimer mSmsTimer = null; // Timer to wait for specified time before sending an alert to give the user chance to cancel it.
|
public SmsTimer mSmsTimer = null; // Timer to wait for specified time before sending an alert to give the user chance to cancel it.
|
||||||
public int mSmsTimerSecs = 10; // Time delay in seconds before sending SMS alert.
|
public int mSmsTimerSecs = 10; // Time delay in seconds before sending SMS alert.
|
||||||
@@ -958,6 +959,48 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sends SMS Alarms to the telephone numbers specified in mSMSNumbers[]
|
||||||
|
* Attempts to find a better location, and sends a second SMS after location search
|
||||||
|
* complete (onLocationReceived()).
|
||||||
|
*/
|
||||||
|
public void sendFalseAlarmSMS() {
|
||||||
|
AlertDialog ad;
|
||||||
|
if (mSMSAlarm) {
|
||||||
|
if (!mCancelAudible) {
|
||||||
|
Log.i(TAG, "sendFalseAlarmsSMS() - Sending to " + mSMSNumbers.length + " Numbers");
|
||||||
|
mUtil.writeToSysLogFile("SdServer.sendFalseAlarmsSMS()");
|
||||||
|
Time tnow = new Time(Time.getCurrentTimezone());
|
||||||
|
tnow.setToNow();
|
||||||
|
String dateStr = tnow.format("%H:%M:%S %d/%m/%Y");
|
||||||
|
String shortUuidStr = mUuidStr.substring(mUuidStr.length() - 6);
|
||||||
|
|
||||||
|
// SmsManager sm = SmsManager.getDefault();
|
||||||
|
for (int i = 0; i < mSMSNumbers.length; i++) {
|
||||||
|
Log.i(TAG, "sendFalseAlarmsSMS() - Sending to " + mSMSNumbers[i]);
|
||||||
|
//sendSMS(new String(mSMSNumbers[i]), mSMSFalseAlarmMsgStr + " - " + dateStr + " " + shortUuidStr);
|
||||||
|
try {
|
||||||
|
SmsManager sm = SmsManager.getDefault();
|
||||||
|
sm.sendTextMessage(mSMSNumbers[i], null, mSMSFalseAlarmMsgStr + " - " + dateStr + " " + shortUuidStr,
|
||||||
|
null, null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
Log.e(TAG, "sendFalseAlarmsSMS - Failed to send SMS Message");
|
||||||
|
mUtil.showToast(getString(R.string.failed_to_send_sms));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "sendFalseAlarmSMS() - Cancel Audible Active - not sending SMS");
|
||||||
|
mUtil.showToast(getString(R.string.cancel_audible_not_sending_sms));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "sendFalseAlarmSMS() - SMS Alarms Disabled - not doing anything!");
|
||||||
|
mUtil.showToast(getString(R.string.sms_alarms_disabled));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* smsCanelClickListener - onClickListener for the SMS cancel dialog box. If the
|
* smsCanelClickListener - onClickListener for the SMS cancel dialog box. If the
|
||||||
@@ -1261,11 +1304,14 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
mUtil.writeToSysLogFile("updatePrefs() - mSMSAlarm = " + mSMSAlarm);
|
mUtil.writeToSysLogFile("updatePrefs() - mSMSAlarm = " + mSMSAlarm);
|
||||||
String SMSNumberStr = SP.getString("SMSNumbers", "");
|
String SMSNumberStr = SP.getString("SMSNumbers", "");
|
||||||
mSMSNumbers = SMSNumberStr.split(",");
|
mSMSNumbers = SMSNumberStr.split(",");
|
||||||
mSMSMsgStr = SP.getString("SMSMsg", "Seizure Detected!!!");
|
|
||||||
Log.v(TAG, "updatePrefs() - SMSNumberStr = " + SMSNumberStr);
|
Log.v(TAG, "updatePrefs() - SMSNumberStr = " + SMSNumberStr);
|
||||||
mUtil.writeToSysLogFile("updatePrefs() - SMSNumberStr = " + SMSNumberStr);
|
mUtil.writeToSysLogFile("updatePrefs() - SMSNumberStr = " + SMSNumberStr);
|
||||||
Log.v(TAG, "updatePrefs() - mSMSNumbers = " + mSMSNumbers);
|
Log.v(TAG, "updatePrefs() - mSMSNumbers = " + mSMSNumbers);
|
||||||
mUtil.writeToSysLogFile("updatePrefs() - mSMSNumbers = " + mSMSNumbers);
|
mUtil.writeToSysLogFile("updatePrefs() - mSMSNumbers = " + mSMSNumbers);
|
||||||
|
mSMSMsgStr = SP.getString("SMSMsg", "Seizure Detected!!!");
|
||||||
|
Log.v(TAG, "updatePrefs() - SMSMsgStr = " + mSMSMsgStr);
|
||||||
|
mSMSFalseAlarmMsgStr = SP.getString("SMSFalseAlarmMsg", "False Alarm, Sorry!");
|
||||||
|
Log.v(TAG, "updatePrefs() - SMSFalseAlarmMsgStr = " + mSMSFalseAlarmMsgStr);
|
||||||
|
|
||||||
String smsDelayPeriodStr = SP.getString("SMSDelayPeriod","10");
|
String smsDelayPeriodStr = SP.getString("SMSDelayPeriod","10");
|
||||||
mSmsTimerSecs = Integer.parseInt(smsDelayPeriodStr);
|
mSmsTimerSecs = Integer.parseInt(smsDelayPeriodStr);
|
||||||
|
|||||||
@@ -73,6 +73,11 @@
|
|||||||
android:icon="@drawable/stop_server"
|
android:icon="@drawable/stop_server"
|
||||||
app:showAsAction="never|withText"
|
app:showAsAction="never|withText"
|
||||||
android:title="@string/test_sms_alarm_notification" />
|
android:title="@string/test_sms_alarm_notification" />
|
||||||
|
<item
|
||||||
|
android:id="@+id/action_send_false_alarm_sms"
|
||||||
|
android:icon="@drawable/stop_server"
|
||||||
|
app:showAsAction="never|withText"
|
||||||
|
android:title="@string/send_false_alarm_sms_menu_text" />
|
||||||
</group>
|
</group>
|
||||||
<group android:id="@+id/grp5">
|
<group android:id="@+id/grp5">
|
||||||
<!--<item
|
<!--<item
|
||||||
|
|||||||
@@ -583,4 +583,8 @@
|
|||||||
<string name="activity_permissions_rationale">Permission required to analyse your movements to detect seizure activity.</string>
|
<string name="activity_permissions_rationale">Permission required to analyse your movements to detect seizure activity.</string>
|
||||||
<string name="sms_delay_sec">SMS Delay (sec)</string>
|
<string name="sms_delay_sec">SMS Delay (sec)</string>
|
||||||
<string name="sms_delay_sec_desc">The number of seconds to delay between an alarm initiating and an SMS message being sent (default=10)</string>
|
<string name="sms_delay_sec_desc">The number of seconds to delay between an alarm initiating and an SMS message being sent (default=10)</string>
|
||||||
|
<string name="send_false_alarm_sms_menu_text">Send False Alarm SMS</string>
|
||||||
|
<string name="DefaultSMSFalseAlarmMsgText">False Alarm, Sorry!</string>
|
||||||
|
<string name="sms_false_alarm_message_summary">Text of \'False Alarm\' SMS message</string>
|
||||||
|
<string name="sms_false_alarm_message_title">SMS False Alarm Message</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -66,6 +66,11 @@
|
|||||||
android:key="SMSMsg"
|
android:key="SMSMsg"
|
||||||
android:summary="@string/sms_message_summary"
|
android:summary="@string/sms_message_summary"
|
||||||
android:title="@string/sms_message_title" />
|
android:title="@string/sms_message_title" />
|
||||||
|
<EditTextPreference
|
||||||
|
android:defaultValue="@string/DefaultSMSFalseAlarmMsgText"
|
||||||
|
android:key="SMSFalseAlarmMsg"
|
||||||
|
android:summary="@string/sms_false_alarm_message_summary"
|
||||||
|
android:title="@string/sms_false_alarm_message_title" />
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<!--
|
<!--
|
||||||
<PreferenceCategory android:title="Phone Call Alarm Settings">
|
<PreferenceCategory android:title="Phone Call Alarm Settings">
|
||||||
|
|||||||
BIN
releases/app-release-4.2.12a.apk
Normal file
BIN
releases/app-release-4.2.12a.apk
Normal file
Binary file not shown.
Reference in New Issue
Block a user