- removed dependencies to omnipod: Myprefernces, ActivitiesmOdules, AppComponent

- fixed commpiling problem
- removed OmnipodService from Manifest
This commit is contained in:
Andy Rozman 2020-05-04 17:51:06 +01:00
parent 1798d260eb
commit ea0b89cbf8
6 changed files with 16 additions and 30 deletions

View file

@ -300,16 +300,6 @@
android:theme="@style/Theme.AppCompat.NoTitle" />
<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
android:name="org.apache.http.legacy"

View file

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

View file

@ -50,7 +50,5 @@ abstract class ActivitiesModule {
@ContributesAndroidInjector abstract fun contributesStatsActivity(): StatsActivity
@ContributesAndroidInjector abstract fun contributesSurveyActivity(): SurveyActivity
@ContributesAndroidInjector abstract fun contributesTDDStatsActivity(): TDDStatsActivity
@ContributesAndroidInjector abstract fun contributesPodManagementActivity(): PodManagementActivity
@ContributesAndroidInjector abstract fun contributesPodHistoryActivity(): PodHistoryActivity
}

View file

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

View file

@ -21,6 +21,7 @@ import info.nightscout.androidaps.interfaces.PluginDescription;
import info.nightscout.androidaps.interfaces.PluginType;
import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.logging.LTag;
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction;
import info.nightscout.androidaps.plugins.pump.common.defs.PumpDriverState;
@ -43,10 +44,11 @@ import info.nightscout.androidaps.utils.sharedPreferences.SP;
* @author Andy Rozman (andy.rozman@gmail.com)
*/
// 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 {
// 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;
//private RileyLinkOmnipodService omnipodService;
@ -66,7 +68,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
private Profile currentProfile;
@Inject
//@Inject
public OmnipodDashPumpPlugin(HasAndroidInjector injector,
AAPSLogger aapsLogger,
RxBusWrapper rxBus,
@ -104,13 +106,13 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
//
// public void onServiceDisconnected(ComponentName name) {
// if (isLoggingEnabled())
// LOG.debug("RileyLinkOmnipodService is disconnected");
// aapsLogger.debug(LTag.PUMP, "RileyLinkOmnipodService is disconnected");
// omnipodService = null;
// }
//
// public void onServiceConnected(ComponentName name, IBinder service) {
// if (isLoggingEnabled())
// LOG.debug("RileyLinkOmnipodService is connected");
// aapsLogger.debug(LTag.PUMP, "RileyLinkOmnipodService is connected");
// RileyLinkOmnipodService.LocalBinder mLocalBinder = (RileyLinkOmnipodService.LocalBinder) service;
// omnipodService = mLocalBinder.getServiceInstance();
//
@ -121,7 +123,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
//
// if (OmnipodUtil.getPumpStatus() != null) {
// if (isLoggingEnabled())
// LOG.debug("Starting OmniPod-RileyLink service");
// aapsLogger.debug(LTag.PUMP, "Starting OmniPod-RileyLink service");
// if (OmnipodUtil.getPumpStatus().setNotInPreInit()) {
// break;
// }
@ -171,7 +173,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
@Override
public boolean isInitialized() {
if (displayConnectionMessages)
LOG.debug(getLogPrefix() + "isInitialized");
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "isInitialized");
return isServiceSet() && isInitialized;
}
@ -179,7 +181,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
@Override
public boolean isConnected() {
if (displayConnectionMessages)
LOG.debug(getLogPrefix() + "isConnected");
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "isConnected");
return isServiceSet() && isServiceInitialized();
}
@ -187,7 +189,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
@Override
public boolean isConnecting() {
if (displayConnectionMessages)
LOG.debug(getLogPrefix() + "isConnecting");
aapsLogger.debug(LTag.PUMP, getLogPrefix() + "isConnecting");
return !isServiceSet() || !isServiceInitialized();
}
@ -224,7 +226,7 @@ public class OmnipodDashPumpPlugin extends OmnipodPumpPlugin implements OmnipodP
private void initializePump(boolean realInit) {
LOG.info(getLogPrefix() + "initializePump - start");
aapsLogger.info(LTag.PUMP,getLogPrefix() + "initializePump - start");
if (omnipodCommunicationManager == null) {
omnipodCommunicationManager = OmnipodDashCommunicationManager.getInstance();

View file

@ -8,6 +8,7 @@ import org.slf4j.LoggerFactory;
import info.nightscout.androidaps.data.DetailedBolusInfo;
import info.nightscout.androidaps.data.Profile;
import info.nightscout.androidaps.data.PumpEnactResult;
import info.nightscout.androidaps.logging.AAPSLogger;
import info.nightscout.androidaps.logging.L;
import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair;
import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RFSpy;
@ -26,7 +27,9 @@ public class OmnipodDashCommunicationManager implements OmnipodCommunicationMana
// 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 String errorMessage;
@ -60,10 +63,6 @@ public class OmnipodDashCommunicationManager implements OmnipodCommunicationMana
}
private boolean isLogEnabled() {
return L.isEnabled(L.PUMPCOMM);
}
@Override
public PumpEnactResult initPod(PodInitActionType podInitActionType, PodInitReceiver podInitReceiver, Profile profile) {