From 0a39388f81f7c5130b8eec39cc4a721466167531 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 10 Feb 2022 19:11:58 +0100 Subject: [PATCH] rxjava2 -> 3 --- .../nightscout/androidaps/MainActivity.kt | 4 +- .../info/nightscout/androidaps/MainApp.kt | 8 +- .../activities/HistoryBrowseActivity.kt | 4 +- .../fragments/TreatmentsBolusCarbsFragment.kt | 8 +- .../fragments/TreatmentsCareportalFragment.kt | 8 +- .../TreatmentsExtendedBolusesFragment.kt | 4 +- .../TreatmentsProfileSwitchFragment.kt | 8 +- .../fragments/TreatmentsTempTargetFragment.kt | 8 +- .../TreatmentsTemporaryBasalsFragment.kt | 4 +- .../fragments/TreatmentsUserEntryFragment.kt | 2 +- .../androidaps/db/CompatDBHelper.kt | 2 +- .../androidaps/dialogs/CarbsDialog.kt | 4 +- .../androidaps/dialogs/CareDialog.kt | 4 +- .../androidaps/dialogs/FillDialog.kt | 4 +- .../androidaps/dialogs/InsulinDialog.kt | 4 +- .../androidaps/dialogs/LoopDialog.kt | 4 +- .../androidaps/dialogs/ProfileSwitchDialog.kt | 4 +- .../androidaps/dialogs/TempTargetDialog.kt | 4 +- .../androidaps/dialogs/TreatmentDialog.kt | 4 +- .../androidaps/dialogs/WizardDialog.kt | 2 +- .../plugins/aps/loop/LoopFragment.kt | 4 +- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 4 +- .../aps/openAPSAMA/OpenAPSAMAFragment.kt | 4 +- .../aps/openAPSSMB/OpenAPSSMBFragment.kt | 4 +- .../configBuilder/ConfigBuilderFragment.kt | 4 +- .../ProfileFunctionImplementation.kt | 4 +- .../bgQualityCheck/BgQualityCheckPlugin.kt | 4 +- .../objectives/ObjectivesFragment.kt | 4 +- .../general/actions/ActionsFragment.kt | 4 +- .../dataBroadcaster/DataBroadcastPlugin.kt | 2 +- .../plugins/general/food/FoodFragment.kt | 8 +- .../maintenance/MaintenanceFragment.kt | 6 +- .../general/nsclient/NSClientFragment.kt | 4 +- .../general/nsclient/NSClientPlugin.kt | 2 +- .../nsclient/services/NSClientService.kt | 2 +- .../general/overview/OverviewFragment.kt | 4 +- .../general/overview/OverviewPlugin.kt | 4 +- .../activities/QuickWizardListActivity.kt | 4 +- .../persistentNotification/DummyService.kt | 2 +- .../PersistentNotificationPlugin.kt | 4 +- .../SmsCommunicatorFragment.kt | 4 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 4 +- .../general/tidepool/TidepoolFragment.kt | 4 +- .../general/tidepool/TidepoolPlugin.kt | 5 +- .../general/wear/ActionStringHandler.kt | 4 +- .../plugins/general/wear/WearPlugin.kt | 2 +- .../xdripStatusline/StatusLinePlugin.kt | 4 +- .../IobCobCalculatorPlugin.kt | 4 +- .../profile/local/LocalProfileFragment.kt | 4 +- .../pump/virtual/VirtualPumpFragment.kt | 4 +- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 4 +- .../plugins/source/BGSourceFragment.kt | 4 +- .../plugins/source/GlunovoPlugin.kt | 2 +- .../plugins/source/RandomBgPlugin.kt | 4 +- .../queue/CommandQueueImplementation.kt | 6 +- .../androidaps/setupwizard/SWEventListener.kt | 2 +- .../setupwizard/SetupWizardActivity.kt | 2 +- .../androidaps/utils/LocalAlertUtils.kt | 4 +- .../androidaps/utils/wizard/BolusWizard.kt | 4 +- .../SmsCommunicatorPluginTest.kt | 2 +- .../queue/CommandQueueImplementationTest.kt | 2 +- .../general/automation/AutomationFragment.kt | 4 +- .../general/automation/AutomationPlugin.kt | 12 +- .../actions/ActionCarePortalEvent.kt | 4 +- .../automation/actions/ActionLoopResume.kt | 4 +- .../automation/actions/ActionNotification.kt | 4 +- .../actions/ActionStartTempTarget.kt | 4 +- .../actions/ActionStopTempTarget.kt | 4 +- .../automation/dialogs/EditEventDialog.kt | 4 +- .../automation/dialogs/EditTriggerDialog.kt | 4 +- .../androidaps/services/LocationService.kt | 2 +- .../actions/ActionCarePortalEventTest.kt | 2 +- .../actions/ActionLoopResumeTest.kt | 2 +- .../actions/ActionNotificationTest.kt | 2 +- .../actions/ActionStartTempTargetTest.kt | 2 +- .../actions/ActionStopTempTargetTest.kt | 2 +- .../triggers/TriggerBolusAgoTest.kt | 2 +- .../triggers/TriggerTempTargetValueTest.kt | 2 +- build.gradle | 6 +- .../plugins/pump/combo/ComboFragment.java | 2 +- core/core_dependencies.gradle | 10 +- .../activities/ErrorHelperActivity.kt | 4 +- .../androidaps/activities/TDDStatsActivity.kt | 2 +- .../androidaps/dialogs/BolusProgressDialog.kt | 4 +- .../androidaps/dialogs/NtpProgressDialog.kt | 4 +- .../interfaces/ImportExportPrefs.kt | 2 +- .../androidaps/logging/UserEntryLogger.kt | 8 +- .../androidaps/plugins/bus/RxBus.kt | 6 +- .../plugins/pump/PumpSyncImplementation.kt | 4 +- .../nightscout/androidaps/utils/HardLimits.kt | 4 +- dana/build.gradle | 2 +- .../androidaps/dana/DanaFragment.kt | 4 +- .../dana/activities/DanaHistoryActivity.kt | 4 +- .../activities/DanaUserOptionsActivity.kt | 4 +- .../dana/database/DanaHistoryRecordDao.kt | 2 +- .../danaRKorean/DanaRKoreanPlugin.kt | 2 +- .../androidaps/danaRv2/DanaRv2Plugin.java | 2 +- .../androidaps/danar/AbstractDanaRPlugin.java | 2 +- .../androidaps/danar/DanaRPlugin.java | 2 +- .../AbstractDanaRExecutionService.java | 2 +- .../androidaps/danars/DanaRSPlugin.kt | 4 +- .../danars/activities/EnterPinActivity.kt | 2 +- .../danars/dialogs/PairingProgressDialog.java | 2 +- .../danars/services/DanaRSService.kt | 4 +- database/build.gradle | 8 +- .../androidaps/database/AppRepository.kt | 14 +- .../database/daos/BolusCalculatorResultDao.kt | 4 +- .../androidaps/database/daos/BolusDao.kt | 4 +- .../androidaps/database/daos/CarbsDao.kt | 4 +- .../database/daos/DeviceStatusDao.kt | 4 +- .../daos/EffectiveProfileSwitchDao.kt | 4 +- .../database/daos/ExtendedBolusDao.kt | 4 +- .../androidaps/database/daos/FoodDao.kt | 4 +- .../database/daos/GlucoseValueDao.kt | 6 +- .../database/daos/OfflineEventDao.kt | 4 +- .../database/daos/PreferenceChangeDao.kt | 2 +- .../database/daos/ProfileSwitchDao.kt | 4 +- .../database/daos/TemporaryBasalDao.kt | 4 +- .../database/daos/TemporaryTargetDao.kt | 4 +- .../database/daos/TherapyEventDao.kt | 4 +- .../database/daos/TotalDailyDoseDao.kt | 2 +- .../androidaps/database/daos/UserEntryDao.kt | 2 +- .../database/daos/VersionChangeDao.kt | 2 +- diaconn/build.gradle | 2 +- .../androidaps/diaconn/DiaconnG8Fragment.kt | 73 +++++----- .../androidaps/diaconn/DiaconnG8Plugin.kt | 17 +-- .../activities/DiaconnG8HistoryActivity.kt | 4 +- .../DiaconnG8UserOptionsActivity.kt | 2 +- .../database/DiaconnHistoryRecordDao.kt | 2 +- .../diaconn/service/DiaconnG8Service.kt | 7 +- insight/build.gradle | 2 +- .../pump/insight/LocalInsightFragment.java | 2 +- .../pump/medtronic/MedtronicFragment.kt | 4 +- .../common/viewmodel/ActionViewModelBase.kt | 8 +- omnipod-dash/build.gradle | 2 +- .../omnipod/dash/OmnipodDashPumpPlugin.kt | 73 +++++----- .../omnipod/dash/driver/OmnipodDashManager.kt | 2 +- .../dash/driver/OmnipodDashManagerImpl.kt | 6 +- .../dash/driver/comm/OmnipodDashBleManager.kt | 2 +- .../driver/comm/OmnipodDashBleManagerImpl.kt | 2 +- .../pod/state/OmnipodDashPodStateManager.kt | 6 +- .../state/OmnipodDashPodStateManagerImpl.kt | 6 +- .../pump/omnipod/dash/history/DashHistory.kt | 4 +- .../dash/history/database/HistoryRecordDao.kt | 4 +- .../dash/ui/DashPodManagementActivity.kt | 4 +- .../dash/ui/OmnipodDashOverviewFragment.kt | 4 +- .../action/DashInitializePodViewModel.kt | 6 +- .../action/DashInsertCannulaViewModel.kt | 6 +- .../action/DashDeactivatePodViewModel.kt | 2 +- omnipod-eros/build.gradle | 2 +- .../omnipod/eros/OmnipodErosPumpPlugin.java | 2 +- .../eros/driver/manager/OmnipodManager.java | 8 +- .../pump/omnipod/eros/history/ErosHistory.kt | 6 +- .../history/database/ErosHistoryRecordDao.kt | 4 +- .../eros/ui/ErosPodManagementActivity.kt | 4 +- .../eros/ui/OmnipodErosOverviewFragment.kt | 4 +- .../action/ErosInitializePodViewModel.kt | 2 +- .../action/ErosInsertCannulaViewModel.kt | 2 +- .../action/ErosDeactivatePodViewModel.kt | 2 +- .../general/openhumans/OpenHumansUploader.kt | 4 +- .../plugins/pump/common/PumpPluginAbstract.kt | 2 +- shared/build.gradle | 6 +- .../androidaps/utils/rx/AapsSchedulers.kt | 6 +- .../androidaps/utils/rx/RxExtensions.kt | 62 -------- .../androidaps/utils/rx/RxExtensionsTest.kt | 132 ------------------ .../androidaps/utils/rx/RxSchedulerRule.kt | 6 +- 166 files changed, 401 insertions(+), 590 deletions(-) delete mode 100644 shared/src/main/java/info/nightscout/androidaps/utils/rx/RxExtensions.kt delete mode 100644 shared/src/test/java/info/nightscout/androidaps/utils/rx/RxExtensionsTest.kt diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index 48296330cf..46e6913b47 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -56,8 +56,8 @@ import info.nightscout.androidaps.utils.tabs.TabPageAdapter import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* import javax.inject.Inject import kotlin.system.exitProcess diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index dbebf4e635..781ab707c3 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -39,10 +39,10 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.locale.LocaleHelper import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.exceptions.UndeliverableException -import io.reactivex.plugins.RxJavaPlugins -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.exceptions.UndeliverableException +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.plugins.RxJavaPlugins import net.danlew.android.joda.JodaTimeAndroid import java.io.IOException import java.net.SocketException diff --git a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt index 7883c4ecd2..3034cb7d7f 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt @@ -42,8 +42,8 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* import javax.inject.Inject import kotlin.math.min diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsBolusCarbsFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsBolusCarbsFragment.kt index f4614d5a41..e979e09104 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsBolusCarbsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsBolusCarbsFragment.kt @@ -45,10 +45,10 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Completable -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsCareportalFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsCareportalFragment.kt index ac640df4f6..ac4c2da1e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsCareportalFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsCareportalFragment.kt @@ -36,10 +36,10 @@ import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Completable -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsExtendedBolusesFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsExtendedBolusesFragment.kt index 4f9609043e..59e6622b4c 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsExtendedBolusesFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsExtendedBolusesFragment.kt @@ -37,8 +37,8 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsProfileSwitchFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsProfileSwitchFragment.kt index 7b48ff9684..20b8070583 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsProfileSwitchFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsProfileSwitchFragment.kt @@ -40,10 +40,10 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Completable -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy import javax.inject.Inject class TreatmentsProfileSwitchFragment : DaggerFragment() { diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTempTargetFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTempTargetFragment.kt index 53e3fa5eba..b227f667df 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTempTargetFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTempTargetFragment.kt @@ -43,10 +43,10 @@ import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Completable -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTemporaryBasalsFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTemporaryBasalsFragment.kt index 9fb0c844ba..4cb88c4290 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTemporaryBasalsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsTemporaryBasalsFragment.kt @@ -43,8 +43,8 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit import javax.inject.Inject import kotlin.math.abs diff --git a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsUserEntryFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsUserEntryFragment.kt index 8cb5681995..ad3d7bde20 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsUserEntryFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/fragments/TreatmentsUserEntryFragment.kt @@ -28,7 +28,7 @@ import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/db/CompatDBHelper.kt b/app/src/main/java/info/nightscout/androidaps/db/CompatDBHelper.kt index d0ec64cbdc..fb1136bc3e 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/CompatDBHelper.kt +++ b/app/src/main/java/info/nightscout/androidaps/db/CompatDBHelper.kt @@ -7,7 +7,7 @@ import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.iob.iobCobCalculator.events.EventNewHistoryData -import io.reactivex.disposables.Disposable +import io.reactivex.rxjava3.disposables.Disposable import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt index 6f57680102..aeb5fc52a5 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CarbsDialog.kt @@ -28,8 +28,8 @@ import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat import java.util.* import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt index ecab62f458..0006ce0cbe 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/CareDialog.kt @@ -31,8 +31,8 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.extensions.fromConstant import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.utils.resources.ResourceHelper -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt index fd8920fc07..b7423dc564 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -29,8 +29,8 @@ import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.utils.resources.ResourceHelper -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* import javax.inject.Inject import kotlin.math.abs diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt index 9cbb2426f8..d35446e818 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -30,8 +30,8 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.extensions.toSignedString import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.shared.SafeParse -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat import java.util.* import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt index 0420afc6c3..8e67a0ed6e 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt @@ -40,8 +40,8 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class LoopDialog : DaggerDialogFragment() { diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt index 306aee9b56..c869c22e6d 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ProfileSwitchDialog.kt @@ -32,8 +32,8 @@ import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat import java.util.* import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt index 2374c48c90..54801c723d 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempTargetDialog.kt @@ -28,8 +28,8 @@ import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat import java.util.* import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt index 29e6290571..ac88f7e074 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -31,8 +31,8 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.utils.resources.ResourceHelper -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt index c6624bb3d3..3fce025b61 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -37,7 +37,7 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.wizard.BolusWizard -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import java.text.DecimalFormat import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt index c7cfe5b969..1a1ec6fae5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopFragment.kt @@ -19,8 +19,8 @@ import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class LoopFragment : DaggerFragment() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt index 09e4896525..e43c353d87 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/loop/LoopPlugin.kt @@ -59,8 +59,8 @@ import info.nightscout.androidaps.plugins.aps.events.EventLoopInvoked import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAFragment.kt index 14deed2bb4..051017062a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/OpenAPSAMAFragment.kt @@ -18,8 +18,8 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.JSONFormatter import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONArray import org.json.JSONException import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBFragment.kt index b93170d2ac..d24763980e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBFragment.kt @@ -19,8 +19,8 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.JSONFormatter import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONArray import org.json.JSONException import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt index 528b89f683..0bf7dcfc30 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderFragment.kt @@ -19,13 +19,13 @@ import info.nightscout.androidaps.interfaces.* import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui import info.nightscout.androidaps.utils.FabricPrivacy -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.kotlin.plusAssign import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImplementation.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImplementation.kt index 405daabc9e..63e03478dc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ProfileFunctionImplementation.kt @@ -22,8 +22,8 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt index 4b0c9c8e4b..73e42b78d7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/bgQualityCheck/BgQualityCheckPlugin.kt @@ -12,8 +12,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt index f1f83e5603..d4d0c628a9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesFragment.kt @@ -37,11 +37,11 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.SntpClient import info.nightscout.androidaps.utils.alertDialogs.OKDialog -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.kotlin.plusAssign import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject class ObjectivesFragment : DaggerFragment() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt index 8b2be42563..60434c77ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/actions/ActionsFragment.kt @@ -49,8 +49,8 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.ui.SingleClickButton import info.nightscout.androidaps.utils.ui.UIRunnable -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt index 5b10d02649..035c3a13a1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/dataBroadcaster/DataBroadcastPlugin.kt @@ -25,7 +25,7 @@ import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodFragment.kt index 4507d85ab3..eae7c2b177 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodFragment.kt @@ -36,10 +36,10 @@ import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.ui.UIRunnable -import io.reactivex.Completable -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy import java.util.* import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt index b39883538b..8d6cc9c91b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenanceFragment.kt @@ -29,9 +29,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.Ero import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.Completable.fromAction -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.core.Completable.fromAction +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.subscribeBy import javax.inject.Inject class MaintenanceFragment : DaggerFragment() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientFragment.kt index 13b5469d01..63351dc7ba 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientFragment.kt @@ -21,8 +21,8 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class NSClientFragment : DaggerFragment() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt index 540ce3e628..74b0f897a6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientPlugin.kt @@ -38,7 +38,7 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import java.util.* import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt index 040fe82453..970b047ddb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/services/NSClientService.kt @@ -49,7 +49,7 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import io.socket.client.IO import io.socket.client.Socket import io.socket.emitter.Emitter 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 50ce24891a..5ec2a64b52 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 @@ -76,8 +76,8 @@ import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.ui.SingleClickButton import info.nightscout.androidaps.utils.ui.UIRunnable import info.nightscout.androidaps.utils.wizard.QuickWizard -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewPlugin.kt index f9c34a49b1..8685abdbe3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewPlugin.kt @@ -24,8 +24,8 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt index eb56d8067e..8a76c606bf 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/activities/QuickWizardListActivity.kt @@ -17,10 +17,10 @@ import info.nightscout.androidaps.plugins.general.overview.dialogs.EditQuickWiza import info.nightscout.androidaps.plugins.general.overview.events.EventQuickWizardChange import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.kotlin.plusAssign import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.wizard.QuickWizard -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject class QuickWizardListActivity : NoSplashAppCompatActivity() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/DummyService.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/DummyService.kt index fe0d90116a..e6651412ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/DummyService.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/DummyService.kt @@ -13,7 +13,7 @@ import info.nightscout.shared.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt index 555dba3239..3bd76dab56 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/persistentNotification/PersistentNotificationPlugin.kt @@ -20,8 +20,8 @@ import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt index 6f422dad47..666097d017 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorFragment.kt @@ -11,9 +11,9 @@ import info.nightscout.androidaps.plugins.general.smsCommunicator.events.EventSm import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HtmlHelper -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.kotlin.plusAssign import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import java.util.* import javax.inject.Inject import kotlin.math.max diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt index 4f733dded3..e58bc1e666 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPlugin.kt @@ -48,8 +48,8 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference import info.nightscout.shared.SafeParse -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.apache.commons.lang3.StringUtils import org.joda.time.DateTime import java.text.Normalizer diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolFragment.kt index 1daf65abc4..db3ba0ba7f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolFragment.kt @@ -14,10 +14,10 @@ import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolD import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolResetData import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolUpdateGUI import info.nightscout.androidaps.utils.FabricPrivacy -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.kotlin.plusAssign import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject class TidepoolFragment : DaggerFragment() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolPlugin.kt index 045f638e6a..05d0dfbc23 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/TidepoolPlugin.kt @@ -30,11 +30,11 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.ToastUtils -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.kotlin.plusAssign import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import java.util.* import javax.inject.Inject import javax.inject.Singleton @@ -68,6 +68,7 @@ class TidepoolPlugin @Inject constructor( private val listLog = ArrayList() var textLog: Spanned = HtmlHelper.fromHtml("") + @Suppress("RECEIVER_NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS", "NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS", "UNNECESSARY_NOT_NULL_ASSERTION") override fun onStart() { super.onStart() disposable += rxBus diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/ActionStringHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/ActionStringHandler.kt index f463a10339..3fc78dbf3d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/ActionStringHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/ActionStringHandler.kt @@ -40,8 +40,8 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.shared.SafeParse -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DateFormat import java.text.DecimalFormat import java.text.SimpleDateFormat diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt index b43775cdaa..d6be8f54cd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/WearPlugin.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/xdripStatusline/StatusLinePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/xdripStatusline/StatusLinePlugin.kt index aa41940fd6..825ae8ad5a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/xdripStatusline/StatusLinePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/xdripStatusline/StatusLinePlugin.kt @@ -15,8 +15,8 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt index 6f623266ca..d7991a6707 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobCalculatorPlugin.kt @@ -34,8 +34,8 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONArray import java.util.concurrent.Executors import java.util.concurrent.ScheduledFuture diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt index 87c6875084..0d37bb7c83 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfileFragment.kt @@ -31,8 +31,8 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.ui.SpinnerHelper import info.nightscout.androidaps.utils.ui.TimeListEdit import info.nightscout.shared.SafeParse -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt index 382efc02cc..1eb807dbfc 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpFragment.kt @@ -21,8 +21,8 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class VirtualPumpFragment : DaggerFragment() { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt index d4a0ba1687..f900d942da 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPlugin.kt @@ -28,8 +28,8 @@ import info.nightscout.androidaps.utils.TimeChangeType import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt index 6b00421a14..7920902eda 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/BGSourceFragment.kt @@ -36,8 +36,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/GlunovoPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/GlunovoPlugin.kt index c65691dfbe..818951fff1 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/GlunovoPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/GlunovoPlugin.kt @@ -26,7 +26,7 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt index 82d353a095..9f149f7a7b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/RandomBgPlugin.kt @@ -18,8 +18,8 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt index 5315d15713..1bf2891a81 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt @@ -41,9 +41,9 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy import java.util.* import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWEventListener.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWEventListener.kt index 2b4d667758..c1cfb270aa 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWEventListener.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWEventListener.kt @@ -8,7 +8,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.events.EventStatus import info.nightscout.androidaps.setupwizard.elements.SWItem import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject class SWEventListener constructor( diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt index eef7197a7b..090b9ae07d 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt @@ -24,7 +24,7 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.locale.LocaleHelper.update import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject import kotlin.math.max import kotlin.math.min diff --git a/app/src/main/java/info/nightscout/androidaps/utils/LocalAlertUtils.kt b/app/src/main/java/info/nightscout/androidaps/utils/LocalAlertUtils.kt index 2f1ea9e990..063fd3137e 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/LocalAlertUtils.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/LocalAlertUtils.kt @@ -22,8 +22,8 @@ import info.nightscout.androidaps.plugins.general.overview.notifications.Notific import info.nightscout.androidaps.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton import kotlin.math.min diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt index d1f9321746..7dd5687e92 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/BolusWizard.kt @@ -31,8 +31,8 @@ import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* import javax.inject.Inject import kotlin.math.abs diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt index b07f6b9f39..3888078520 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/general/smsCommunicator/SmsCommunicatorPluginTest.kt @@ -31,7 +31,7 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueImplementationTest.kt b/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueImplementationTest.kt index 8ddaa5f3d6..8a29540957 100644 --- a/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueImplementationTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueImplementationTest.kt @@ -30,7 +30,7 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationFragment.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationFragment.kt index 6fd6d4a2c7..d94bf5b6a1 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationFragment.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationFragment.kt @@ -35,11 +35,11 @@ import info.nightscout.androidaps.plugins.general.automation.triggers.TriggerCon import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.kotlin.plusAssign import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import java.util.* import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationPlugin.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationPlugin.kt index 42aba423c0..8f9c074591 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationPlugin.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/AutomationPlugin.kt @@ -25,8 +25,8 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONArray import org.json.JSONException import org.json.JSONObject @@ -115,11 +115,9 @@ class AutomationPlugin @Inject constructor( disposable += rxBus .toObservable(EventLocationChange::class.java) .observeOn(aapsSchedulers.io) - .subscribe({ e -> - e?.let { - aapsLogger.debug(LTag.AUTOMATION, "Grabbed location: $it.location.latitude $it.location.longitude Provider: $it.location.provider") - processActions() - } + .subscribe({ + aapsLogger.debug(LTag.AUTOMATION, "Grabbed location: ${it.location.latitude} ${it.location.longitude} Provider: ${it.location.provider}") + processActions() }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventChargingState::class.java) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionCarePortalEvent.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionCarePortalEvent.kt index 915d37a684..ba7385cc9b 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionCarePortalEvent.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionCarePortalEvent.kt @@ -24,8 +24,8 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.JsonHelper import info.nightscout.androidaps.utils.T import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResume.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResume.kt index 96fa1d72e0..131e4fd707 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResume.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResume.kt @@ -16,8 +16,8 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.DateUtil -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class ActionLoopResume(injector: HasAndroidInjector) : Action(injector) { diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionNotification.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionNotification.kt index 488b21608e..aaa7ef263d 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionNotification.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionNotification.kt @@ -16,8 +16,8 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotifi import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationUserMessage import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.JsonHelper -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStartTempTarget.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStartTempTarget.kt index 596093ca69..7647ecd11b 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStartTempTarget.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStartTempTarget.kt @@ -29,8 +29,8 @@ import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.JsonHelper import info.nightscout.androidaps.utils.JsonHelper.safeGetDouble -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject import java.util.concurrent.TimeUnit import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStopTempTarget.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStopTempTarget.kt index 7d01a8b199..1f8c77c95b 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStopTempTarget.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStopTempTarget.kt @@ -11,8 +11,8 @@ import info.nightscout.shared.logging.LTag import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.DateUtil -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class ActionStopTempTarget(injector: HasAndroidInjector) : Action(injector) { diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditEventDialog.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditEventDialog.kt index c27d6937a0..94c87f75bd 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditEventDialog.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditEventDialog.kt @@ -26,8 +26,8 @@ import info.nightscout.androidaps.plugins.general.automation.events.EventAutomat import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class EditEventDialog : DialogFragmentWithDate() { diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditTriggerDialog.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditTriggerDialog.kt index 82cc8ef0a2..d6cdb53a74 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditTriggerDialog.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/dialogs/EditTriggerDialog.kt @@ -17,8 +17,8 @@ import info.nightscout.androidaps.plugins.general.automation.triggers.TriggerCon import info.nightscout.androidaps.plugins.general.automation.triggers.TriggerDummy import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject import javax.inject.Inject diff --git a/automation/src/main/java/info/nightscout/androidaps/services/LocationService.kt b/automation/src/main/java/info/nightscout/androidaps/services/LocationService.kt index 5764ee08da..4183c24932 100644 --- a/automation/src/main/java/info/nightscout/androidaps/services/LocationService.kt +++ b/automation/src/main/java/info/nightscout/androidaps/services/LocationService.kt @@ -27,7 +27,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject class LocationService : DaggerService() { diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionCarePortalEventTest.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionCarePortalEventTest.kt index 8badae72d2..6d7ed68b7d 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionCarePortalEventTest.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionCarePortalEventTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.plugins.general.automation.elements.InputCareP import info.nightscout.androidaps.plugins.general.automation.elements.InputDuration import info.nightscout.androidaps.plugins.general.automation.elements.InputString import info.nightscout.androidaps.queue.Callback -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResumeTest.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResumeTest.kt index 72401cc0a7..00957cab4a 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResumeTest.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionLoopResumeTest.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.transactions.CancelCurrentOfflineEventIfAnyTransaction import info.nightscout.androidaps.database.transactions.Transaction import info.nightscout.androidaps.queue.Callback -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionNotificationTest.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionNotificationTest.kt index 21c0812627..a43794571e 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionNotificationTest.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionNotificationTest.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.general.automation.elements.InputString import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.resources.ResourceHelper -import io.reactivex.Completable +import io.reactivex.rxjava3.core.Completable import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStartTempTargetTest.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStartTempTargetTest.kt index c01b372c09..0777e6a687 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStartTempTargetTest.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStartTempTargetTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.plugins.general.automation.elements.InputDuration import info.nightscout.androidaps.plugins.general.automation.elements.InputTempTarget import info.nightscout.androidaps.queue.Callback -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStopTempTargetTest.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStopTempTargetTest.kt index 08e1effa01..0f0e80eb8f 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStopTempTargetTest.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionStopTempTargetTest.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.transactions.CancelCurrentTemporaryTargetIfAnyTransaction import info.nightscout.androidaps.database.transactions.Transaction import info.nightscout.androidaps.queue.Callback -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBolusAgoTest.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBolusAgoTest.kt index d9a6ad0509..53f9e0e9c0 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBolusAgoTest.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBolusAgoTest.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.automation.R import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.database.entities.Bolus import info.nightscout.androidaps.plugins.general.automation.elements.Comparator -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import org.json.JSONException import org.json.JSONObject import org.junit.Assert diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTargetValueTest.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTargetValueTest.kt index 9e500fbbee..6c4a09f505 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTargetValueTest.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTempTargetValueTest.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.plugins.general.automation.elements.Comparator -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import org.json.JSONObject import org.junit.Assert import org.junit.Before diff --git a/build.gradle b/build.gradle index 0c9dca8867..91799da113 100644 --- a/build.gradle +++ b/build.gradle @@ -4,9 +4,9 @@ buildscript { ext { kotlin_version = '1.6.10' core_version = '1.6.0' - rxjava_version = '2.2.21' - rxandroid_version = '2.1.1' - rxkotlin_version = '2.4.0' + rxjava_version = '3.1.3' + rxandroid_version = '3.0.0' + rxkotlin_version = '3.0.1' room_version = '2.3.0' lifecycle_version = '2.3.1' dagger_version = '2.40.5' diff --git a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.java b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.java index 8faedd6950..864642063a 100644 --- a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.java +++ b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboFragment.java @@ -28,7 +28,7 @@ import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.rx.AapsSchedulers; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; public class ComboFragment extends DaggerFragment { @Inject ComboPlugin comboPlugin; diff --git a/core/core_dependencies.gradle b/core/core_dependencies.gradle index 0fb1846296..7b9748a2d8 100644 --- a/core/core_dependencies.gradle +++ b/core/core_dependencies.gradle @@ -32,9 +32,9 @@ dependencies { api 'com.google.firebase:firebase-database-ktx' //RxBus - api "io.reactivex.rxjava2:rxjava:$rxjava_version" - api "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version" - api "io.reactivex.rxjava2:rxandroid:$rxandroid_version" + api "io.reactivex.rxjava3:rxjava:$rxjava_version" + api "io.reactivex.rxjava3:rxkotlin:$rxkotlin_version" + api "io.reactivex.rxjava3:rxandroid:$rxandroid_version" api "org.apache.commons:commons-lang3:$commonslang3_version" api "commons-codec:commons-codec:$commonscodec_version" api "com.uber.rxdogtag:rxdogtag:1.0.1" @@ -61,14 +61,14 @@ dependencies { //WorkManager api "androidx.work:work-runtime:$work_version" api "androidx.work:work-runtime-ktx:$work_version" - api "androidx.work:work-rxjava2:$work_version" + api "androidx.work:work-rxjava3:$work_version" api 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava' // new for tidepool api "com.squareup.okhttp3:okhttp:$okhttp3_version" api "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" api "com.squareup.retrofit2:retrofit:$retrofit2_version" - api "com.squareup.retrofit2:adapter-rxjava2:$retrofit2_version" + api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version" api "com.squareup.retrofit2:converter-gson:$retrofit2_version" api "com.joanzapata.iconify:android-iconify-fontawesome:2.2.2" diff --git a/core/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt b/core/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt index be7820d5c4..b5dec651c9 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt @@ -9,8 +9,8 @@ import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.dialogs.ErrorDialog import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class ErrorHelperActivity : DialogAppCompatActivity() { diff --git a/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt b/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt index 2bca9c0a55..c5bfd4a69b 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt @@ -33,7 +33,7 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.SafeParse import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import java.text.DateFormat import java.text.DecimalFormat import java.text.SimpleDateFormat diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt index d61b2f28d5..8634e6982f 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/BolusProgressDialog.kt @@ -24,8 +24,8 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewB import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class BolusProgressDialog : DaggerDialogFragment() { diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt index 38031c5585..cce02ab08d 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/NtpProgressDialog.kt @@ -15,8 +15,8 @@ import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class NtpProgressDialog : DaggerDialogFragment() { diff --git a/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt b/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt index 95dbb3467f..15ee7030b4 100644 --- a/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt +++ b/core/src/main/java/info/nightscout/androidaps/interfaces/ImportExportPrefs.kt @@ -4,7 +4,7 @@ import androidx.fragment.app.Fragment import androidx.fragment.app.FragmentActivity import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.plugins.general.maintenance.PrefsFile -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single interface ImportExportPrefs { diff --git a/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt b/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt index 8dba596d6f..89b5563caa 100644 --- a/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt +++ b/core/src/main/java/info/nightscout/androidaps/logging/UserEntryLogger.kt @@ -10,9 +10,9 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.userEntry.UserEntryMapper import info.nightscout.androidaps.utils.userEntry.ValueWithUnitMapper import info.nightscout.shared.logging.AAPSLogger -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy import javax.inject.Inject import javax.inject.Singleton @@ -31,7 +31,7 @@ class UserEntryLogger @Inject constructor( fun log(action: Action, source: Sources, vararg listvalues: ValueWithUnit?) = log(action, source,"", listvalues.toList()) fun log(action: Action, source: Sources, note: String? ="", listvalues: List = listOf()) { - val filteredValues = listvalues.toList().filter { it != null} + val filteredValues = listvalues.toList().filterNotNull() compositeDisposable += repository.runTransaction(UserEntryTransaction( action = action, source = source, diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/bus/RxBus.kt b/core/src/main/java/info/nightscout/androidaps/plugins/bus/RxBus.kt index 6698250f9e..d1c5cb573d 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/bus/RxBus.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/bus/RxBus.kt @@ -5,8 +5,8 @@ import info.nightscout.androidaps.events.Event import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.Observable -import io.reactivex.subjects.PublishSubject +import io.reactivex.rxjava3.core.Observable +import io.reactivex.rxjava3.subjects.PublishSubject import javax.inject.Inject import javax.inject.Singleton @@ -26,7 +26,7 @@ class RxBus @Inject constructor( // Listen should return an Observable and not the publisher // Using ofType we filter only events that match that class type - fun toObservable(eventType: Class): Observable = + fun toObservable(eventType: Class): Observable = publisher .subscribeOn(aapsSchedulers.io) .ofType(eventType) diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt b/core/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt index 4994f81c03..ddf0aeb680 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/pump/PumpSyncImplementation.kt @@ -20,8 +20,8 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class PumpSyncImplementation @Inject constructor( diff --git a/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt b/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt index 01409e23b2..abd2c3be03 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt @@ -9,8 +9,8 @@ import info.nightscout.shared.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton import kotlin.math.max diff --git a/dana/build.gradle b/dana/build.gradle index 727dd0a74d..2d529842d8 100644 --- a/dana/build.gradle +++ b/dana/build.gradle @@ -26,6 +26,6 @@ dependencies { api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava2:$room_version" + api "androidx.room:room-rxjava3:$room_version" kapt "androidx.room:room-compiler:$room_version" } \ No newline at end of file diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt b/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt index 5c135571b2..5c05c66ac9 100644 --- a/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt +++ b/dana/src/main/java/info/nightscout/androidaps/dana/DanaFragment.kt @@ -41,8 +41,8 @@ import info.nightscout.androidaps.interfaces.Dana import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class DanaFragment : DaggerFragment() { diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt b/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt index 320dfc76cc..1400713845 100644 --- a/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt +++ b/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaHistoryActivity.kt @@ -31,8 +31,8 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.LTag -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* import javax.inject.Inject diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt b/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt index 467e6c0f71..7c97bdf480 100644 --- a/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt +++ b/dana/src/main/java/info/nightscout/androidaps/dana/activities/DanaUserOptionsActivity.kt @@ -17,8 +17,8 @@ import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.LTag -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.text.DecimalFormat import javax.inject.Inject import kotlin.math.max diff --git a/dana/src/main/java/info/nightscout/androidaps/dana/database/DanaHistoryRecordDao.kt b/dana/src/main/java/info/nightscout/androidaps/dana/database/DanaHistoryRecordDao.kt index 319491e2bb..d7773b56c6 100644 --- a/dana/src/main/java/info/nightscout/androidaps/dana/database/DanaHistoryRecordDao.kt +++ b/dana/src/main/java/info/nightscout/androidaps/dana/database/DanaHistoryRecordDao.kt @@ -4,7 +4,7 @@ import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single @Dao abstract class DanaHistoryRecordDao { diff --git a/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt b/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt index 1b6459395e..ca26113831 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt +++ b/danar/src/main/java/info/nightscout/androidaps/danaRKorean/DanaRKoreanPlugin.kt @@ -28,7 +28,7 @@ import info.nightscout.androidaps.utils.Round import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject import javax.inject.Singleton import kotlin.math.abs diff --git a/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java b/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java index d9c8602f12..b08d7ec6f1 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java +++ b/danar/src/main/java/info/nightscout/androidaps/danaRv2/DanaRv2Plugin.java @@ -39,7 +39,7 @@ import info.nightscout.androidaps.utils.T; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.rx.AapsSchedulers; import info.nightscout.shared.sharedPreferences.SP; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; @Singleton public class DanaRv2Plugin extends AbstractDanaRPlugin { diff --git a/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java b/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java index a1289d3066..c1894c1d30 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java +++ b/danar/src/main/java/info/nightscout/androidaps/danar/AbstractDanaRPlugin.java @@ -40,7 +40,7 @@ import info.nightscout.androidaps.utils.Round; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.rx.AapsSchedulers; import info.nightscout.shared.sharedPreferences.SP; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; /** * Created by mike on 28.01.2018. diff --git a/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java b/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java index 1a2844ba58..3c6a76fc65 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java +++ b/danar/src/main/java/info/nightscout/androidaps/danar/DanaRPlugin.java @@ -36,7 +36,7 @@ import info.nightscout.androidaps.utils.Round; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.rx.AapsSchedulers; import info.nightscout.shared.sharedPreferences.SP; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; @Singleton public class DanaRPlugin extends AbstractDanaRPlugin { diff --git a/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java b/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java index 6d948d75c8..03db77233f 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java +++ b/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java @@ -53,7 +53,7 @@ import info.nightscout.androidaps.utils.ToastUtils; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.rx.AapsSchedulers; import info.nightscout.shared.sharedPreferences.SP; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; /** * Created by mike on 28.01.2018. diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt index 6d1e60ce63..445115fe74 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/DanaRSPlugin.kt @@ -37,8 +37,8 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt b/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt index 440b9e732f..8aff58f856 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/activities/EnterPinActivity.kt @@ -16,7 +16,7 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.textValidator.DefaultEditTextValidator import info.nightscout.androidaps.utils.textValidator.EditTextValidator -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import javax.inject.Inject import kotlin.experimental.xor diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java b/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java index 0a87dfa8ea..3c6eecd72c 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java +++ b/danars/src/main/java/info/nightscout/androidaps/danars/dialogs/PairingProgressDialog.java @@ -23,7 +23,7 @@ import info.nightscout.androidaps.plugins.bus.RxBus; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.rx.AapsSchedulers; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; public class PairingProgressDialog extends DaggerDialogFragment { diff --git a/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt b/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt index bf2646c103..9cf3874687 100644 --- a/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt +++ b/danars/src/main/java/info/nightscout/androidaps/danars/services/DanaRSService.kt @@ -43,8 +43,8 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.joda.time.DateTime import org.joda.time.DateTimeZone import java.util.concurrent.TimeUnit diff --git a/database/build.gradle b/database/build.gradle index 61b628e296..da8e466cab 100644 --- a/database/build.gradle +++ b/database/build.gradle @@ -21,9 +21,9 @@ dependencies { api "androidx.core:core-ktx:$core_version" api "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" - api "io.reactivex.rxjava2:rxjava:$rxjava_version" - api "io.reactivex.rxjava2:rxandroid:$rxandroid_version" - api("io.reactivex.rxjava2:rxkotlin:$rxkotlin_version") + api "io.reactivex.rxjava3:rxjava:$rxjava_version" + api "io.reactivex.rxjava3:rxandroid:$rxandroid_version" + api("io.reactivex.rxjava3:rxkotlin:$rxkotlin_version") api "com.google.code.gson:gson:2.8.9" @@ -32,7 +32,7 @@ dependencies { /* Database schema export */ kapt "androidx.room:room-compiler:$room_version" api "androidx.room:room-ktx:$room_version" - api "androidx.room:room-rxjava2:$room_version" + api "androidx.room:room-rxjava3:$room_version" api "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version" diff --git a/database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt b/database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt index 4d787f596d..ad6be79def 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/AppRepository.kt @@ -5,12 +5,12 @@ import info.nightscout.androidaps.database.data.NewEntries import info.nightscout.androidaps.database.entities.* import info.nightscout.androidaps.database.interfaces.DBEntry import info.nightscout.androidaps.database.transactions.Transaction -import io.reactivex.Completable -import io.reactivex.Maybe -import io.reactivex.Observable -import io.reactivex.Single -import io.reactivex.schedulers.Schedulers -import io.reactivex.subjects.PublishSubject +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Observable +import io.reactivex.rxjava3.core.Single +import io.reactivex.rxjava3.schedulers.Schedulers +import io.reactivex.rxjava3.subjects.PublishSubject import java.util.concurrent.Callable import javax.inject.Inject import javax.inject.Singleton @@ -45,7 +45,7 @@ import kotlin.math.roundToInt * Executes a transaction and returns its result * Runs on IO scheduler */ - fun runTransactionForResult(transaction: Transaction): Single { + fun runTransactionForResult(transaction: Transaction): Single { val changes = mutableListOf() return Single.fromCallable { database.runInTransaction(Callable { diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt index 0b7e4dff8e..654dfb6a3f 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/BolusCalculatorResultDao.kt @@ -4,8 +4,8 @@ import androidx.room.Dao import androidx.room.Query import info.nightscout.androidaps.database.TABLE_BOLUS_CALCULATOR_RESULTS import info.nightscout.androidaps.database.entities.BolusCalculatorResult -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt index f69fd5257d..60e054d409 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/BolusDao.kt @@ -5,8 +5,8 @@ import androidx.room.Query import info.nightscout.androidaps.database.TABLE_BOLUSES import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.Bolus -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt index 55779c2470..51bd4eda5a 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/CarbsDao.kt @@ -5,8 +5,8 @@ import androidx.room.Query import info.nightscout.androidaps.database.TABLE_BOLUSES import info.nightscout.androidaps.database.TABLE_CARBS import info.nightscout.androidaps.database.entities.Carbs -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt index 23fdc1a05c..fe35bc7f34 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/DeviceStatusDao.kt @@ -6,8 +6,8 @@ import androidx.room.Query import androidx.room.Update import info.nightscout.androidaps.database.entities.DeviceStatus import info.nightscout.androidaps.database.TABLE_DEVICE_STATUS -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt index a6db4442c1..9cd85e6e39 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/EffectiveProfileSwitchDao.kt @@ -4,8 +4,8 @@ import androidx.room.Dao import androidx.room.Query import info.nightscout.androidaps.database.TABLE_EFFECTIVE_PROFILE_SWITCHES import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt index 843990d901..639c6981e1 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/ExtendedBolusDao.kt @@ -7,8 +7,8 @@ import info.nightscout.androidaps.database.TABLE_EXTENDED_BOLUSES import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.androidaps.database.entities.ExtendedBolus -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt index bac97a3cb6..a4b0d29977 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/FoodDao.kt @@ -4,8 +4,8 @@ import androidx.room.Dao import androidx.room.Query import info.nightscout.androidaps.database.TABLE_FOODS import info.nightscout.androidaps.database.entities.Food -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt index 7a0a8b36de..4423868aca 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/GlucoseValueDao.kt @@ -2,12 +2,10 @@ package info.nightscout.androidaps.database.daos import androidx.room.Dao import androidx.room.Query -import info.nightscout.androidaps.database.TABLE_CARBS import info.nightscout.androidaps.database.TABLE_GLUCOSE_VALUES -import info.nightscout.androidaps.database.entities.Carbs import info.nightscout.androidaps.database.entities.GlucoseValue -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Dao internal interface GlucoseValueDao : TraceableDao { diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt index a6bf37604d..6b9b8f545c 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/OfflineEventDao.kt @@ -6,8 +6,8 @@ import info.nightscout.androidaps.database.TABLE_GLUCOSE_VALUES import info.nightscout.androidaps.database.TABLE_OFFLINE_EVENTS import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.entities.OfflineEvent -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt index a8aaaf0fc1..4dd332c00c 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/PreferenceChangeDao.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.database.TABLE_GLUCOSE_VALUES import info.nightscout.androidaps.database.TABLE_PREFERENCE_CHANGES import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.entities.PreferenceChange -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single @Dao interface PreferenceChangeDao { diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt index 14ab01da4d..8684800614 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/ProfileSwitchDao.kt @@ -6,8 +6,8 @@ import info.nightscout.androidaps.database.TABLE_PROFILE_SWITCHES import info.nightscout.androidaps.database.daos.workaround.ProfileSwitchDaoWorkaround import info.nightscout.androidaps.database.data.checkSanity import info.nightscout.androidaps.database.entities.ProfileSwitch -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt index fcf221f311..5c13d2dafe 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryBasalDao.kt @@ -5,8 +5,8 @@ import androidx.room.Query import info.nightscout.androidaps.database.TABLE_TEMPORARY_BASALS import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.TemporaryBasal -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt index 87d1d55aff..57172e6c23 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/TemporaryTargetDao.kt @@ -6,8 +6,8 @@ import info.nightscout.androidaps.database.TABLE_GLUCOSE_VALUES import info.nightscout.androidaps.database.TABLE_TEMPORARY_TARGETS import info.nightscout.androidaps.database.entities.GlucoseValue import info.nightscout.androidaps.database.entities.TemporaryTarget -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt index 5e541b6800..633e262a51 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/TherapyEventDao.kt @@ -6,8 +6,8 @@ import info.nightscout.androidaps.database.TABLE_TEMPORARY_TARGETS import info.nightscout.androidaps.database.TABLE_THERAPY_EVENTS import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.TherapyEvent -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Dao internal interface TherapyEventDao : TraceableDao { diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt index e441f69372..d14d8b9bc0 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/TotalDailyDoseDao.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.database.TABLE_TOTAL_DAILY_DOSES import info.nightscout.androidaps.database.embedments.InterfaceIDs import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.TotalDailyDose -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single @Suppress("FunctionName") @Dao diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt index 91e0add323..83331c02fd 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/UserEntryDao.kt @@ -6,7 +6,7 @@ import androidx.room.Query import info.nightscout.androidaps.database.TABLE_USER_ENTRY import info.nightscout.androidaps.database.entities.UserEntry import info.nightscout.androidaps.database.entities.UserEntry.Sources -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single @Dao interface UserEntryDao { diff --git a/database/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt b/database/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt index 46c18d4242..3004fc5f73 100644 --- a/database/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt +++ b/database/src/main/java/info/nightscout/androidaps/database/daos/VersionChangeDao.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.database.TABLE_TEMPORARY_TARGETS import info.nightscout.androidaps.database.TABLE_VERSION_CHANGES import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.VersionChange -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single @Dao interface VersionChangeDao { diff --git a/diaconn/build.gradle b/diaconn/build.gradle index 727dd0a74d..2d529842d8 100644 --- a/diaconn/build.gradle +++ b/diaconn/build.gradle @@ -26,6 +26,6 @@ dependencies { api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava2:$room_version" + api "androidx.room:room-rxjava3:$room_version" kapt "androidx.room:room-compiler:$room_version" } \ No newline at end of file diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt index 16d2174f56..417b436421 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Fragment.kt @@ -21,8 +21,6 @@ import info.nightscout.androidaps.events.EventTempBasalChange import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.CommandQueue import info.nightscout.androidaps.interfaces.Pump -import info.nightscout.shared.logging.AAPSLogger -import info.nightscout.shared.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.queue.events.EventQueueChanged import info.nightscout.androidaps.utils.DateUtil @@ -30,10 +28,12 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.resources.ResourceHelper +import info.nightscout.androidaps.utils.rx.AapsSchedulers +import info.nightscout.shared.logging.AAPSLogger +import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.android.schedulers.AndroidSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class DiaconnG8Fragment : DaggerFragment() { @@ -48,6 +48,7 @@ class DiaconnG8Fragment : DaggerFragment() { @Inject lateinit var sp: SP @Inject lateinit var warnColors: WarnColors @Inject lateinit var dateUtil: DateUtil + @Inject lateinit var aapsSchedulers: AapsSchedulers private var disposable: CompositeDisposable = CompositeDisposable() @@ -67,8 +68,7 @@ class DiaconnG8Fragment : DaggerFragment() { } } - override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, - savedInstanceState: Bundle?): View { + override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { _binding = DiaconnG8FragmentBinding.inflate(inflater, container, false) return binding.root } @@ -92,47 +92,48 @@ class DiaconnG8Fragment : DaggerFragment() { handler.postDelayed(refreshLoop, T.mins(1).msecs()) disposable += rxBus .toObservable(EventInitializationChanged::class.java) - .observeOn(AndroidSchedulers.mainThread()) + .observeOn(aapsSchedulers.main) .subscribe({ updateGUI() }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventDiaconnG8NewStatus::class.java) - .observeOn(AndroidSchedulers.mainThread()) + .observeOn(aapsSchedulers.main) .subscribe({ updateGUI() }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventExtendedBolusChange::class.java) - .observeOn(AndroidSchedulers.mainThread()) + .observeOn(aapsSchedulers.main) .subscribe({ updateGUI() }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventTempBasalChange::class.java) - .observeOn(AndroidSchedulers.mainThread()) + .observeOn(aapsSchedulers.main) .subscribe({ updateGUI() }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventQueueChanged::class.java) - .observeOn(AndroidSchedulers.mainThread()) + .observeOn(aapsSchedulers.main) .subscribe({ updateGUI() }, fabricPrivacy::logException) disposable += rxBus .toObservable(EventPumpStatusChanged::class.java) - .observeOn(AndroidSchedulers.mainThread()) + .observeOn(aapsSchedulers.main) .subscribe({ - when (it.status) { - EventPumpStatusChanged.Status.CONNECTING -> - @Suppress("SetTextI18n") - binding.btconnection.text = "{fa-bluetooth-b spin} ${it.secondsElapsed}s" - EventPumpStatusChanged.Status.CONNECTED -> - @Suppress("SetTextI18n") - binding.btconnection.text = "{fa-bluetooth}" - EventPumpStatusChanged.Status.DISCONNECTED -> - @Suppress("SetTextI18n") - binding.btconnection.text = "{fa-bluetooth-b}" - else -> {} - } - if (it.getStatus(rh) != "") { - binding.diaconnG8Pumpstatus.text = it.getStatus(rh) - binding.diaconnG8Pumpstatuslayout.visibility = View.VISIBLE - } else { - binding.diaconnG8Pumpstatuslayout.visibility = View.GONE - } - }, fabricPrivacy::logException) + when (it.status) { + EventPumpStatusChanged.Status.CONNECTING -> + @Suppress("SetTextI18n") + binding.btconnection.text = "{fa-bluetooth-b spin} ${it.secondsElapsed}s" + EventPumpStatusChanged.Status.CONNECTED -> + @Suppress("SetTextI18n") + binding.btconnection.text = "{fa-bluetooth}" + EventPumpStatusChanged.Status.DISCONNECTED -> + @Suppress("SetTextI18n") + binding.btconnection.text = "{fa-bluetooth-b}" + + else -> {} + } + if (it.getStatus(rh) != "") { + binding.diaconnG8Pumpstatus.text = it.getStatus(rh) + binding.diaconnG8Pumpstatuslayout.visibility = View.VISIBLE + } else { + binding.diaconnG8Pumpstatuslayout.visibility = View.GONE + } + }, fabricPrivacy::logException) updateGUI() } @@ -175,15 +176,15 @@ class DiaconnG8Fragment : DaggerFragment() { val todayInsulinLimitAmount = (pump.maxBasal.toInt() * 24) + pump.maxBolusePerDay.toInt() binding.dailyunits.text = rh.gs(R.string.reservoirvalue, todayInsulinAmount, todayInsulinLimitAmount) warnColors.setColor(binding.dailyunits, todayInsulinAmount, todayInsulinLimitAmount * 0.75, todayInsulinLimitAmount * 0.9) - binding.basabasalrate.text = pump.baseInjAmount.toString() +" / "+ rh.gs(R.string.pump_basebasalrate, plugin.baseBasalRate) + binding.basabasalrate.text = pump.baseInjAmount.toString() + " / " + rh.gs(R.string.pump_basebasalrate, plugin.baseBasalRate) binding.tempbasal.text = diaconnG8Pump.temporaryBasalToString() binding.extendedbolus.text = diaconnG8Pump.extendedBolusToString() binding.reservoir.text = rh.gs(R.string.reservoirvalue, pump.systemRemainInsulin, 307) - warnColors.setColorInverse(binding.reservoir, pump.systemRemainInsulin , 50.0, 20.0) - binding.battery.text = "{fa-battery-" + pump.systemRemainBattery / 25 + "}" + " ("+ pump.systemRemainBattery + " %)" + warnColors.setColorInverse(binding.reservoir, pump.systemRemainInsulin, 50.0, 20.0) + binding.battery.text = "{fa-battery-" + pump.systemRemainBattery / 25 + "}" + " (" + pump.systemRemainBattery + " %)" warnColors.setColorInverse(binding.battery, pump.systemRemainBattery.toDouble(), 51.0, 26.0) - binding.firmware.text = rh.gs(R.string.diaconn_g8_pump) + "\nVersion: " + pump.majorVersion.toString() + "." + pump.minorVersion.toString() + "\nCountry: "+pump.country.toString() + "\nProductType: "+ pump.productType.toString() + "\nManufacture: " + pump.makeYear + "." + pump.makeMonth + "." + pump.makeDay + binding.firmware.text = rh.gs(R.string.diaconn_g8_pump) + "\nVersion: " + pump.majorVersion.toString() + "." + pump.minorVersion.toString() + "\nCountry: " + pump.country.toString() + "\nProductType: " + pump.productType.toString() + "\nManufacture: " + pump.makeYear + "." + pump.makeMonth + "." + pump.makeDay binding.basalstep.text = pump.basalStep.toString() binding.bolusstep.text = pump.bolusStep.toString() binding.serialNumber.text = pump.serialNo.toString() diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt index 291cc239d1..b321cadaa5 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Plugin.kt @@ -18,8 +18,6 @@ import info.nightscout.androidaps.events.EventConfigBuilderChange import info.nightscout.androidaps.extensions.convertedToAbsolute import info.nightscout.androidaps.extensions.plannedRemainingMinutes import info.nightscout.androidaps.interfaces.* -import info.nightscout.shared.logging.AAPSLogger -import info.nightscout.shared.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.common.ManufacturerType import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker @@ -34,9 +32,11 @@ import info.nightscout.androidaps.plugins.pump.common.bolusInfo.TemporaryBasalSt import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.resources.ResourceHelper +import info.nightscout.androidaps.utils.rx.AapsSchedulers +import info.nightscout.shared.logging.AAPSLogger +import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.schedulers.Schedulers +import io.reactivex.rxjava3.disposables.CompositeDisposable import org.json.JSONException import org.json.JSONObject import javax.inject.Inject @@ -60,7 +60,8 @@ class DiaconnG8Plugin @Inject constructor( private val detailedBolusInfoStorage: DetailedBolusInfoStorage, private val temporaryBasalStorage: TemporaryBasalStorage, private val fabricPrivacy: FabricPrivacy, - private val dateUtil: DateUtil + private val dateUtil: DateUtil, + private val aapsSchedulers: AapsSchedulers ) : PumpPluginBase(PluginDescription() .mainType(PluginType.PUMP) .fragmentClass(DiaconnG8Fragment::class.java.name) @@ -84,17 +85,17 @@ class DiaconnG8Plugin @Inject constructor( context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE) disposable.add(rxBus .toObservable(EventAppExit::class.java) - .observeOn(Schedulers.io()) + .observeOn(aapsSchedulers.io) .subscribe({ context.unbindService(mConnection) }) { fabricPrivacy.logException(it) } ) disposable.add(rxBus .toObservable(EventConfigBuilderChange::class.java) - .observeOn(Schedulers.io()) + .observeOn(aapsSchedulers.io) .subscribe { diaconnG8Pump.reset() } ) disposable.add(rxBus .toObservable(EventDiaconnG8DeviceChange::class.java) - .observeOn(Schedulers.io()) + .observeOn(aapsSchedulers.io) .subscribe({ changePump() }) { fabricPrivacy.logException(it) } ) changePump() // load device name diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt index 2e90ef42a1..35920ceab1 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8HistoryActivity.kt @@ -26,8 +26,8 @@ import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import java.util.* import javax.inject.Inject diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt index f8e213921c..0f30c7e151 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/activities/DiaconnG8UserOptionsActivity.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import java.text.DecimalFormat import javax.inject.Inject diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/database/DiaconnHistoryRecordDao.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/database/DiaconnHistoryRecordDao.kt index 127be05acd..5115d3d1b8 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/database/DiaconnHistoryRecordDao.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/database/DiaconnHistoryRecordDao.kt @@ -4,7 +4,7 @@ import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single @Dao abstract class DiaconnHistoryRecordDao { diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt index 171e5f60d1..4295d9d8d7 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt @@ -39,11 +39,11 @@ import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper +import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.schedulers.Schedulers +import io.reactivex.rxjava3.disposables.CompositeDisposable import org.joda.time.DateTime import org.joda.time.DateTimeZone import java.util.concurrent.TimeUnit @@ -72,6 +72,7 @@ class DiaconnG8Service : DaggerService() { @Inject lateinit var fabricPrivacy: FabricPrivacy @Inject lateinit var pumpSync: PumpSync @Inject lateinit var dateUtil: DateUtil + @Inject lateinit var aapsSchedulers: AapsSchedulers private val disposable = CompositeDisposable() private val mBinder: IBinder = LocalBinder() @@ -81,7 +82,7 @@ class DiaconnG8Service : DaggerService() { super.onCreate() disposable.add(rxBus .toObservable(EventAppExit::class.java) - .observeOn(Schedulers.io()) + .observeOn(aapsSchedulers.io) .subscribe({ stopSelf() }) { fabricPrivacy.logException(it) } ) } diff --git a/insight/build.gradle b/insight/build.gradle index 727dd0a74d..2d529842d8 100644 --- a/insight/build.gradle +++ b/insight/build.gradle @@ -26,6 +26,6 @@ dependencies { api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava2:$room_version" + api "androidx.room:room-rxjava3:$room_version" kapt "androidx.room:room-compiler:$room_version" } \ No newline at end of file diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java index d7cb593bb3..ecf8638a36 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/LocalInsightFragment.java @@ -37,7 +37,7 @@ import info.nightscout.androidaps.utils.DecimalFormatter; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.rx.AapsSchedulers; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; public class LocalInsightFragment extends DaggerFragment implements View.OnClickListener { @Inject LocalInsightPlugin localInsightPlugin; diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt index 1e9c938fca..4db2e5fd59 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt @@ -44,8 +44,8 @@ import info.nightscout.androidaps.utils.WarnColors import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class MedtronicFragment : DaggerFragment() { diff --git a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt index 1c77d6adb5..cc9e8d0de4 100644 --- a/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt +++ b/omnipod-common/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/common/ui/wizard/common/viewmodel/ActionViewModelBase.kt @@ -7,10 +7,10 @@ import info.nightscout.androidaps.data.PumpEnactResult import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag -import io.reactivex.Single -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.core.Single +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy abstract class ActionViewModelBase( protected val injector: HasAndroidInjector, diff --git a/omnipod-dash/build.gradle b/omnipod-dash/build.gradle index cb9adc5b94..4bfced3795 100644 --- a/omnipod-dash/build.gradle +++ b/omnipod-dash/build.gradle @@ -36,7 +36,7 @@ dependencies { api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava2:$room_version" + api "androidx.room:room-rxjava3:$room_version" kapt "androidx.room:room-compiler:$room_version" api 'com.github.guepardoapps:kulid:2.0.0.0' diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt index bc747c02f9..6a3342d89d 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/OmnipodDashPumpPlugin.kt @@ -53,10 +53,10 @@ import info.nightscout.androidaps.utils.TimeChangeType import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Completable -import io.reactivex.Single -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.core.Single +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.json.JSONObject import java.time.Duration import java.time.ZonedDateTime @@ -119,12 +119,10 @@ class OmnipodDashPumpPlugin @Inject constructor( updatePodWarnings() aapsLogger.info(LTag.PUMP, "statusChecker") - val err = createFakeTBRWhenNoActivePod() + createFakeTBRWhenNoActivePod() .subscribeOn(aapsSchedulers.io) - .blockingGet() - err?.let { - aapsLogger.warn(LTag.PUMP, "Error on createFakeTBRWhenNoActivePod=$it") - } + .doOnError { aapsLogger.warn(LTag.PUMP, "Error on createFakeTBRWhenNoActivePod=$it") } + .blockingAwait() handler.postDelayed(statusChecker, STATUS_CHECK_INTERVAL_MS) } } @@ -248,11 +246,10 @@ class OmnipodDashPumpPlugin @Inject constructor( ) { try { stopConnecting?.let { - val error = omnipodManager.connect(it).ignoreElements().blockingGet() - aapsLogger.info(LTag.PUMPCOMM, "connect error=$error") - if (error == null) { - podStateManager.incrementSuccessfulConnectionAttemptsAfterRetries() - } + omnipodManager.connect(it).ignoreElements() + .doOnError { aapsLogger.info(LTag.PUMPCOMM, "connect error=$it") } + .doOnComplete { podStateManager.incrementSuccessfulConnectionAttemptsAfterRetries() } + .blockingAwait() } } finally { synchronized(this) { @@ -282,19 +279,21 @@ class OmnipodDashPumpPlugin @Inject constructor( return } - val throwable = getPodStatus().blockingGet() - if (throwable != null) { - aapsLogger.error(LTag.PUMP, "Error in getPumpStatus", throwable) - } else { - aapsLogger.info(LTag.PUMP, "getPumpStatus executed with success") - if (!podStateManager.isActivationCompleted) { - val msg = podStateManager.recoverActivationFromPodStatus() - msg?.let { - // TODO: show dialog with "try again, the pod is busy now" - aapsLogger.info(LTag.PUMP, "recoverActivationFromPodStatus msg=$msg") + getPodStatus() + .doOnComplete { + aapsLogger.info(LTag.PUMP, "getPumpStatus executed with success") + if (!podStateManager.isActivationCompleted) { + val msg = podStateManager.recoverActivationFromPodStatus() + msg?.let { + // TODO: show dialog with "try again, the pod is busy now" + aapsLogger.info(LTag.PUMP, "recoverActivationFromPodStatus msg=$msg") + } } } - } + .doOnError { + aapsLogger.error(LTag.PUMP, "Error in getPumpStatus", it) + } + .blockingAwait() } private fun getPodStatus(): Completable = Completable.concat( @@ -682,12 +681,13 @@ class OmnipodDashPumpPlugin @Inject constructor( if (bolusCanceled && podStateManager.activeCommand != null) { var errorGettingStatus: Throwable? = null for (tries in 1..BOLUS_RETRIES) { - errorGettingStatus = getPodStatus().blockingGet() - if (errorGettingStatus != null) { - aapsLogger.debug(LTag.PUMP, "waitForBolusDeliveryToComplete errorGettingStatus=$errorGettingStatus") - Thread.sleep(BOLUS_RETRY_INTERVAL_MS) // retry every 2 sec - continue - } + getPodStatus() + .doOnError { + errorGettingStatus = it + aapsLogger.debug(LTag.PUMP, "waitForBolusDeliveryToComplete errorGettingStatus=$errorGettingStatus") + Thread.sleep(BOLUS_RETRY_INTERVAL_MS) // retry every 2 sec + } + .blockingAwait() } if (errorGettingStatus != null) { // requestedBolusAmount will be updated later, via pumpSync @@ -720,10 +720,15 @@ class OmnipodDashPumpPlugin @Inject constructor( else getPodStatus() - val errorGettingStatus = cmd.blockingGet() + var errorGettingStatus: Throwable? = null + cmd + .doOnError { + errorGettingStatus = it + aapsLogger.debug(LTag.PUMP, "waitForBolusDeliveryToComplete errorGettingStatus=$errorGettingStatus") + Thread.sleep(BOLUS_RETRY_INTERVAL_MS) // retry every 3 sec + } + .blockingAwait() if (errorGettingStatus != null) { - aapsLogger.debug(LTag.PUMP, "waitForBolusDeliveryToComplete errorGettingStatus=$errorGettingStatus") - Thread.sleep(BOLUS_RETRY_INTERVAL_MS) // retry every 3 sec continue } val bolusDeliveringActive = podStateManager.deliveryStatus?.bolusDeliveringActive() ?: false diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt index 4f3f682892..c08f20418f 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManager.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definitio import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BasalProgram import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.definition.BeepType import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.ResponseType -import io.reactivex.Observable +import io.reactivex.rxjava3.core.Observable import java.util.* import java.util.concurrent.CountDownLatch diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt index 7b3a9f3778..8e105489e6 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/OmnipodDashManagerImpl.kt @@ -17,9 +17,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response. import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager import info.nightscout.androidaps.utils.Round import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.Observable -import io.reactivex.functions.Action -import io.reactivex.functions.Consumer +import io.reactivex.rxjava3.core.Observable +import io.reactivex.rxjava3.functions.Action +import io.reactivex.rxjava3.functions.Consumer import java.time.Duration import java.time.ZonedDateTime import java.util.* diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManager.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManager.kt index 7a98a61b19..79daf6bf96 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManager.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManager.kt @@ -5,7 +5,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.comm.session. import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event.PodEvent import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.Command import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.Response -import io.reactivex.Observable +import io.reactivex.rxjava3.core.Observable import java.util.concurrent.CountDownLatch import kotlin.reflect.KClass diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt index 986a3236c7..48010e80cd 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/comm/OmnipodDashBleManagerImpl.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.event.PodEven import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.command.base.Command import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.Response import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager -import io.reactivex.Observable +import io.reactivex.rxjava3.core.Observable import java.util.concurrent.CountDownLatch import java.util.concurrent.atomic.AtomicBoolean import javax.inject.Inject diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt index c3efc76604..2d0a97cafa 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManager.kt @@ -8,9 +8,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response. import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.DefaultStatusResponse import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.SetUniqueIdResponse import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.VersionResponse -import io.reactivex.Completable -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single import java.io.Serializable import java.time.ZonedDateTime import java.util.* diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt index cd29abf1a6..fa8c448adc 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/driver/pod/state/OmnipodDashPodStateManagerImpl.kt @@ -18,9 +18,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response. import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.response.VersionResponse import info.nightscout.androidaps.utils.Round import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Completable -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single import java.io.Serializable import java.time.Duration import java.time.Instant diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistory.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistory.kt index 328de1e725..2f25ea03c9 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistory.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistory.kt @@ -11,8 +11,8 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.* import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.HistoryRecordDao import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.HistoryRecordEntity import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.mapper.HistoryMapper -import io.reactivex.Completable -import io.reactivex.Single +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.core.Single import java.lang.System.currentTimeMillis import javax.inject.Inject diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/HistoryRecordDao.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/HistoryRecordDao.kt index 1beaab6bca..2d079acbd2 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/HistoryRecordDao.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/database/HistoryRecordDao.kt @@ -7,8 +7,8 @@ import androidx.room.OnConflictStrategy import androidx.room.Query import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.InitialResult import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.data.ResolvedResult -import io.reactivex.Completable -import io.reactivex.Single +import io.reactivex.rxjava3.core.Completable +import io.reactivex.rxjava3.core.Single @Dao abstract class HistoryRecordDao { diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt index 2ae74aec62..bdf09c0a36 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/DashPodManagementActivity.kt @@ -22,8 +22,8 @@ import info.nightscout.androidaps.queue.events.EventQueueChanged import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject class DashPodManagementActivity : NoSplashAppCompatActivity() { diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt index 2ab79b26c4..c9b7ddde83 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/OmnipodDashOverviewFragment.kt @@ -44,8 +44,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.ui.UIRunnable -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.apache.commons.lang3.StringUtils import java.time.Duration import java.time.ZonedDateTime diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt index d4ddd744b1..081be0d0f4 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInitializePodViewModel.kt @@ -18,9 +18,9 @@ import info.nightscout.androidaps.plugins.pump.omnipod.dash.util.I8n import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Single -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.core.Single +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy import javax.inject.Inject class DashInitializePodViewModel @Inject constructor( diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt index 16ce1dbb65..bcb1e04e2d 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/activation/viewmodel/action/DashInsertCannulaViewModel.kt @@ -28,9 +28,9 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.Single -import io.reactivex.rxkotlin.plusAssign -import io.reactivex.rxkotlin.subscribeBy +import io.reactivex.rxjava3.core.Single +import io.reactivex.rxjava3.kotlin.plusAssign +import io.reactivex.rxjava3.kotlin.subscribeBy import javax.inject.Inject class DashInsertCannulaViewModel @Inject constructor( diff --git a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt index 208b7515ea..e7f4e7193c 100644 --- a/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt +++ b/omnipod-dash/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/ui/wizard/deactivation/viewmodel/action/DashDeactivatePodViewModel.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactiva import info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.state.OmnipodDashPodStateManager import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import javax.inject.Inject class DashDeactivatePodViewModel @Inject constructor( diff --git a/omnipod-eros/build.gradle b/omnipod-eros/build.gradle index af0bece53b..0af50ce411 100644 --- a/omnipod-eros/build.gradle +++ b/omnipod-eros/build.gradle @@ -31,7 +31,7 @@ dependencies { api "androidx.room:room-ktx:$room_version" api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava2:$room_version" + api "androidx.room:room-rxjava3:$room_version" kapt "androidx.room:room-compiler:$room_version" // optional - Test helpers diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index 522489a5c7..c6f39aad69 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -106,7 +106,7 @@ import info.nightscout.androidaps.utils.TimeChangeType; import info.nightscout.androidaps.utils.resources.ResourceHelper; import info.nightscout.androidaps.utils.rx.AapsSchedulers; import info.nightscout.shared.sharedPreferences.SP; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.disposables.CompositeDisposable; import static info.nightscout.androidaps.extensions.PumpStateExtensionKt.convertedToAbsolute; import static info.nightscout.androidaps.extensions.PumpStateExtensionKt.getPlannedRemainingMinutes; diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/OmnipodManager.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/OmnipodManager.java index ad935fe431..7295c5e3d9 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/OmnipodManager.java +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/driver/manager/OmnipodManager.java @@ -53,10 +53,10 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.Pod import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.exception.PrecedingCommandFailedUncertainlyException; import info.nightscout.androidaps.plugins.pump.omnipod.eros.rileylink.manager.OmnipodRileyLinkCommunicationManager; import info.nightscout.androidaps.utils.rx.AapsSchedulers; -import io.reactivex.Completable; -import io.reactivex.Flowable; -import io.reactivex.Single; -import io.reactivex.disposables.CompositeDisposable; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Single; +import io.reactivex.rxjava3.disposables.CompositeDisposable; import io.reactivex.subjects.SingleSubject; public class OmnipodManager { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/ErosHistory.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/ErosHistory.kt index 6d331b1e4d..cbb66d2a72 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/ErosHistory.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/ErosHistory.kt @@ -2,9 +2,9 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.history import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryRecordDao import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryRecordEntity -import io.reactivex.Maybe -import io.reactivex.Single -import io.reactivex.schedulers.Schedulers +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single +import io.reactivex.rxjava3.schedulers.Schedulers class ErosHistory(private val dao: ErosHistoryRecordDao) { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/database/ErosHistoryRecordDao.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/database/ErosHistoryRecordDao.kt index 7a21629b06..c5a8831882 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/database/ErosHistoryRecordDao.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/database/ErosHistoryRecordDao.kt @@ -4,8 +4,8 @@ import androidx.room.Dao import androidx.room.Insert import androidx.room.OnConflictStrategy import androidx.room.Query -import io.reactivex.Maybe -import io.reactivex.Single +import io.reactivex.rxjava3.core.Maybe +import io.reactivex.rxjava3.core.Single @Dao interface ErosHistoryRecordDao { diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt index 77521747b6..2ec76043d5 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/ErosPodManagementActivity.kt @@ -34,8 +34,8 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.ui.UIRunnable -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import javax.inject.Inject /** diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt index 14798e6341..579c748d13 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/OmnipodErosOverviewFragment.kt @@ -52,8 +52,8 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.ui.UIRunnable -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import org.apache.commons.lang3.StringUtils import org.joda.time.DateTime import org.joda.time.Duration diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt index d83b084e2f..0d0e77c088 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInitializePodViewModel.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Ac import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsErosPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import javax.inject.Inject class ErosInitializePodViewModel @Inject constructor( diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt index 3766b27643..bd58f2d84e 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/activation/viewmodel/action/ErosInsertCannulaViewModel.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.Ac import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsErosPodStateManager import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import javax.inject.Inject class ErosInsertCannulaViewModel @Inject constructor( diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt index 410760b70e..3733176cf6 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/ui/wizard/deactivation/viewmodel/action/ErosDeactivatePodViewModel.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.pump.omnipod.common.ui.wizard.deactiva import info.nightscout.androidaps.plugins.pump.omnipod.eros.manager.AapsOmnipodErosManager import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.rx.AapsSchedulers -import io.reactivex.Single +import io.reactivex.rxjava3.core.Single import javax.inject.Inject class ErosDeactivatePodViewModel @Inject constructor( diff --git a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt index 9dc17e91af..a974d09fb5 100644 --- a/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt +++ b/openhumans/src/main/java/info/nightscout/androidaps/plugin/general/openhumans/OpenHumansUploader.kt @@ -27,8 +27,8 @@ import info.nightscout.androidaps.plugin.general.openhumans.ui.OHLoginActivity import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable -import io.reactivex.rxkotlin.plusAssign +import io.reactivex.rxjava3.disposables.CompositeDisposable +import io.reactivex.rxjava3.kotlin.plusAssign import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.NonCancellable import kotlinx.coroutines.withContext diff --git a/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt b/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt index d634e9c73a..7488846730 100644 --- a/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt +++ b/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/PumpPluginAbstract.kt @@ -30,7 +30,7 @@ import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP -import io.reactivex.disposables.CompositeDisposable +import io.reactivex.rxjava3.disposables.CompositeDisposable import org.json.JSONException import org.json.JSONObject diff --git a/shared/build.gradle b/shared/build.gradle index 147d9250e1..12354733b6 100644 --- a/shared/build.gradle +++ b/shared/build.gradle @@ -30,7 +30,7 @@ dependencies { } //RxBus - api "io.reactivex.rxjava2:rxjava:$rxjava_version" - api "io.reactivex.rxjava2:rxkotlin:$rxkotlin_version" - api "io.reactivex.rxjava2:rxandroid:$rxandroid_version" + api "io.reactivex.rxjava3:rxjava:$rxjava_version" + api "io.reactivex.rxjava3:rxkotlin:$rxkotlin_version" + api "io.reactivex.rxjava3:rxandroid:$rxandroid_version" } \ No newline at end of file diff --git a/shared/src/main/java/info/nightscout/androidaps/utils/rx/AapsSchedulers.kt b/shared/src/main/java/info/nightscout/androidaps/utils/rx/AapsSchedulers.kt index e05bbf975d..89471ce5a4 100644 --- a/shared/src/main/java/info/nightscout/androidaps/utils/rx/AapsSchedulers.kt +++ b/shared/src/main/java/info/nightscout/androidaps/utils/rx/AapsSchedulers.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.utils.rx -import io.reactivex.Scheduler -import io.reactivex.android.schedulers.AndroidSchedulers -import io.reactivex.schedulers.Schedulers +import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers +import io.reactivex.rxjava3.core.Scheduler +import io.reactivex.rxjava3.schedulers.Schedulers /** * Created by adrian on 12.04.20. diff --git a/shared/src/main/java/info/nightscout/androidaps/utils/rx/RxExtensions.kt b/shared/src/main/java/info/nightscout/androidaps/utils/rx/RxExtensions.kt deleted file mode 100644 index aef2b17e18..0000000000 --- a/shared/src/main/java/info/nightscout/androidaps/utils/rx/RxExtensions.kt +++ /dev/null @@ -1,62 +0,0 @@ -package info.nightscout.androidaps.utils.rx - -import io.reactivex.Completable -import io.reactivex.Flowable -import io.reactivex.Observable -import io.reactivex.Single -import java.util.concurrent.TimeUnit -import kotlin.math.pow - -/** - * Created by adrian on 12.04.20. - */ - -inline fun Single.retryExponentialBackoff(retries: Int, time: Long, timeUnit: TimeUnit): Single = - this.retryWhen { throwables: Flowable -> - throwables.zipWith( - Flowable.range(0, retries), - { throwable: Throwable, retryCount: Int -> - if (retryCount >= retries) { - throw throwable - } else { - retryCount - } - } - ).flatMap { retryCount: Int -> - Flowable.timer(time * 2.toDouble().pow(retryCount.toDouble()).toLong(), timeUnit) - } - } - -fun Completable.retryExponentialBackoff(retries: Int, time: Long, timeUnit: TimeUnit): Completable = - this.retryWhen { throwables: Flowable -> - throwables.zipWith( - Flowable.range(0, retries), - { throwable: Throwable, retryCount: Int -> - if (retryCount >= retries) { - throw throwable - } else { - retryCount - } - } - ).flatMap { retryCount: Int -> - Flowable.timer(time * 2.toDouble().pow(retryCount.toDouble()).toLong(), timeUnit) - } - } - -inline fun Observable.retryWithBackoff( - retries: Int, - delay: Long, - timeUnit: TimeUnit, - delayFactor: Double = 1.0 -): Observable = this.retryWhen { - it.zipWith(Observable.range(0, retries + 1), { throwable: Throwable, count: Int -> - if (count >= retries) { - throw throwable - } else { - count - } - }).flatMap { retryCount: Int -> - val actualDelay = (timeUnit.toMillis(delay) * delayFactor.pow(retryCount.toDouble())).toLong() - Observable.timer(actualDelay, TimeUnit.MILLISECONDS) - } -} \ No newline at end of file diff --git a/shared/src/test/java/info/nightscout/androidaps/utils/rx/RxExtensionsTest.kt b/shared/src/test/java/info/nightscout/androidaps/utils/rx/RxExtensionsTest.kt deleted file mode 100644 index 2e84af6618..0000000000 --- a/shared/src/test/java/info/nightscout/androidaps/utils/rx/RxExtensionsTest.kt +++ /dev/null @@ -1,132 +0,0 @@ -package info.nightscout.androidaps.utils.rx - -import io.reactivex.Observable -import io.reactivex.observers.TestObserver -import io.reactivex.schedulers.TestScheduler -import org.junit.Assert.assertEquals -import org.junit.Rule -import org.junit.Test -import java.util.concurrent.TimeUnit -import java.util.concurrent.atomic.AtomicInteger - -class RxExtensionsTest { - - private val testScheduler = TestScheduler() - - @get:Rule - val schedulerRule = RxSchedulerRule(testScheduler) - - @Test - fun `fail after 4 retries`() { - val atomicInteger = AtomicInteger() - val testObservable: TestObserver = succeedOnObservable(atomicInteger, 5) - .retryWithBackoff(4, 1, TimeUnit.SECONDS) - .test() - assertEquals(1, atomicInteger.get()) // 1st failure - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(3, TimeUnit.SECONDS) // 2nd, 3rd, 4th failure - assertEquals(4, atomicInteger.get()) - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(1, TimeUnit.SECONDS) // 5th failure on 4th retry - assertEquals(5, atomicInteger.get()) - testObservable.assertError(RuntimeException::class.java) - testObservable.assertNever(1) - } - - @Test - fun `succeed after 4 retries`() { - val atomicInteger = AtomicInteger() - val testObservable: TestObserver = succeedOnObservable(atomicInteger, 4) - .retryWithBackoff(4, 1, TimeUnit.SECONDS) - .test() - assertEquals(1, atomicInteger.get()) // 1st failure - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(3, TimeUnit.SECONDS) // 2nd, 3rd, 4th failure - assertEquals(4, atomicInteger.get()) - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(1, TimeUnit.SECONDS) // 5th is a charm - assertEquals(5, atomicInteger.get()) - testObservable.assertValue(1) - } - - @Test - fun `succeed after 4 retries with delay factor`() { - val atomicInteger = AtomicInteger() - val testObservable: TestObserver = succeedOnObservable(atomicInteger, 4) - .retryWithBackoff(4, 1, TimeUnit.SECONDS, delayFactor = 1.2) - .test() - assertEquals(1, atomicInteger.get()) // 1st failure - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(999, TimeUnit.MILLISECONDS) - assertEquals(1, atomicInteger.get()) - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(1, TimeUnit.MILLISECONDS) //1st retry after 1 second - assertEquals(2, atomicInteger.get()) - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(1199, TimeUnit.MILLISECONDS) - assertEquals(2, atomicInteger.get()) - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(1, TimeUnit.MILLISECONDS) //2nd retry after 1.2 seconds more - assertEquals(3, atomicInteger.get()) - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(1439, TimeUnit.MILLISECONDS) - assertEquals(3, atomicInteger.get()) - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(1, TimeUnit.MILLISECONDS) //3rd retry after 1.44 seconds more - assertEquals(4, atomicInteger.get()) - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - testScheduler.advanceTimeBy(1726, TimeUnit.MILLISECONDS) - assertEquals(4, atomicInteger.get()) - testObservable.assertNotComplete() - testObservable.assertNotTerminated() - testObservable.assertNever(1) - - //4th retry = 5th try is a charm after 1.728 seconds more - rounding error by 1 millisecond!! - testScheduler.advanceTimeBy(1, TimeUnit.MILLISECONDS) - assertEquals(5, atomicInteger.get()) - testObservable.assertValue(1) - } - - private fun succeedOnObservable(atomicInteger: AtomicInteger, initialFailures: Int): Observable = - Observable.defer { - if (atomicInteger.incrementAndGet() == initialFailures + 1) { - Observable.just(1) - } else { - Observable.error(RuntimeException()) - } - } - -} \ No newline at end of file diff --git a/shared/src/test/java/info/nightscout/androidaps/utils/rx/RxSchedulerRule.kt b/shared/src/test/java/info/nightscout/androidaps/utils/rx/RxSchedulerRule.kt index 3ccdc9dcf4..79abe4692a 100644 --- a/shared/src/test/java/info/nightscout/androidaps/utils/rx/RxSchedulerRule.kt +++ b/shared/src/test/java/info/nightscout/androidaps/utils/rx/RxSchedulerRule.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.utils.rx -import io.reactivex.Scheduler -import io.reactivex.android.plugins.RxAndroidPlugins -import io.reactivex.plugins.RxJavaPlugins +import io.reactivex.rxjava3.android.plugins.RxAndroidPlugins +import io.reactivex.rxjava3.core.Scheduler +import io.reactivex.rxjava3.plugins.RxJavaPlugins import org.junit.rules.TestRule import org.junit.runner.Description import org.junit.runners.model.Statement