diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java index c1be954790..fa869c803d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/OmnipodPumpPlugin.java @@ -24,6 +24,7 @@ import java.util.Set; import info.nightscout.androidaps.BuildConfig; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.activities.ErrorHelperActivity; import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.PumpEnactResult; @@ -38,7 +39,6 @@ import info.nightscout.androidaps.plugins.bus.RxBus; import info.nightscout.androidaps.plugins.configBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.general.actions.defs.CustomAction; import info.nightscout.androidaps.plugins.general.actions.defs.CustomActionType; -import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity; import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.general.overview.notifications.Notification; @@ -292,7 +292,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump private void doPodCheck() { if (System.currentTimeMillis() > this.nextPodCheck) { - if (OmnipodUtil.getDriverState()==OmnipodDriverState.Initalized_NoPod) { + if (OmnipodUtil.getDriverState() == OmnipodDriverState.Initalized_NoPod) { Notification notification = new Notification(Notification.OMNIPOD_POD_NOT_ATTACHED, MainApp.gs(R.string.omnipod_error_pod_not_attached), Notification.NORMAL); RxBus.INSTANCE.send(new EventNewNotification(notification)); } else { @@ -966,7 +966,7 @@ public class OmnipodPumpPlugin extends PumpPluginAbstract implements OmnipodPump if (isLoggingEnabled()) LOG.warn(getLogPrefix() + "Time, Date and/or TimeZone changed. [changeType={}, eventHandlingEnabled={}]", timeChangeType.name(), pumpStatusLocal.timeChangeEventEnabled); - if (OmnipodUtil.getDriverState()==OmnipodDriverState.Initalized_PodAvailable) { + if (OmnipodUtil.getDriverState() == OmnipodDriverState.Initalized_PodAvailable) { if (pumpStatusLocal.timeChangeEventEnabled) { LOG.info(getLogPrefix() + "Time,and/or TimeZone changed event received and will be consumed by driver."); this.hasTimeDateOrTimeZoneChanged = true; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodHistoryActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodHistoryActivity.java index 92b22a82be..a44f9854ad 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodHistoryActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodHistoryActivity.java @@ -24,18 +24,17 @@ import java.util.List; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; -import info.nightscout.androidaps.activities.NoSplashActivity; +import info.nightscout.androidaps.activities.NoSplashAppCompatActivity; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.pump.common.data.TempBasalPair; import info.nightscout.androidaps.plugins.pump.common.defs.PumpHistoryEntryGroup; import info.nightscout.androidaps.plugins.pump.common.defs.PumpType; import info.nightscout.androidaps.plugins.pump.common.utils.ProfileUtil; -import info.nightscout.androidaps.plugins.pump.medtronic.comm.history.pump.PumpHistoryEntry; import info.nightscout.androidaps.plugins.pump.omnipod.driver.db.PodHistory; import info.nightscout.androidaps.plugins.pump.omnipod.util.OmnipodUtil; -public class PodHistoryActivity extends NoSplashActivity { +public class PodHistoryActivity extends NoSplashAppCompatActivity { private static Logger LOG = LoggerFactory.getLogger(L.PUMP); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodManagementActivity.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodManagementActivity.kt index f823fdd043..12a08605c3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodManagementActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dialogs/PodManagementActivity.kt @@ -8,7 +8,7 @@ import com.atech.android.library.wizardpager.data.WizardPagerSettings import com.atech.android.library.wizardpager.defs.WizardStepsWayType import info.nightscout.androidaps.MainApp import info.nightscout.androidaps.R -import info.nightscout.androidaps.activities.NoSplashActivity +import info.nightscout.androidaps.activities.NoSplashAppCompatActivity import info.nightscout.androidaps.events.EventRefreshOverview import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.pump.omnipod.defs.SetupProgress @@ -27,7 +27,7 @@ import kotlinx.android.synthetic.main.omnipod_pod_mgmt.* /** * Created by andy on 30/08/2019 */ -class PodManagementActivity : NoSplashActivity() { +class PodManagementActivity : NoSplashAppCompatActivity() { private var initPodChanged = false private var podSessionFullyInitalized = false @@ -69,7 +69,6 @@ class PodManagementActivity : NoSplashActivity() { } } - fun initPodAction() { val pagerSettings = WizardPagerSettings() @@ -124,7 +123,7 @@ class PodManagementActivity : NoSplashActivity() { fun resetPodAction() { OKDialog.showConfirmation(this, - MainApp.gs(R.string.omnipod_cmd_reset_pod_desc), Thread { + MainApp.gs(R.string.omnipod_cmd_reset_pod_desc), Thread { AapsOmnipodManager.getInstance().resetPodStatus() OmnipodUtil.setDriverState(OmnipodDriverState.Initalized_NoPod) refreshButtons() @@ -138,17 +137,16 @@ class PodManagementActivity : NoSplashActivity() { startActivity(Intent(applicationContext, PodHistoryActivity::class.java)) } - fun refreshButtons() { initpod_init_pod.isEnabled = (OmnipodUtil.getPodSessionState() == null || - OmnipodUtil.getPodSessionState().getSetupProgress().isBefore(SetupProgress.COMPLETED)) + OmnipodUtil.getPodSessionState().getSetupProgress().isBefore(SetupProgress.COMPLETED)) val isPodSessionActive = (OmnipodUtil.getPodSessionState() != null) initpod_remove_pod.isEnabled = isPodSessionActive initpod_reset_pod.isEnabled = isPodSessionActive - if (OmnipodUtil.getDriverState()==OmnipodDriverState.NotInitalized) { + if (OmnipodUtil.getDriverState() == OmnipodDriverState.NotInitalized) { // if rileylink is not running we disable all operations initpod_init_pod.isEnabled = false initpod_remove_pod.isEnabled = false diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java index 06b3432af3..17a54953d3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/driver/comm/AapsOmnipodManager.java @@ -16,6 +16,7 @@ import java.util.Objects; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.activities.ErrorHelperActivity; import info.nightscout.androidaps.data.DetailedBolusInfo; import info.nightscout.androidaps.data.Profile; import info.nightscout.androidaps.data.PumpEnactResult; @@ -25,7 +26,6 @@ import info.nightscout.androidaps.events.Event; import info.nightscout.androidaps.events.EventRefreshOverview; import info.nightscout.androidaps.logging.L; import info.nightscout.androidaps.plugins.bus.RxBus; -import info.nightscout.androidaps.plugins.general.overview.dialogs.ErrorHelperActivity; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress; import info.nightscout.androidaps.plugins.general.overview.notifications.Notification; @@ -524,7 +524,7 @@ public class AapsOmnipodManager implements OmnipodCommunicationManagerInterface LOG.debug("Reporting implicitly cancelled TBR to Treatments plugin"); } - long time = System.currentTimeMillis()-1000; + long time = System.currentTimeMillis() - 1000; addSuccessToHistory(time, PodHistoryEntryType.CancelTemporaryBasal, null);