Add dagger annotations in AapsPodStateManager

This commit is contained in:
Bart Sopers 2020-08-08 15:42:53 +02:00
parent ffb518f50f
commit a06d78b0b7

View file

@ -11,6 +11,9 @@ import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import javax.inject.Inject;
import dagger.android.HasAndroidInjector;
import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.LTag; import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.StatusResponse; import info.nightscout.androidaps.plugins.pump.omnipod.comm.message.response.StatusResponse;
@ -31,17 +34,14 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP;
public class AapsPodStateManager implements PodStateManager { public class AapsPodStateManager implements PodStateManager {
private final AAPSLogger aapsLogger; @Inject private AAPSLogger aapsLogger;
private final SP sp; @Inject private SP sp;
private final OmnipodUtil omnipodUtil; @Inject private OmnipodUtil omnipodUtil;
private PodState podState; private PodState podState;
// TODO dagger public AapsPodStateManager(HasAndroidInjector injector) {
public AapsPodStateManager(AAPSLogger aapsLogger, SP sp, OmnipodUtil omnipodUtil) { injector.androidInjector().inject(this);
this.aapsLogger = aapsLogger;
this.sp = sp;
this.omnipodUtil = omnipodUtil;
// TODO is there something like @PostConstruct in Dagger? if so, we should probably move loading the pod state there // TODO is there something like @PostConstruct in Dagger? if so, we should probably move loading the pod state there
loadPodState(); loadPodState();