Skip to content

Commit

Permalink
bug fix sync service (#3069)
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishkumar468 authored and maskaravivek committed Jul 14, 2019
1 parent cd57552 commit 0628b1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
</service>
<service
android:name=".contributions.ContributionsSyncService"
android:exported="true">
android:exported="true"
android:process=":sync">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
Expand Down Expand Up @@ -103,6 +104,8 @@ protected void onSaveInstanceState(Bundle outState) {
}

private void initMain() {
//Do not remove this, this triggers the sync service
ContentResolver.setSyncAutomatically(sessionManager.getCurrentAccount(),BuildConfig.CONTRIBUTION_AUTHORITY,true);
requestSync(sessionManager.getCurrentAccount(), BuildConfig.CONTRIBUTION_AUTHORITY, new Bundle());
uploadServiceIntent = new Intent(this, UploadService.class);
uploadServiceIntent.setAction(UploadService.ACTION_START_SERVICE);
Expand Down

0 comments on commit 0628b1b

Please sign in to comment.