Combine unnecessary else if.

This commit is contained in:
voussoir 2023-04-01 17:37:16 -07:00
parent 6ad4c2dbe5
commit cb47f9ab49

View file

@ -266,14 +266,10 @@ class TrackerService: Service()
Log.i("VOUSSOIR", "Arrived at home.") Log.i("VOUSSOIR", "Arrived at home.")
arrived_at_home = System.currentTimeMillis() arrived_at_home = System.currentTimeMillis()
} }
else if (location_interval == Keys.LOCATION_INTERVAL_SLEEP)
{
// If we are already asleep, do not reset the listeners again because
// that immediately fetches a new location.
}
else if ( else if (
allow_sleep && allow_sleep &&
has_motion_sensor && has_motion_sensor &&
location_interval != Keys.LOCATION_INTERVAL_SLEEP &&
(System.currentTimeMillis() - arrived_at_home) > TIME_UNTIL_SLEEP && (System.currentTimeMillis() - arrived_at_home) > TIME_UNTIL_SLEEP &&
(System.currentTimeMillis() - last_significant_motion) > TIME_UNTIL_SLEEP (System.currentTimeMillis() - last_significant_motion) > TIME_UNTIL_SLEEP
) )