Commit 1c90b6ec authored by Viktor De Pasquale's avatar Viktor De Pasquale

Fixed notification popping up every time update is scheduled

parent c33cf9f8
...@@ -116,6 +116,8 @@ public class Utils { ...@@ -116,6 +116,8 @@ public class Utils {
if (Config.get(Config.Key.CHECK_UPDATES)) { if (Config.get(Config.Key.CHECK_UPDATES)) {
Constraints constraints = new Constraints.Builder() Constraints constraints = new Constraints.Builder()
.setRequiredNetworkType(NetworkType.CONNECTED) .setRequiredNetworkType(NetworkType.CONNECTED)
//ensures that notification doesn't pop up every time user starts the app
.setRequiresDeviceIdle(true)
.build(); .build();
Class<? extends ListenableWorker> service = (Class<? extends ListenableWorker>) ClassMap.get(UpdateCheckService.class); Class<? extends ListenableWorker> service = (Class<? extends ListenableWorker>) ClassMap.get(UpdateCheckService.class);
PeriodicWorkRequest request = new PeriodicWorkRequest PeriodicWorkRequest request = new PeriodicWorkRequest
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment