From b435990f7af84126e79d17517b0612f8911b2ad9 Mon Sep 17 00:00:00 2001 From: vlad Date: Mon, 9 Feb 2015 16:42:09 +0200 Subject: [PATCH] Get back background service --- app/app.iml | 9 ++++----- app/build.gradle | 2 +- app/src/main/AndroidManifest.xml | 2 +- .../moduleok/notification/ScoreCheckerService.java | 3 +++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/app.iml b/app/app.iml index 3d00c8e..42735ed 100644 --- a/app/app.iml +++ b/app/app.iml @@ -87,17 +87,16 @@ - + + - - - - + + diff --git a/app/build.gradle b/app/build.gradle index 74610b2..33cf6cf 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -32,7 +32,7 @@ android { dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) retrolambdaConfig 'net.orfjackal.retrolambda:retrolambda:1.6.0' - compile 'net.sourceforge.streamsupport:streamsupport:1.1.3' +// compile 'net.sourceforge.streamsupport:streamsupport:1.1.3' compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.android.support:recyclerview-v7:21.0.3' compile 'org.jsoup:jsoup:1.8.1' diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1a75b94..c23ab3b 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -14,7 +14,7 @@ android:name=".App" android:theme="@style/AppTheme"> - + diff --git a/app/src/main/java/ua/samosfator/moduleok/notification/ScoreCheckerService.java b/app/src/main/java/ua/samosfator/moduleok/notification/ScoreCheckerService.java index 6648476..66d8c5a 100644 --- a/app/src/main/java/ua/samosfator/moduleok/notification/ScoreCheckerService.java +++ b/app/src/main/java/ua/samosfator/moduleok/notification/ScoreCheckerService.java @@ -82,10 +82,13 @@ public void onEvent(InternetConnectionAbsent event) { private void startServiceTimer() { moduleDatesUpdateTask = new ModuleDatesUpdateTask(); timer.schedule(moduleDatesUpdateTask, 200, TimeUnit.HOURS.toMillis(12)); + updateTimeTask = new UpdateTimeTask(); ModuleDatesUpdateTask.updatePendingModulesCount(); if (pendingModulesCount > 0) { timer.schedule(updateTimeTask, 0, TimeUnit.HOURS.toMillis(2)); + + Log.d(TAG, "" + pendingModulesCount + " modules in the near 2 days"); } else { Log.d(TAG, "No modules dates in the near 2 days"); }