Fixed issue with V4 refusing to shutdown after logging into the data sharing system....I think :)
This commit is contained in:
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.
BIN
app/release/old_versions/app-release-4.0.0h.apk
Normal file
BIN
app/release/old_versions/app-release-4.0.0h.apk
Normal file
Binary file not shown.
@@ -31,11 +31,16 @@ public class AuthenticateActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
Log.v(TAG, "onCreate()");
|
||||
Log.d(TAG, "onCreate()");
|
||||
super.onCreate(savedInstanceState);
|
||||
setContentView(R.layout.activity_authenticate);
|
||||
|
||||
mUtil = new OsdUtil(getApplicationContext(), serverStatusHandler);
|
||||
|
||||
if (!mUtil.isServerRunning()) {
|
||||
mUtil.showToast("ERROR: OpenSeizureDetector Server is not running - please re-start it");
|
||||
finish();
|
||||
}
|
||||
mConnection = new SdServiceConnection(getApplicationContext());
|
||||
|
||||
Button cancelBtn =
|
||||
@@ -61,13 +66,21 @@ public class AuthenticateActivity extends AppCompatActivity {
|
||||
|
||||
@Override
|
||||
protected void onStart() {
|
||||
Log.d(TAG, "onStart()");
|
||||
super.onStart();
|
||||
mUtil.bindToServer(getApplicationContext(), mConnection);
|
||||
waitForConnection();
|
||||
|
||||
updateUi();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
Log.d(TAG, "onStop()");
|
||||
super.onStop();
|
||||
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
||||
}
|
||||
|
||||
|
||||
private void waitForConnection() {
|
||||
// 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
|
||||
|
||||
@@ -68,6 +68,12 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
super.onCreate(savedInstanceState);
|
||||
mContext = this;
|
||||
mUtil = new OsdUtil(getApplicationContext(), serverStatusHandler);
|
||||
|
||||
if (!mUtil.isServerRunning()) {
|
||||
mUtil.showToast("ERROR: OpenSeizureDetector Server is not running - please re-start it");
|
||||
finish();
|
||||
}
|
||||
|
||||
mConnection = new SdServiceConnection(getApplicationContext());
|
||||
|
||||
setContentView(R.layout.activity_log_manager_control);
|
||||
@@ -137,7 +143,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
Log.v(TAG, "onStop()");
|
||||
super.onStop();
|
||||
stopUiTimer();
|
||||
mUtil.unbindFromServer(this, mConnection);
|
||||
mUtil.unbindFromServer(getApplicationContext(), mConnection);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -559,7 +565,7 @@ public class LogManagerControlActivity extends AppCompatActivity {
|
||||
public View getView(int position, View convertView, ViewGroup parent) {
|
||||
View v = super.getView(position, convertView, parent);
|
||||
Map<String, ?> dataItem = (Map<String,?>)getItem(position);
|
||||
Log.i(TAG,dataItem.toString());
|
||||
Log.v(TAG,"getView() "+dataItem.toString());
|
||||
switch(dataItem.get("type").toString()) {
|
||||
case "null":
|
||||
v.setBackgroundColor(Color.parseColor("#ffaaaa"));
|
||||
|
||||
@@ -369,7 +369,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onStart() {
|
||||
super.onStart();
|
||||
Log.i(TAG,"onStart()");
|
||||
Log.d(TAG,"onStart()");
|
||||
mUtil.writeToSysLogFile("MainActivity.onStart()");
|
||||
SharedPreferences SP = PreferenceManager
|
||||
.getDefaultSharedPreferences(getBaseContext());
|
||||
@@ -403,7 +403,7 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onStop() {
|
||||
super.onStop();
|
||||
Log.i(TAG,"onStop() - unbinding from server");
|
||||
Log.d(TAG,"onStop() - unbinding from server");
|
||||
mUtil.writeToSysLogFile("MainActivity.onStop()");
|
||||
mUtil.unbindFromServer(this, mConnection);
|
||||
mUiTimer.cancel();
|
||||
@@ -903,14 +903,14 @@ public class MainActivity extends AppCompatActivity {
|
||||
@Override
|
||||
protected void onPause() {
|
||||
super.onPause();
|
||||
Log.i(TAG,"onPause()");
|
||||
Log.d(TAG,"onPause()");
|
||||
mUtil.writeToSysLogFile("MainActivity.onPause()");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
Log.i(TAG,"onResume()");
|
||||
Log.d(TAG,"onResume()");
|
||||
mUtil.writeToSysLogFile("MainActivity.onResume()");
|
||||
}
|
||||
|
||||
|
||||
@@ -226,7 +226,7 @@ public class OsdUtil implements ActivityCompat.OnRequestPermissionsResultCallbac
|
||||
/**
|
||||
* 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.
|
||||
if (sdServiceConnection.mBound) {
|
||||
Log.i(TAG, "unbindFromServer() - unbinding");
|
||||
|
||||
@@ -360,7 +360,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
if (mWakeLock != null) {
|
||||
try {
|
||||
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) {
|
||||
Log.e(TAG, "Error Releasing Wakelock - " + e.toString());
|
||||
mUtil.writeToSysLogFile("SdServer.onDestroy() - Error releasing wakelock.");
|
||||
@@ -372,7 +372,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
}
|
||||
|
||||
if (mSdDataSource != null) {
|
||||
Log.i(TAG, "stopping mSdDataSource");
|
||||
Log.d(TAG, "stopping mSdDataSource");
|
||||
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping mSdDataSource");
|
||||
mSdDataSource.stop();
|
||||
} else {
|
||||
@@ -382,7 +382,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
|
||||
// Stop the Cancel Audible timer
|
||||
if (mCancelAudibleTimer != null) {
|
||||
Log.v(TAG, "onDestroy(): cancelling Cancel_Audible timer");
|
||||
Log.d(TAG, "onDestroy(): cancelling Cancel_Audible timer");
|
||||
mCancelAudibleTimer.cancel();
|
||||
//mCancelAudibleTimer.purge();
|
||||
mCancelAudibleTimer = null;
|
||||
@@ -391,23 +391,25 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
|
||||
// Stop the Fault timer
|
||||
if (mFaultTimer != null) {
|
||||
Log.v(TAG, "onDestroy(): cancelling fault timer");
|
||||
Log.d(TAG, "onDestroy(): cancelling fault timer");
|
||||
mFaultTimer.cancel();
|
||||
mFaultTimer = null;
|
||||
}
|
||||
|
||||
// Stop the Event timer
|
||||
if (mEventsTimer != null) {
|
||||
Log.v(TAG, "onDestroy(): Cancelling events timer");
|
||||
Log.d(TAG, "onDestroy(): Cancelling events timer");
|
||||
stopValidatedEventsTimer();
|
||||
}
|
||||
|
||||
// Stop the Cancel Alarm Latch timer
|
||||
Log.d(TAG,"onDestroy(): stopping alarm latch timer");
|
||||
stopLatchTimer();
|
||||
|
||||
|
||||
// Stop the location finder.
|
||||
if (mLocationFinder != null) {
|
||||
Log.d(TAG,"onDestroy(): stopping Location Finder");
|
||||
mLocationFinder.destroy();
|
||||
mLocationFinder = null;
|
||||
}
|
||||
@@ -415,7 +417,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
|
||||
try {
|
||||
// Stop web server
|
||||
Log.v(TAG, "onDestroy(): stopping web server");
|
||||
Log.d(TAG, "onDestroy(): stopping web server");
|
||||
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping Web Server");
|
||||
stopWebServer();
|
||||
|
||||
@@ -425,24 +427,24 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
|
||||
this.stopForeground(true);
|
||||
// Cancel the notification.
|
||||
Log.v(TAG, "onDestroy(): cancelling notification");
|
||||
Log.d(TAG, "onDestroy(): cancelling notification");
|
||||
mUtil.writeToSysLogFile("SdServer.onDestroy - cancelling notification");
|
||||
mNM.cancel(NOTIFICATION_ID);
|
||||
mNM.cancel(EVENT_NOTIFICATION_ID);
|
||||
|
||||
|
||||
// stop this service.
|
||||
Log.v(TAG, "onDestroy(): calling stopSelf()");
|
||||
Log.d(TAG, "onDestroy(): calling stopSelf()");
|
||||
mUtil.writeToSysLogFile("SdServer.onDestroy() - stopping self");
|
||||
stopSelf();
|
||||
|
||||
} 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());
|
||||
}
|
||||
|
||||
if (mLm != null) {
|
||||
Log.i(TAG, "Closing Down Log Manager");
|
||||
Log.d(TAG, "Closing Down Log Manager");
|
||||
mLm.close();
|
||||
}
|
||||
|
||||
@@ -1594,10 +1596,10 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
public void stopValidatedEventsTimer() {
|
||||
if (mEventsTimer != null) {
|
||||
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.cancel();
|
||||
mEventsTimer = null;
|
||||
//mEventsTimer = null;
|
||||
} else {
|
||||
Log.v(TAG, "stopEventsTimer(): timer not running - not doing anything.");
|
||||
}
|
||||
@@ -1658,6 +1660,7 @@ public class SdServer extends Service implements SdDataReceiver {
|
||||
}
|
||||
if (mIsRunning) {
|
||||
// Restart this timer.
|
||||
Log.v(TAG,"CheckUnvalidatedEventsTimer.onFinish() - mIsRunning is true, so re-starting timer");
|
||||
start();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user