From 2319f2230c8b8a6459834899b575304efed574de Mon Sep 17 00:00:00 2001 From: Graham Jones Date: Mon, 19 Dec 2016 20:13:51 +0000 Subject: [PATCH] Made auto-start start SDServer rather than StartUpActivity so it works with phone screen locked. --- CHANGELOG.md | 4 +++ app/src/main/AndroidManifest.xml | 4 +-- .../BootBroadcastReceiver.java | 30 +++++++++++++++++-- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbeae3d..d9bc902 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,10 @@ OpenSeizureDetector Android App - Change Log ============================================ + V2.3.1 - 19 Dec 2016 + - Changed auto-start feature to start the SDServer background service rather than the StartUpActvity so it will work + when the phone screen is locked. + V2.3.0 - 14 Dec 2016 - Added auto start on phone boot feature (selectable from general settings) - Added Location to SMS alarm notifications diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 51409cc..d6bdfa3 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="32" + android:versionName="2.3.1"> diff --git a/app/src/main/java/uk/org/openseizuredetector/BootBroadcastReceiver.java b/app/src/main/java/uk/org/openseizuredetector/BootBroadcastReceiver.java index a2d7086..dad6616 100644 --- a/app/src/main/java/uk/org/openseizuredetector/BootBroadcastReceiver.java +++ b/app/src/main/java/uk/org/openseizuredetector/BootBroadcastReceiver.java @@ -1,3 +1,27 @@ +/* + Android_Pebble_SD - a simple accelerometer based seizure detector that runs on a + Pebble smart watch (http://getpebble.com). + + See http://openseizuredetector.org for more information. + + Copyright Graham Jones, 2015. + + This file is part of pebble_sd. + + Android_Pebble_SD is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + Android_Pebble_Sd is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with Android_Pebble_SD. If not, see . + +*/ package uk.org.openseizuredetector; import android.content.BroadcastReceiver; @@ -9,6 +33,8 @@ import android.util.Log; import android.widget.Toast; /** + * Broadcast Receiver responds to the BOOT_COMPLETED broadcast and if the 'AutoStart' preference is true, + * will start the OpenSeizureDetector SDServer service. * Created by graham on 14/12/16. */ @@ -23,9 +49,9 @@ public class BootBroadcastReceiver extends BroadcastReceiver { boolean autoStart = SP.getBoolean("AutoStart",false); Log.v(TAG,"onReceive() - autoStart = "+autoStart); if (autoStart && Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) { - Intent startUpIntent = new Intent(context, StartupActivity.class); + Intent startUpIntent = new Intent(context, SdServer.class); startUpIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(startUpIntent); + context.startService(startUpIntent); } } }