Revert "- removed dependencies to omnipod: Myprefernces, ActivitiesmOdules, AppComponent"

This reverts commit ea0b89cbf8.
This commit is contained in:
Bart Sopers 2020-05-04 22:50:08 +02:00
parent ea0b89cbf8
commit 71d5409344
6 changed files with 30 additions and 16 deletions

View file

@ -300,6 +300,16 @@
android:theme="@style/Theme.AppCompat.NoTitle" /> android:theme="@style/Theme.AppCompat.NoTitle" />
<activity android:name=".plugins.pump.medtronic.dialog.MedtronicHistoryActivity" /> <activity android:name=".plugins.pump.medtronic.dialog.MedtronicHistoryActivity" />
<!-- Omnipod service and activities -->
<service
android:name=".plugins.pump.omnipod.service.RileyLinkOmnipodService"
android:enabled="true"
android:exported="true" />
<activity android:name=".plugins.pump.omnipod.dialogs.PodManagementActivity" />
<activity android:name=".plugins.pump.omnipod.dialogs.PodHistoryActivity" />
<activity android:name="com.atech.android.library.wizardpager.WizardPagerActivity"
android:theme="@style/AppTheme.NoActionBar"/>
<uses-library <uses-library
android:name="org.apache.http.legacy" android:name="org.apache.http.legacy"

View file

@ -79,6 +79,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
@Inject lateinit var loopPlugin: LoopPlugin @Inject lateinit var loopPlugin: LoopPlugin
@Inject lateinit var localInsightPlugin: LocalInsightPlugin @Inject lateinit var localInsightPlugin: LocalInsightPlugin
@Inject lateinit var medtronicPumpPlugin: MedtronicPumpPlugin @Inject lateinit var medtronicPumpPlugin: MedtronicPumpPlugin
@Inject lateinit var omnipodPumpPlugin: OmnipodPumpPlugin
@Inject lateinit var nsClientPlugin: NSClientPlugin @Inject lateinit var nsClientPlugin: NSClientPlugin
@Inject lateinit var openAPSAMAPlugin: OpenAPSAMAPlugin @Inject lateinit var openAPSAMAPlugin: OpenAPSAMAPlugin
@Inject lateinit var openAPSSMBPlugin: OpenAPSSMBPlugin @Inject lateinit var openAPSSMBPlugin: OpenAPSSMBPlugin
@ -174,6 +175,7 @@ class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChang
addPreferencesFromResourceIfEnabled(localInsightPlugin, rootKey, Config.PUMPDRIVERS) addPreferencesFromResourceIfEnabled(localInsightPlugin, rootKey, Config.PUMPDRIVERS)
addPreferencesFromResourceIfEnabled(comboPlugin, rootKey, Config.PUMPDRIVERS) addPreferencesFromResourceIfEnabled(comboPlugin, rootKey, Config.PUMPDRIVERS)
addPreferencesFromResourceIfEnabled(medtronicPumpPlugin, rootKey, Config.PUMPDRIVERS) addPreferencesFromResourceIfEnabled(medtronicPumpPlugin, rootKey, Config.PUMPDRIVERS)
addPreferencesFromResourceIfEnabled(omnipodPumpPlugin, rootKey, Config.PUMPDRIVERS)
addPreferencesFromResourceIfEnabled(virtualPumpPlugin, rootKey, !Config.NSCLIENT) addPreferencesFromResourceIfEnabled(virtualPumpPlugin, rootKey, !Config.NSCLIENT)
addPreferencesFromResourceIfEnabled(insulinOrefFreePeakPlugin, rootKey) addPreferencesFromResourceIfEnabled(insulinOrefFreePeakPlugin, rootKey)
addPreferencesFromResourceIfEnabled(nsClientPlugin, rootKey) addPreferencesFromResourceIfEnabled(nsClientPlugin, rootKey)

View file

@ -50,5 +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

