Skip to content
Snippets Groups Projects
Unverified Commit c28470e8 authored by Johannes Mockenhaupt's avatar Johannes Mockenhaupt
Browse files

Extract method uploadPollResults.

parent 54221541
Branches
No related tags found
No related merge requests found
......@@ -311,10 +311,8 @@ public class MedtronicCnlIntentService extends IntentService {
}
realm.close();
}
// TODO - set status if offline or Nightscout not reachable
sendToXDrip();
uploadToNightscout();
uploadPollResults();
scheduleNextPoll(timePollStarted, timeLastGoodSGV, pollInterval, df);
}
} finally {
......@@ -386,6 +384,12 @@ public class MedtronicCnlIntentService extends IntentService {
alarm.set(AlarmManager.RTC_WAKEUP, wakeTime, pendingIntent);
}
private void uploadPollResults() {
// TODO - set status if offline or Nightscout not reachable
sendToXDrip();
uploadToNightscout();
}
private void sendToXDrip() {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
if (prefs.getBoolean(getString(R.string.preference_enable_xdrip_plus), false)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment