From cb47f9ab49909a49a8b653872db3dfc231734daf Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Sat, 1 Apr 2023 17:37:16 -0700 Subject: [PATCH] Combine unnecessary else if. --- app/src/main/java/net/voussoir/trkpt/TrackerService.kt | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/src/main/java/net/voussoir/trkpt/TrackerService.kt b/app/src/main/java/net/voussoir/trkpt/TrackerService.kt index d6bb3f3..782eae4 100644 --- a/app/src/main/java/net/voussoir/trkpt/TrackerService.kt +++ b/app/src/main/java/net/voussoir/trkpt/TrackerService.kt @@ -266,14 +266,10 @@ class TrackerService: Service() Log.i("VOUSSOIR", "Arrived at home.") 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 ( allow_sleep && has_motion_sensor && + location_interval != Keys.LOCATION_INTERVAL_SLEEP && (System.currentTimeMillis() - arrived_at_home) > TIME_UNTIL_SLEEP && (System.currentTimeMillis() - last_significant_motion) > TIME_UNTIL_SLEEP )