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

Extract method uploadPollResults.

parent 54221541
No related branches found
No related tags found
No related merge requests found
...@@ -311,10 +311,8 @@ public class MedtronicCnlIntentService extends IntentService { ...@@ -311,10 +311,8 @@ public class MedtronicCnlIntentService extends IntentService {
} }
realm.close(); realm.close();
} }
// TODO - set status if offline or Nightscout not reachable
sendToXDrip();
uploadToNightscout();
uploadPollResults();
scheduleNextPoll(timePollStarted, timeLastGoodSGV, pollInterval, df); scheduleNextPoll(timePollStarted, timeLastGoodSGV, pollInterval, df);
} }
} finally { } finally {
...@@ -386,6 +384,12 @@ public class MedtronicCnlIntentService extends IntentService { ...@@ -386,6 +384,12 @@ public class MedtronicCnlIntentService extends IntentService {
alarm.set(AlarmManager.RTC_WAKEUP, wakeTime, pendingIntent); alarm.set(AlarmManager.RTC_WAKEUP, wakeTime, pendingIntent);
} }
private void uploadPollResults() {
// TODO - set status if offline or Nightscout not reachable
sendToXDrip();
uploadToNightscout();
}
private void sendToXDrip() { private void sendToXDrip() {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
if (prefs.getBoolean(getString(R.string.preference_enable_xdrip_plus), false)) { 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.
Finish editing this message first!
Please register or to comment