diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/state/PodSessionState.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/state/PodSessionState.java index 97ac22bda1..862976afbc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/state/PodSessionState.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/defs/state/PodSessionState.java @@ -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 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) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java index 4f869bd286..e440d632a5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod_dash/comm/OmnipodDashCommunicationManager.java @@ -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; }