@ -69,7 +69,8 @@ import javax.inject.Singleton
PreferencesModule::class, PreferencesModule::class,
OverviewModule::class, OverviewModule::class,
DataClassesModule::class, DataClassesModule::class,
SMSModule::class SMSModule::class,
OmnipodModule::class
] ]
) )
interface AppComponent : AndroidInjector<MainApp> { interface AppComponent : AndroidInjector<MainApp> {

View file

@ -21,7 +21,6 @@ import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType; import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper; import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction; import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState; import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState;
@ -44,11 +43,10 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP;
* @author Andy Rozman (andy.rozman@gmail.com) * @author Andy Rozman (andy.rozman@gmail.com)
*/ */
// FIXME this is just placeholder for now, but this should use most of OmnipodPumpPlugin implementation // FIXME this is just placeholder for now, but this should use most of OmnipodPumpPlugin implementation
// not dagger compatible, but first step is done
public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodPumpPluginInterface { public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodPumpPluginInterface {
// TODO Dagger // TODO Dagger
//private static final Logger LOG = LoggerFactory.getLogger(L.PUMP); private static final Logger LOG = LoggerFactory.getLogger(L.PUMP);
protected static OmnipodDashPumpPlugin plugin = null; protected static OmnipodDashPumpPlugin plugin = null;
//private RileyLinkOmnipodService omnipodService; //private RileyLinkOmnipodService omnipodService;
@ -68,7 +66,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
private Profile currentProfile; private Profile currentProfile;
//@Inject @Inject
public OmnipodDashPumpPlugin(HasAndroidInjector injector, public OmnipodDashPumpPlugin(HasAndroidInjector injector,
AAPSLogger aapsLogger, AAPSLogger aapsLogger,
RxBusWrapper rxBus, RxBusWrapper rxBus,
@ -106,13 +104,13 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
// //
// public void onServiceDisconnected(ComponentName name) { // public void onServiceDisconnected(ComponentName name) {
// if (isLoggingEnabled()) // if (isLoggingEnabled())
// aapsLogger.debug(LTag.PUMP, "RileyLinkOmnipodService is disconnected"); // LOG.debug("RileyLinkOmnipodService is disconnected");
// omnipodService = null; // omnipodService = null;
// } // }
// //
// public void onServiceConnected(ComponentName name, IBinder service) { // public void onServiceConnected(ComponentName name, IBinder service) {
// if (isLoggingEnabled()) // if (isLoggingEnabled())
// aapsLogger.debug(LTag.PUMP, "RileyLinkOmnipodService is connected"); // LOG.debug("RileyLinkOmnipodService is connected");
// RileyLinkOmnipodService.LocalBinder mLocalBinder = (RileyLinkOmnipodService.LocalBinder) service; // RileyLinkOmnipodService.LocalBinder mLocalBinder = (RileyLinkOmnipodService.LocalBinder) service;
// omnipodService = mLocalBinder.getServiceInstance(); // omnipodService = mLocalBinder.getServiceInstance();
// //
@ -123,7 +121,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
// //
// if (OmnipodUtil.getPumpStatus() != null) { // if (OmnipodUtil.getPumpStatus() != null) {
// if (isLoggingEnabled()) // if (isLoggingEnabled())
// aapsLogger.debug(LTag.PUMP, "Starting OmniPod-RileyLink service"); // LOG.debug("Starting OmniPod-RileyLink service");
// if (OmnipodUtil.getPumpStatus().setNotInPreInit()) { // if (OmnipodUtil.getPumpStatus().setNotInPreInit()) {
// break; // break;
// } // }
@ -173,7 +171,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
@Override @Override
public boolean isInitialized() { public boolean isInitialized() {
if (displayConnectionMessages) if (displayConnectionMessages)
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "isInitialized"); LOG.debug(getLogPrefix() + "isInitialized");
return isServiceSet() && isInitialized; return isServiceSet() && isInitialized;
} }
@ -181,7 +179,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
@Override @Override
public boolean isConnected() { public boolean isConnected() {
if (displayConnectionMessages) if (displayConnectionMessages)
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "isConnected"); LOG.debug(getLogPrefix() + "isConnected");
return isServiceSet() && isServiceInitialized(); return isServiceSet() && isServiceInitialized();
} }
@ -189,7 +187,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
@Override @Override
public boolean isConnecting() { public boolean isConnecting() {
if (displayConnectionMessages) if (displayConnectionMessages)
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "isConnecting"); LOG.debug(getLogPrefix() + "isConnecting");
return !isServiceSet() || !isServiceInitialized(); return !isServiceSet() || !isServiceInitialized();
} }
@ -226,7 +224,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
private void initializePump(boolean realInit) { private void initializePump(boolean realInit) {
aapsLogger.info(LTag.PUMP,getLogPrefix() + "initializePump - start"); LOG.info(getLogPrefix() + "initializePump - start");
if (omnipodCommunicationManager == null) { if (omnipodCommunicationManager == null) {
omnipodCommunicationManager = OmnipodDashCommunicationManager.getInstance(); omnipodCommunicationManager = OmnipodDashCommunicationManager.getInstance();

View file

@ -8,7 +8,6 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.PumpEnactResult; import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair; import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy; import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy;
@ -27,9 +26,7 @@ public class OmnipodDashCommunicationManager implements OmnipodCommunicationMana
// TODO Dagger // TODO Dagger
//private static final Logger LOG = LoggerFactory.getLogger(L.PUMPCOMM); private static final Logger LOG = LoggerFactory.getLogger(L.PUMPCOMM);
private AAPSLogger aapsLogger;
private static OmnipodDashCommunicationManager omnipodCommunicationManager; private static OmnipodDashCommunicationManager omnipodCommunicationManager;
private String errorMessage; private String errorMessage;
@ -63,6 +60,10 @@ public class OmnipodDashCommunicationManager implements OmnipodCommunicationMana
} }
private boolean isLogEnabled() {
return L.isEnabled(L.PUMPCOMM);
}
@Override @Override
public PumpEnactResult initPod(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver, Profile profile) { public PumpEnactResult initPod(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver, Profile profile) {