From 530004fb57f557330e1f7487dfddd86ab72c5a8b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 25 Jun 2022 10:27:28 +0200 Subject: [PATCH] remove unused code, prevent root blocking --- .../plugins/general/overview/OverviewFragment.kt | 13 ++++++------- .../events/EventUpdateOverviewPumpStatus.kt | 5 ----- 2 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventUpdateOverviewPumpStatus.kt diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt index 4374fd0c05..8ecba9d5ad 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewFragment.kt @@ -51,7 +51,11 @@ import info.nightscout.androidaps.plugins.constraints.bgQualityCheck.BgQualityCh import info.nightscout.androidaps.plugins.general.automation.AutomationPlugin import info.nightscout.androidaps.plugins.general.nsclient.data.NSDeviceStatus import info.nightscout.androidaps.plugins.general.overview.activities.QuickWizardListActivity -import info.nightscout.androidaps.plugins.general.overview.events.* +import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewCalcProgress +import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewGraph +import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewIobCob +import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewNotification +import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOverviewSensitivity import info.nightscout.androidaps.plugins.general.overview.graphData.GraphData import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider @@ -66,7 +70,6 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.TrendCalculator import info.nightscout.androidaps.utils.alertDialogs.OKDialog -import info.nightscout.androidaps.interfaces.BuildHelper import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.ui.SingleClickButton @@ -236,10 +239,6 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList .debounce(1L, TimeUnit.SECONDS) .observeOn(aapsSchedulers.main) .subscribe({ updateGraph() }, fabricPrivacy::logException) - disposable += activePlugin.activeOverview.overviewBus - .toObservable(EventUpdateOverviewPumpStatus::class.java) - .observeOn(aapsSchedulers.main) - .subscribe({ updatePumpStatus() }, fabricPrivacy::logException) disposable += activePlugin.activeOverview.overviewBus .toObservable(EventUpdateOverviewNotification::class.java) .observeOn(aapsSchedulers.main) @@ -308,7 +307,7 @@ class OverviewFragment : DaggerFragment(), View.OnClickListener, OnLongClickList } handler.postDelayed(refreshLoop, 60 * 1000L) - refreshAll() + handler.post { refreshAll() } updatePumpStatus() updateCalcProgress() } diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventUpdateOverviewPumpStatus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventUpdateOverviewPumpStatus.kt deleted file mode 100644 index 30ad6b7507..0000000000 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/events/EventUpdateOverviewPumpStatus.kt +++ /dev/null @@ -1,5 +0,0 @@ -package info.nightscout.androidaps.plugins.general.overview.events - -import info.nightscout.androidaps.events.Event - -class EventUpdateOverviewPumpStatus(val from: String) : Event() \ No newline at end of file