Omni comments

This commit is contained in:
Milos Kozak 2020-05-08 00:23:17 +02:00
parent 25bf92300b
commit 7dc7c9528b
2 changed files with 13 additions and 4 deletions

View file

@ -33,13 +33,17 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP;
public class PodSessionState extends PodState {
@Inject AAPSLogger aapsLogger;
@Inject SP sp;
@Inject OmnipodUtil omnipodUtil;
@Inject DateUtil dateUtil;
@Inject transient AAPSLogger aapsLogger;
@Inject transient SP sp;
@Inject transient OmnipodUtil omnipodUtil;
@Inject transient DateUtil dateUtil;
private transient PodStateChangedHandler stateChangedHandler;
// TODO
// the problem you have with injection in this class is that you are mixing
// data storing and handlind. Move these member variables to extra class you can
// easy serialize and load it here by setData(dataInOtherClass)
private final Map<AlertSlot, AlertType> configuredAlerts;
private DateTimeZone timeZone;
private DateTime activatedAt;
@ -78,10 +82,12 @@ public class PodSessionState extends PodState {
handleUpdates();
}
@Deprecated
public void injectDaggerClass(HasAndroidInjector injector) {
injector.androidInjector().inject(this);
}
@Deprecated
public void setStateChangedHandler(PodStateChangedHandler handler) {
// FIXME this is an ugly workaround for not being able to serialize the PodStateChangedHandler
if (stateChangedHandler != null) {

View file

@ -18,12 +18,14 @@ import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus;
* Created by andy on 4.8.2019
*/
// TODO refactor to use dagger, just commented out errors
// TODO is this class used? remove if not
public class OmnipodDashCommunicationManager implements OmnipodCommunicationManagerInterface {
// TODO Dagger
// private static final Logger LOG = LoggerFactory.getLogger(L.PUMPCOMM);
// i didn't find where you instantiate this
private static OmnipodDashCommunicationManager omnipodCommunicationManager;
private String errorMessage;
@ -38,6 +40,7 @@ public class OmnipodDashCommunicationManager implements OmnipodCommunicationMana
return null;
}
@Deprecated
public static OmnipodDashCommunicationManager getInstance() {
return omnipodCommunicationManager;
}