Skip to content

Commit

Permalink
Get back background service
Browse files Browse the repository at this point in the history
  • Loading branch information
vladholubiev committed Feb 9, 2015
1 parent 3b374d8 commit b435990
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
9 changes: 4 additions & 5 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,16 @@
</content>
<orderEntry type="jdk" jdkName="Android API 21 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" exported="" name="streamsupport-1.1.3" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="library-2.4.0" level="project" />
<orderEntry type="library" exported="" name="mint-4.0.8" level="project" />
<orderEntry type="library" exported="" name="jsoup-1.8.1" level="project" />
<orderEntry type="library" exported="" name="eventbus-2.4.0" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
<orderEntry type="library" exported="" name="material-ripple-0.9.5-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="appcompat-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="mint-4.0.8" level="project" />
<orderEntry type="library" exported="" name="recyclerview-v7-21.0.3" level="project" />
<orderEntry type="library" exported="" name="library-1.0.7" level="project" />
<orderEntry type="library" exported="" name="support-v4-21.0.3" level="project" />
<orderEntry type="library" exported="" name="library-1.7.1" level="project" />
<orderEntry type="library" exported="" name="material-ripple-0.9.5-SNAPSHOT" level="project" />
<orderEntry type="library" exported="" name="support-annotations-21.0.3" level="project" />
<orderEntry type="library" exported="" name="library-1.1.3" level="project" />
</component>
Expand Down
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
android:name=".App"
android:theme="@style/AppTheme">

<!--<service android:enabled="true" android:name=".notification.ScoreCheckerService" />-->
<service android:enabled="true" android:name=".notification.ScoreCheckerService" />

<receiver android:name=".InternetConnectionReceiver">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down

0 comments on commit b435990

Please sign in to comment.