Synchronize modification of list in OmnipodPumpPlugin

This commit is contained in:
Bart Sopers 2020-09-09 23:31:58 +02:00
parent 025f25fb27
commit b474e72a53

View file

@ -462,6 +462,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
if (firstRun) {
initializeAfterRileyLinkConnection();
} else if (!statusRequestList.isEmpty()) {
synchronized (statusRequestList) {
Iterator<OmnipodStatusRequestType> iterator = statusRequestList.iterator();
while (iterator.hasNext()) {
@ -501,6 +502,7 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
}
iterator.remove();
}
}
} else if (this.hasTimeDateOrTimeZoneChanged) {
PumpEnactResult result = executeCommand(OmnipodCommandType.SET_TIME, aapsOmnipodManager::setTime);
@ -830,8 +832,10 @@ public class OmnipodPumpPlugin extends PumpPluginBase implements PumpInterface,
}
public void addPodStatusRequest(OmnipodStatusRequestType pumpStatusRequest) {
synchronized (statusRequestList) {
statusRequestList.add(pumpStatusRequest);
}
}
@Override
public boolean isFakingTempsByExtendedBoluses() {