• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

opensrp / opensrp-client-core / #181

06 Aug 2024 05:51AM UTC coverage: 68.398% (+0.003%) from 68.395%
#181

Pull #925

github

web-flow
Merge 605302deb into 4fcf06cf5
Pull Request #925: migrate SyncserviceJob to work manager

18313 of 26774 relevant lines covered (68.4%)

0.68 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

81.82
opensrp-core/src/main/java/org/smartregister/multitenant/check/SettingsSyncedCheck.java
1
package org.smartregister.multitenant.check;
2

3
import androidx.annotation.NonNull;
4
import androidx.annotation.WorkerThread;
5

6
import org.json.JSONException;
7
import org.smartregister.exception.PreResetAppOperationException;
8
import org.smartregister.repository.AllSettings;
9
import org.smartregister.sync.helper.SyncSettingsServiceHelper;
10
import org.smartregister.view.activity.DrishtiApplication;
11

12
import timber.log.Timber;
13

14
/**
15
 * Created by Ephraim Kigamba - nek.eam@gmail.com on 17-04-2020.
16
 */
17
public class SettingsSyncedCheck implements PreResetAppCheck{
1✔
18

19
    public static final String UNIQUE_NAME = "SettingsSyncedCheck";
20

21
    @WorkerThread
22
    @Override
23
    public boolean isCheckOk(@NonNull DrishtiApplication drishtiApplication) {
24
        return isSettingsSynced(drishtiApplication);
1✔
25
    }
26

27
    @WorkerThread
28
    @Override
29
    public void performPreResetAppOperations(@NonNull DrishtiApplication application) throws PreResetAppOperationException {
30
        SyncSettingsServiceHelper syncSettingsServiceHelper = new SyncSettingsServiceHelper(application.getContext().configuration().dristhiBaseURL(), application.getContext().getHttpAgent());
1✔
31
        try {
32
            syncSettingsServiceHelper.processIntent();
1✔
33
        } catch (JSONException e) {
×
34
            Timber.e(e);
×
35
        }
1✔
36
    }
1✔
37

38
    public boolean isSettingsSynced(@NonNull DrishtiApplication application) {
39
        AllSettings allSettings = application.getContext().allSettings();
1✔
40
        return allSettings.getUnsyncedSettingsCount() == 0;
1✔
41
    }
42

43
    @NonNull
44
    @Override
45
    public String getUniqueName() {
46
        return UNIQUE_NAME;
1✔
47
    }
48
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc