Fixed issue with V4 refusing to shutdown after logging into the data sharing system....I think :)
This commit is contained in:
BIN
app/release/app-release-4.0.0i.apk
Normal file
BIN
app/release/app-release-4.0.0i.apk
Normal file
Binary file not shown.
BIN
app/release/old_versions/app-release-4.0.0a.apk
Normal file
BIN
app/release/old_versions/app-release-4.0.0a.apk
Normal file
Binary file not shown.
BIN
app/release/old_versions/app-release-4.0.0b.apk
Normal file
BIN
app/release/old_versions/app-release-4.0.0b.apk
Normal file
Binary file not shown.
BIN
app/release/old_versions/app-release-4.0.0d.apk
Normal file
BIN
app/release/old_versions/app-release-4.0.0d.apk
Normal file
Binary file not shown.
BIN
app/release/old_versions/app-release-4.0.0f.apk
Normal file
BIN
app/release/old_versions/app-release-4.0.0f.apk
Normal file
Binary file not shown.
BIN
app/release/old_versions/app-release-4.0.0g.apk
Normal file
BIN
app/release/old_versions/app-release-4.0.0g.apk
Normal file
Binary file not shown.
@@ -31,11 +31,17 @@ public class AuthenticateActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
Log.v(TAG, "onCreate()");
|
Log.d(TAG, "onCreate()");
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
setContentView(R.layout.activity_authenticate);
|
setContentView(R.layout.activity_authenticate);
|
||||||
|
|
||||||
mUtil = new OsdUtil(getApplicationContext(), serverStatusHandler);
|
mUtil = new OsdUtil(getApplicationContext(), serverStatusHandler);
|
||||||
|
|
||||||
|
if (!mUtil.isServerRunning()) {
|
||||||
|
mUtil.showToast(getString(R.string.error_server_not_running));
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
mConnection = new SdServiceConnection(getApplicationContext());
|
mConnection = new SdServiceConnection(getApplicationContext());
|
||||||
|
|
||||||
Button cancelBtn =
|
Button cancelBtn =
|
||||||
@@ -61,13 +67,21 @@ public class AuthenticateActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
|
Log.d(TAG, "onStart()");
|
||||||
super.onStart();
|
super.onStart();
|
||||||
mUtil.bindToServer(getApplicationContext(), mConnection);
|
mUtil.bindToServer(getApplicationContext(), mConnection);
|
||||||
waitForConnection();
|
waitForConnection();
|
||||||
|
|
||||||
updateUi();
|
updateUi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onStop() {
|
||||||
|
Log.d(TAG, "onStop()");
|
||||||
|
super.onStop();
|
||||||
|
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private void waitForConnection() {
|
private void waitForConnection() {
|
||||||
// We want the UI to update as soon as it is displayed, but it takes a finite time for
|
// We want the UI to update as soon as it is displayed, but it takes a finite time for
|
||||||
// the mConnection to bind to the service, so we delay half a second to give it chance
|
// the mConnection to bind to the service, so we delay half a second to give it chance
|
||||||
|
|||||||
@@ -68,6 +68,13 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
|||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
mContext = this;
|
mContext = this;
|
||||||
mUtil = new OsdUtil(getApplicationContext(), serverStatusHandler);
|
mUtil = new OsdUtil(getApplicationContext(), serverStatusHandler);
|
||||||
|
|
||||||
|
if (!mUtil.isServerRunning()) {
|
||||||
|
mUtil.showToast(getString(R.string.error_server_not_running));
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
mConnection = new SdServiceConnection(getApplicationContext());
|
mConnection = new SdServiceConnection(getApplicationContext());
|
||||||
|
|
||||||
setContentView(R.layout.activity_log_manager_control);
|
setContentView(R.layout.activity_log_manager_control);
|
||||||
@@ -137,7 +144,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
|||||||
Log.v(TAG, "onStop()");
|
Log.v(TAG, "onStop()");
|
||||||
super.onStop();
|
super.onStop();
|
||||||
stopUiTimer();
|
stopUiTimer();
|
||||||
mUtil.unbindFromServer(this, mConnection);
|
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -559,7 +566,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
|||||||
public View getView(int position, View convertView, ViewGroup parent) {
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
View v = super.getView(position, convertView, parent);
|
View v = super.getView(position, convertView, parent);
|
||||||
Map<String, ?> dataItem = (Map<String,?>)getItem(position);
|
Map<String, ?> dataItem = (Map<String,?>)getItem(position);
|
||||||
Log.i(TAG,dataItem.toString());
|
Log.v(TAG,"getView() "+dataItem.toString());
|
||||||
switch(dataItem.get("type").toString()) {
|
switch(dataItem.get("type").toString()) {
|
||||||
case "null":
|
case "null":
|
||||||
v.setBackgroundColor(Color.parseColor("#ffaaaa"));
|
v.setBackgroundColor(Color.parseColor("#ffaaaa"));
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
//int i = 5/0; // Force exception to test handler.
|
//int i = 5/0; // Force exception to test handler.
|
||||||
mUtil = new OsdUtil(getApplicationContext(),serverStatusHandler);
|
mUtil = new OsdUtil(getApplicationContext(),serverStatusHandler);
|
||||||
mConnection = new SdServiceConnection(this);
|
mConnection = new SdServiceConnection(getApplicationContext());
|
||||||
mUtil.writeToSysLogFile("");
|
mUtil.writeToSysLogFile("");
|
||||||
mUtil.writeToSysLogFile("* MainActivity Started *");
|
mUtil.writeToSysLogFile("* MainActivity Started *");
|
||||||
mUtil.writeToSysLogFile("MainActivity.onCreate()");
|
mUtil.writeToSysLogFile("MainActivity.onCreate()");
|
||||||
@@ -236,14 +236,14 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
Log.i(TAG, "action_sart_stop");
|
Log.i(TAG, "action_sart_stop");
|
||||||
if (mConnection.mBound) {
|
if (mConnection.mBound) {
|
||||||
Log.i(TAG, "Stopping Server");
|
Log.i(TAG, "Stopping Server");
|
||||||
mUtil.unbindFromServer(this, mConnection);
|
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
||||||
stopServer();
|
stopServer();
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG, "Starting Server");
|
Log.i(TAG, "Starting Server");
|
||||||
startServer();
|
startServer();
|
||||||
// and bind to it so we can see its data
|
// and bind to it so we can see its data
|
||||||
Log.i(TAG, "Binding to Server");
|
Log.i(TAG, "Binding to Server");
|
||||||
mUtil.bindToServer(this, mConnection);
|
mUtil.bindToServer(getApplicationContext(), mConnection);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
/* fault beep test does not work with fault timer, so disable test option.
|
/* fault beep test does not work with fault timer, so disable test option.
|
||||||
@@ -369,7 +369,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
Log.i(TAG,"onStart()");
|
Log.d(TAG,"onStart()");
|
||||||
mUtil.writeToSysLogFile("MainActivity.onStart()");
|
mUtil.writeToSysLogFile("MainActivity.onStart()");
|
||||||
SharedPreferences SP = PreferenceManager
|
SharedPreferences SP = PreferenceManager
|
||||||
.getDefaultSharedPreferences(getBaseContext());
|
.getDefaultSharedPreferences(getBaseContext());
|
||||||
@@ -383,7 +383,7 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
|
|
||||||
if (mUtil.isServerRunning()) {
|
if (mUtil.isServerRunning()) {
|
||||||
mUtil.writeToSysLogFile("MainActivity.onStart - Binding to Server");
|
mUtil.writeToSysLogFile("MainActivity.onStart - Binding to Server");
|
||||||
mUtil.bindToServer(this, mConnection);
|
mUtil.bindToServer(getApplicationContext(), mConnection);
|
||||||
} else {
|
} else {
|
||||||
Log.i(TAG,"onStart() - Server Not Running");
|
Log.i(TAG,"onStart() - Server Not Running");
|
||||||
mUtil.writeToSysLogFile("MainActivity.onStart - Server Not Running");
|
mUtil.writeToSysLogFile("MainActivity.onStart - Server Not Running");
|
||||||
@@ -403,9 +403,9 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
Log.i(TAG,"onStop() - unbinding from server");
|
Log.d(TAG,"onStop() - unbinding from server");
|
||||||
mUtil.writeToSysLogFile("MainActivity.onStop()");
|
mUtil.writeToSysLogFile("MainActivity.onStop()");
|
||||||
mUtil.unbindFromServer(this, mConnection);
|
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
||||||
mUiTimer.cancel();
|
mUiTimer.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -903,14 +903,14 @@ public class MainActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
super.onPause();
|
super.onPause();
|
||||||
Log.i(TAG,"onPause()");
|
Log.d(TAG,"onPause()");
|
||||||
mUtil.writeToSysLogFile("MainActivity.onPause()");
|
mUtil.writeToSysLogFile("MainActivity.onPause()");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
Log.i(TAG,"onResume()");
|
Log.d(TAG,"onResume()");
|
||||||
mUtil.writeToSysLogFile("MainActivity.onResume()");
|
mUtil.writeToSysLogFile("MainActivity.onResume()");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ public class OsdUtil implements ActivityCompat.OnRequestPermissionsResultCallbac
|
|||||||
/**
|
/**
|
||||||
* unbind an activity from server
|
* unbind an activity from server
|
||||||
*/
|
*/
|
||||||
public void unbindFromServer(Activity activity, SdServiceConnection sdServiceConnection) {
|
public void unbindFromServer(Context activity, SdServiceConnection sdServiceConnection) {
|
||||||
// unbind this activity from the service if it is bound.
|
// unbind this activity from the service if it is bound.
|
||||||
if (sdServiceConnection.mBound) {
|
if (sdServiceConnection.mBound) {
|
||||||
Log.i(TAG, "unbindFromServer() - unbinding");
|
Log.i(TAG, "unbindFromServer() - unbinding");
|
||||||
|
|||||||
@@ -36,26 +36,27 @@ public class ReportSeizureActivity extends AppCompatActivity {
|
|||||||
private LogManager mLm;
|
private LogManager mLm;
|
||||||
private int mYear, mMonth, mDay, mHour, mMinute;
|
private int mYear, mMonth, mDay, mHour, mMinute;
|
||||||
private String mMsg = "Messages";
|
private String mMsg = "Messages";
|
||||||
private OsdUtil osdUtil;
|
|
||||||
private SdServiceConnection mConnection;
|
private SdServiceConnection mConnection;
|
||||||
private OsdUtil mUtil;
|
private OsdUtil mUtil;
|
||||||
final Handler serverStatusHandler = new Handler();
|
final Handler serverStatusHandler = new Handler();
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
Log.v(TAG, "onCreate()");
|
Log.v(TAG, "onCreate()");
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
mContext = this;
|
|
||||||
Handler h = new Handler();
|
|
||||||
osdUtil = new OsdUtil(mContext, h);
|
|
||||||
setContentView(R.layout.activity_report_seizure);
|
|
||||||
mUtil = new OsdUtil(this, serverStatusHandler);
|
mUtil = new OsdUtil(this, serverStatusHandler);
|
||||||
mConnection = new SdServiceConnection(this);
|
if (!mUtil.isServerRunning()) {
|
||||||
|
mUtil.showToast(getString(R.string.error_server_not_running));
|
||||||
|
finish();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
mConnection = new SdServiceConnection(getApplicationContext());
|
||||||
|
|
||||||
|
setContentView(R.layout.activity_report_seizure);
|
||||||
// It takes a finite time for
|
// It takes a finite time for
|
||||||
// the mConnection to bind to the service, so we delay half a second to give it chance
|
// the mConnection to bind to the service, so we delay half a second to give it chance
|
||||||
// to connect before trying to get the SdServer LogManager instance)
|
// to connect before trying to get the SdServer LogManager instance)
|
||||||
|
// FIXME: We should probably implement a WaitForConnection function like we do in some of the other activities
|
||||||
new Handler().postDelayed(new Runnable() {
|
new Handler().postDelayed(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
@@ -97,7 +98,7 @@ public class ReportSeizureActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onStart() {
|
protected void onStart() {
|
||||||
super.onStart();
|
super.onStart();
|
||||||
mUtil.bindToServer(this, mConnection);
|
mUtil.bindToServer(getApplicationContext(), mConnection);
|
||||||
//startUiTimer();
|
//startUiTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -116,7 +117,7 @@ public class ReportSeizureActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
mUtil.unbindFromServer(this, mConnection);
|
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -153,11 +154,11 @@ public class ReportSeizureActivity extends AppCompatActivity {
|
|||||||
if (id!=-1) {
|
if (id!=-1) {
|
||||||
mLm.setDatapointStatus(id,5);
|
mLm.setDatapointStatus(id,5);
|
||||||
mMsg = mMsg + "\nSet Datapoint to Manual Alarm Status";
|
mMsg = mMsg + "\nSet Datapoint to Manual Alarm Status";
|
||||||
osdUtil.showToast(getString(R.string.createdNewEvent));
|
mUtil.showToast(getString(R.string.createdNewEvent));
|
||||||
finish();
|
finish();
|
||||||
} else {
|
} else {
|
||||||
mMsg = mMsg + "\n*** Datapoint not found - not doing anything ***";
|
mMsg = mMsg + "\n*** Datapoint not found - not doing anything ***";
|
||||||
osdUtil.showToast(getString(R.string.DatapointNotFound));
|
mUtil.showToast(getString(R.string.DatapointNotFound));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -360,7 +360,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
if (mWakeLock != null) {
|
if (mWakeLock != null) {
|
||||||
try {
|
try {
|
||||||
mWakeLock.release();
|
mWakeLock.release();
|
||||||
Log.v(TAG, "Released Wake Lock to allow device to sleep.");
|
Log.d(TAG, "Released Wake Lock to allow device to sleep.");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e(TAG, "Error Releasing Wakelock - " + e.toString());
|
Log.e(TAG, "Error Releasing Wakelock - " + e.toString());
|
||||||
mUtil.writeToSysLogFile("SdServer.onDestroy() - Error releasing wakelock.");
|
mUtil.writeToSysLogFile("SdServer.onDestroy() - Error releasing wakelock.");
|
||||||
@@ -372,7 +372,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mSdDataSource != null) {
|
if (mSdDataSource != null) {
|
||||||
Log.i(TAG, "stopping mSdDataSource");
|
Log.d(TAG, "stopping mSdDataSource");
|
||||||
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping mSdDataSource");
|
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping mSdDataSource");
|
||||||
mSdDataSource.stop();
|
mSdDataSource.stop();
|
||||||
} else {
|
} else {
|
||||||
@@ -382,7 +382,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
|
|
||||||
// Stop the Cancel Audible timer
|
// Stop the Cancel Audible timer
|
||||||
if (mCancelAudibleTimer != null) {
|
if (mCancelAudibleTimer != null) {
|
||||||
Log.v(TAG, "onDestroy(): cancelling Cancel_Audible timer");
|
Log.d(TAG, "onDestroy(): cancelling Cancel_Audible timer");
|
||||||
mCancelAudibleTimer.cancel();
|
mCancelAudibleTimer.cancel();
|
||||||
//mCancelAudibleTimer.purge();
|
//mCancelAudibleTimer.purge();
|
||||||
mCancelAudibleTimer = null;
|
mCancelAudibleTimer = null;
|
||||||
@@ -391,23 +391,25 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
|
|
||||||
// Stop the Fault timer
|
// Stop the Fault timer
|
||||||
if (mFaultTimer != null) {
|
if (mFaultTimer != null) {
|
||||||
Log.v(TAG, "onDestroy(): cancelling fault timer");
|
Log.d(TAG, "onDestroy(): cancelling fault timer");
|
||||||
mFaultTimer.cancel();
|
mFaultTimer.cancel();
|
||||||
mFaultTimer = null;
|
mFaultTimer = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop the Event timer
|
// Stop the Event timer
|
||||||
if (mEventsTimer != null) {
|
if (mEventsTimer != null) {
|
||||||
Log.v(TAG, "onDestroy(): Cancelling events timer");
|
Log.d(TAG, "onDestroy(): Cancelling events timer");
|
||||||
stopValidatedEventsTimer();
|
stopValidatedEventsTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop the Cancel Alarm Latch timer
|
// Stop the Cancel Alarm Latch timer
|
||||||
|
Log.d(TAG,"onDestroy(): stopping alarm latch timer");
|
||||||
stopLatchTimer();
|
stopLatchTimer();
|
||||||
|
|
||||||
|
|
||||||
// Stop the location finder.
|
// Stop the location finder.
|
||||||
if (mLocationFinder != null) {
|
if (mLocationFinder != null) {
|
||||||
|
Log.d(TAG,"onDestroy(): stopping Location Finder");
|
||||||
mLocationFinder.destroy();
|
mLocationFinder.destroy();
|
||||||
mLocationFinder = null;
|
mLocationFinder = null;
|
||||||
}
|
}
|
||||||
@@ -415,7 +417,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// Stop web server
|
// Stop web server
|
||||||
Log.v(TAG, "onDestroy(): stopping web server");
|
Log.d(TAG, "onDestroy(): stopping web server");
|
||||||
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping Web Server");
|
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping Web Server");
|
||||||
stopWebServer();
|
stopWebServer();
|
||||||
|
|
||||||
@@ -425,24 +427,24 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
|
|
||||||
this.stopForeground(true);
|
this.stopForeground(true);
|
||||||
// Cancel the notification.
|
// Cancel the notification.
|
||||||
Log.v(TAG, "onDestroy(): cancelling notification");
|
Log.d(TAG, "onDestroy(): cancelling notification");
|
||||||
mUtil.writeToSysLogFile("SdServer.onDestroy - cancelling notification");
|
mUtil.writeToSysLogFile("SdServer.onDestroy - cancelling notification");
|
||||||
mNM.cancel(NOTIFICATION_ID);
|
mNM.cancel(NOTIFICATION_ID);
|
||||||
mNM.cancel(EVENT_NOTIFICATION_ID);
|
mNM.cancel(EVENT_NOTIFICATION_ID);
|
||||||
|
|
||||||
|
|
||||||
// stop this service.
|
// stop this service.
|
||||||
Log.v(TAG, "onDestroy(): calling stopSelf()");
|
Log.d(TAG, "onDestroy(): calling stopSelf()");
|
||||||
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping self");
|
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping self");
|
||||||
stopSelf();
|
stopSelf();
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.v(TAG, "Error in onDestroy() - " + e.toString());
|
Log.e(TAG, "Error in onDestroy() - " + e.toString());
|
||||||
mUtil.writeToSysLogFile("SdServer.onDestroy() -error " + e.toString());
|
mUtil.writeToSysLogFile("SdServer.onDestroy() -error " + e.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mLm != null) {
|
if (mLm != null) {
|
||||||
Log.i(TAG, "Closing Down Log Manager");
|
Log.d(TAG, "Closing Down Log Manager");
|
||||||
mLm.close();
|
mLm.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1594,10 +1596,10 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
public void stopValidatedEventsTimer() {
|
public void stopValidatedEventsTimer() {
|
||||||
if (mEventsTimer != null) {
|
if (mEventsTimer != null) {
|
||||||
Log.v(TAG, "stopEventsTimer(): timer already running - cancelling it.");
|
Log.v(TAG, "stopEventsTimer(): timer already running - cancelling it.");
|
||||||
mUtil.writeToSysLogFile("stopEventsTimer() - stopping timer");
|
mUtil.writeToSysLogFile("stopEventsTimer() - stopping timer, setting mIsRunning to false");
|
||||||
mEventsTimer.mIsRunning = false;
|
mEventsTimer.mIsRunning = false;
|
||||||
mEventsTimer.cancel();
|
mEventsTimer.cancel();
|
||||||
mEventsTimer = null;
|
//mEventsTimer = null;
|
||||||
} else {
|
} else {
|
||||||
Log.v(TAG, "stopEventsTimer(): timer not running - not doing anything.");
|
Log.v(TAG, "stopEventsTimer(): timer not running - not doing anything.");
|
||||||
}
|
}
|
||||||
@@ -1658,6 +1660,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
|||||||
}
|
}
|
||||||
if (mIsRunning) {
|
if (mIsRunning) {
|
||||||
// Restart this timer.
|
// Restart this timer.
|
||||||
|
Log.v(TAG,"CheckUnvalidatedEventsTimer.onFinish() - mIsRunning is true, so re-starting timer");
|
||||||
start();
|
start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ public class StartupActivity extends Activity {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mConnection = new SdServiceConnection(this);
|
mConnection = new SdServiceConnection(getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -186,7 +186,7 @@ public class StartupActivity extends Activity {
|
|||||||
// Bind to the service.
|
// Bind to the service.
|
||||||
Log.i(TAG,"onStart() - binding to server");
|
Log.i(TAG,"onStart() - binding to server");
|
||||||
mUtil.writeToSysLogFile("StartupActivity.onStart() - binding to server");
|
mUtil.writeToSysLogFile("StartupActivity.onStart() - binding to server");
|
||||||
mUtil.bindToServer(this, mConnection);
|
mUtil.bindToServer(getApplicationContext(), mConnection);
|
||||||
|
|
||||||
// Check power management settings
|
// Check power management settings
|
||||||
PowerManager powerManager = (PowerManager)getSystemService(Context.POWER_SERVICE);
|
PowerManager powerManager = (PowerManager)getSystemService(Context.POWER_SERVICE);
|
||||||
@@ -221,7 +221,7 @@ public class StartupActivity extends Activity {
|
|||||||
super.onStop();
|
super.onStop();
|
||||||
Log.i(TAG, "onStop() - unbinding from server");
|
Log.i(TAG, "onStop() - unbinding from server");
|
||||||
mUtil.writeToSysLogFile("StartupActivity.onStop() - unbinding from server");
|
mUtil.writeToSysLogFile("StartupActivity.onStop() - unbinding from server");
|
||||||
mUtil.unbindFromServer(this, mConnection);
|
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
||||||
mUiTimer.cancel();
|
mUiTimer.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -347,4 +347,5 @@
|
|||||||
<string name="shared_data">Shared Data</string>
|
<string name="shared_data">Shared Data</string>
|
||||||
<string name="prune_database">Prune Database</string>
|
<string name="prune_database">Prune Database</string>
|
||||||
<string name="check_seizures_message">Please select the events highlighted in pink to say if they are real seizures or false alarms</string>
|
<string name="check_seizures_message">Please select the events highlighted in pink to say if they are real seizures or false alarms</string>
|
||||||
|
<string name="error_server_not_running">ERROR: OpenSeizureDetector Server is not running - please re-start it</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user