Don't try to access injected omnipodPumpStatus in constructor

This commit is contained in:
Steffen Müthing 2020-08-17 00:22:38 +02:00
parent e432346fc5
commit 0fef4128ef

View file

@ -62,6 +62,11 @@ public class OmnipodCommunicationManager extends RileyLinkCommunicationManager {
@Inject @Inject
public OmnipodCommunicationManager(HasAndroidInjector injector, RFSpy rfspy) { public OmnipodCommunicationManager(HasAndroidInjector injector, RFSpy rfspy) {
super(injector, rfspy); super(injector, rfspy);
}
@Inject
public void onInit() {
// this cannot be done in the constructor, as sp is not populated at that time
omnipodPumpStatus.previousConnection = sp.getLong( omnipodPumpStatus.previousConnection = sp.getLong(
RileyLinkConst.Prefs.LastGoodDeviceCommunicationTime, 0L); RileyLinkConst.Prefs.LastGoodDeviceCommunicationTime, 0L);
} }