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

opensrp / opensrp-client-core / #174

pending completion
#174

Pull #921

github-actions

web-flow
Merge 66d3a69a9 into f9f6e7f97
Pull Request #921: Refactor user settings task

18309 of 26768 relevant lines covered (68.4%)

0.68 hits per line

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

60.0
opensrp-core/src/main/java/org/smartregister/sync/SaveANMLocationTask.java
1
package org.smartregister.sync;
2

3
import android.os.AsyncTask;
4

5
import org.apache.commons.lang3.StringUtils;
6
import org.smartregister.repository.AllSettings;
7

8
import timber.log.Timber;
9

10
public class SaveANMLocationTask extends AsyncTask<String, Void, String> {
11
    private final AllSettings allSettings;
12

13
    public SaveANMLocationTask(AllSettings allSettings) {
1✔
14
        this.allSettings = allSettings;
1✔
15
    }
1✔
16

17
    @Override
18
    protected String doInBackground(String... anmLocation) {
19
        if (StringUtils.isNotBlank(anmLocation[0])) {
1✔
20
            allSettings.saveANMLocation(anmLocation[0]);
1✔
21
        } else {
22
            Timber.e("Unable to save ANM Location. String is NULL or EMPTY");
×
23
        }
24
        return anmLocation[0];
1✔
25
    }
26

27
    @Override
28
    protected void onPostExecute(String anmLocation) {
29
        Timber.i("Successfully executed SaveANMLocationTask for: %s", anmLocation);
×
30
        super.onPostExecute(anmLocation);
×
31
    }
×
32
}
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