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 { public class PodSessionState extends PodState {
@Inject AAPSLogger aapsLogger; @Inject transient AAPSLogger aapsLogger;
@Inject SP sp; @Inject transient SP sp;
@Inject OmnipodUtil omnipodUtil; @Inject transient OmnipodUtil omnipodUtil;
@Inject DateUtil dateUtil; @Inject transient DateUtil dateUtil;
private transient PodStateChangedHandler stateChangedHandler; 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 final Map<AlertSlot, AlertType> configuredAlerts;
private DateTimeZone timeZone; private DateTimeZone timeZone;
private DateTime activatedAt; private DateTime activatedAt;
@ -78,10 +82,12 @@ public class PodSessionState extends PodState {
handleUpdates(); handleUpdates();
} }
@Deprecated
public void injectDaggerClass(HasAndroidInjector injector) { public void injectDaggerClass(HasAndroidInjector injector) {
injector.androidInjector().inject(this); injector.androidInjector().inject(this);
} }
@Deprecated
public void setStateChangedHandler(PodStateChangedHandler handler) { public void setStateChangedHandler(PodStateChangedHandler handler) {
// FIXME this is an ugly workaround for not being able to serialize the PodStateChangedHandler // FIXME this is an ugly workaround for not being able to serialize the PodStateChangedHandler
if (stateChangedHandler != null) { 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 * Created by andy on 4.8.2019
*/ */
// TODO refactor to use dagger, just commented out errors // TODO refactor to use dagger, just commented out errors
// TODO is this class used? remove if not
public class OmnipodDashCommunicationManager implements OmnipodCommunicationManagerInterface { public class OmnipodDashCommunicationManager implements OmnipodCommunicationManagerInterface {
// TODO Dagger // TODO Dagger
// private static final Logger LOG = LoggerFactory.getLogger(L.PUMPCOMM); // private static final Logger LOG = LoggerFactory.getLogger(L.PUMPCOMM);
// i didn't find where you instantiate this
private static OmnipodDashCommunicationManager omnipodCommunicationManager; private static OmnipodDashCommunicationManager omnipodCommunicationManager;
private String errorMessage; private String errorMessage;
@ -38,6 +40,7 @@ public class OmnipodDashCommunicationManager implements OmnipodCommunicationMana
return null; return null;
} }
@Deprecated
public static OmnipodDashCommunicationManager getInstance() { public static OmnipodDashCommunicationManager getInstance() {
return omnipodCommunicationManager; return omnipodCommunicationManager;
} }