Go to dead state if app tries to record without database ready.

This commit is contained in:
voussoir 2023-11-30 17:41:45 -08:00
parent b84185ea4e
commit 37c5754a24

View file

@ -215,6 +215,10 @@ class TrackerService: Service()
// at full power. A wakelock is used to resist Android's doze. This state should be active // at full power. A wakelock is used to resist Android's doze. This state should be active
// while out and about. // while out and about.
Log.i("VOUSSOIR", "TrackerService.state_full_power") Log.i("VOUSSOIR", "TrackerService.state_full_power")
if (! trackbook.database.ready)
{
state_dead()
}
tracking_state = Keys.STATE_FULL_RECORDING tracking_state = Keys.STATE_FULL_RECORDING
PreferencesHelper.saveTrackingState(tracking_state) PreferencesHelper.saveTrackingState(tracking_state)
reset_location_listeners(Keys.LOCATION_INTERVAL_FULL_POWER) reset_location_listeners(Keys.LOCATION_INTERVAL_FULL_POWER)
@ -365,7 +369,8 @@ class TrackerService: Service()
if(! trackbook.database.ready) if(! trackbook.database.ready)
{ {
Log.i("VOUSSOIR", "Omitting due to database not ready.") Log.i("VOUSSOIR", "TrackerService.onLocationChanged: database is not ready!!.")
state_dead()
return return
} }