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

Extract method scheduleNextPoll.

parent c0fd2dfd
No related branches found
No related tags found
No related merge requests found
......@@ -315,6 +315,14 @@ public class MedtronicCnlIntentService extends IntentService {
sendToXDrip();
uploadToNightscout();
scheduleNextPoll(timePollStarted, timeLastGoodSGV, pollInterval, df);
}
} finally {
MedtronicCnlAlarmReceiver.completeWakefulIntent(intent);
}
}
private void scheduleNextPoll(long timePollStarted, long timeLastGoodSGV, long pollInterval, DateFormat df) {
// smart polling and pump-sensor poll clash detection
long lastActualPollTime = timePollStarted;
if (timeLastGoodSGV > 0) {
......@@ -338,10 +346,6 @@ public class MedtronicCnlIntentService extends IntentService {
MedtronicCnlAlarmManager.setAlarm(nextRequestedPollTime);
sendStatus("Next poll due at: " + df.format(nextRequestedPollTime));
}
} finally {
MedtronicCnlAlarmReceiver.completeWakefulIntent(intent);
}
}
private boolean acquireUsbDevice() {
if (!hasUsbHostFeature()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment