From 37ce34ad66d8b81c70a295678fd715cda82f263a Mon Sep 17 00:00:00 2001 From: Jonathan Klee Date: Mon, 28 Nov 2022 14:36:41 +0100 Subject: [PATCH] Make weather requests timing shorter There is a linear increase in terms of number of tries forcing weather request so this won't drain battery. --- .../e/blisslauncher/features/weather/WeatherUpdateService.java | 2 +- .../e/blisslauncher/features/weather/WeatherUpdater.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/foundation/e/blisslauncher/features/weather/WeatherUpdateService.java b/app/src/main/java/foundation/e/blisslauncher/features/weather/WeatherUpdateService.java index c88c7ca632..77d98496e9 100644 --- a/app/src/main/java/foundation/e/blisslauncher/features/weather/WeatherUpdateService.java +++ b/app/src/main/java/foundation/e/blisslauncher/features/weather/WeatherUpdateService.java @@ -16,7 +16,7 @@ public class WeatherUpdateService extends Service { public static final String ACTION_FORCE_UPDATE = "org.indin.blisslauncher.action.FORCE_WEATHER_UPDATE"; public static final String ACTION_UPDATE_FINISHED = "org.indin.blisslauncher.action.WEATHER_UPDATE_FINISHED"; - private static final long UPDATE_PERIOD_IN_MS = 10L * 1000L; + private static final long UPDATE_PERIOD_IN_MS = 5L * 1000L; private HandlerThread mHandlerThread; private Handler mHandler; diff --git a/app/src/main/java/foundation/e/blisslauncher/features/weather/WeatherUpdater.java b/app/src/main/java/foundation/e/blisslauncher/features/weather/WeatherUpdater.java index ba0e02b6b7..303aac6ae2 100644 --- a/app/src/main/java/foundation/e/blisslauncher/features/weather/WeatherUpdater.java +++ b/app/src/main/java/foundation/e/blisslauncher/features/weather/WeatherUpdater.java @@ -27,7 +27,7 @@ import lineageos.weather.WeatherLocation; public class WeatherUpdater { private static final String TAG = "WeatherUpdater"; - private static final long DEFAULT_FORCE_REQUEST_PERIOD_IN_MS = 60000L; + private static final long DEFAULT_FORCE_REQUEST_PERIOD_IN_MS = 10L * 1000L; private final LocationManager mLocationManager; private final WeakReference mWeakContext; -- GitLab