- added activities to ActivitiesModule

- fixed RileyLinkBLEScanActivity to work with omnipod
This commit is contained in:
Andy Rozman 2020-04-27 22:22:19 +01:00
parent f23680cee5
commit 67a41dedc4
2 changed files with 21 additions and 3 deletions

View file

@ -18,6 +18,8 @@ import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertAc
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingActivity
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity import info.nightscout.androidaps.plugins.pump.insight.activities.InsightPairingInformationActivity
import info.nightscout.androidaps.plugins.pump.medtronic.dialog.MedtronicHistoryActivity import info.nightscout.androidaps.plugins.pump.medtronic.dialog.MedtronicHistoryActivity
import info.nightscout.androidaps.plugins.pump.omnipod.dialogs.PodHistoryActivity
import info.nightscout.androidaps.plugins.pump.omnipod.dialogs.PodManagementActivity
import info.nightscout.androidaps.setupwizard.SetupWizardActivity import info.nightscout.androidaps.setupwizard.SetupWizardActivity
@Module @Module
@ -48,4 +50,7 @@ abstract class ActivitiesModule {
@ContributesAndroidInjector abstract fun contributesStatsActivity(): StatsActivity @ContributesAndroidInjector abstract fun contributesStatsActivity(): StatsActivity
@ContributesAndroidInjector abstract fun contributesSurveyActivity(): SurveyActivity @ContributesAndroidInjector abstract fun contributesSurveyActivity(): SurveyActivity
@ContributesAndroidInjector abstract fun contributesTDDStatsActivity(): TDDStatsActivity @ContributesAndroidInjector abstract fun contributesTDDStatsActivity(): TDDStatsActivity
@ContributesAndroidInjector abstract fun contributesPodManagementActivity(): PodManagementActivity
@ContributesAndroidInjector abstract fun contributesPodHistoryActivity(): PodHistoryActivity
} }

View file

@ -41,8 +41,10 @@ import javax.inject.Inject;
import info.nightscout.androidaps.R; import info.nightscout.androidaps.R;
import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; import info.nightscout.androidaps.activities.NoSplashAppCompatActivity;
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper; import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.common.ManufacturerType;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkUtil;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.GattAttributes;
@ -50,6 +52,9 @@ import info.nightscout.androidaps.plugins.pump.common.utils.LocationHelper;
import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus; import info.nightscout.androidaps.plugins.pump.medtronic.driver.MedtronicPumpStatus;
import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged; import info.nightscout.androidaps.plugins.pump.medtronic.events.EventMedtronicPumpConfigurationChanged;
import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil; import info.nightscout.androidaps.plugins.pump.medtronic.util.MedtronicUtil;
import info.nightscout.androidaps.plugins.pump.omnipod.driver.OmnipodPumpStatus;
import info.nightscout.androidaps.plugins.pump.omnipod.events.EventOmnipodPumpValuesChanged;
import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil;
import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.resources.ResourceHelper;
import info.nightscout.androidaps.utils.sharedPreferences.SP; import info.nightscout.androidaps.utils.sharedPreferences.SP;
@ -60,6 +65,7 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
@Inject SP sp; @Inject SP sp;
@Inject RxBusWrapper rxBus; @Inject RxBusWrapper rxBus;
@Inject ResourceHelper resourceHelper; @Inject ResourceHelper resourceHelper;
@Inject ActivePluginProvider activePlugin;
private static final int PERMISSION_REQUEST_COARSE_LOCATION = 30241; // arbitrary. private static final int PERMISSION_REQUEST_COARSE_LOCATION = 30241; // arbitrary.
private static final int REQUEST_ENABLE_BT = 30242; // arbitrary private static final int REQUEST_ENABLE_BT = 30242; // arbitrary
@ -110,10 +116,17 @@ public class RileyLinkBLEScanActivity extends NoSplashAppCompatActivity {
RileyLinkUtil.getRileyLinkSelectPreference().setSummary(bleAddress); RileyLinkUtil.getRileyLinkSelectPreference().setSummary(bleAddress);
MedtronicPumpStatus pumpStatus = MedtronicUtil.getPumpStatus(); if (activePlugin.getActivePump().manufacturer()== ManufacturerType.Medtronic) {
pumpStatus.verifyConfiguration(); // force reloading of address MedtronicPumpStatus pumpStatus = MedtronicUtil.getPumpStatus();
pumpStatus.verifyConfiguration(); // force reloading of address
rxBus.send(new EventMedtronicPumpConfigurationChanged()); rxBus.send(new EventMedtronicPumpConfigurationChanged());
} else if (activePlugin.getActivePump().manufacturer()== ManufacturerType.Insulet) {
OmnipodPumpStatus pumpStatus = OmnipodUtil.getPumpStatus();
pumpStatus.verifyConfiguration();
rxBus.send(new EventOmnipodPumpValuesChanged());
}
finish(); finish();
}); });