bug fix sync service (#3069)

This commit is contained in:
Ashish Kumar 2019-07-14 13:20:13 +05:30 committed by Vivek Maskara
parent cd57552d76
commit 0628b1b8f5
2 changed files with 5 additions and 1 deletions

View file

@ -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>

View file

@ -2,6 +2,7 @@ package fr.free.nrw.commons.contributions;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.ContentResolver;
import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
@ -103,6 +104,8 @@ public class MainActivity extends NavigationBaseActivity implements FragmentMana
}
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);