From 730b163c12df88cb180d2a85868319dc1c911b0d Mon Sep 17 00:00:00 2001 From: James Woglom Date: Sun, 5 Apr 2026 22:07:09 -0400 Subject: [PATCH 1/3] Fix pump plugin/ui for latest dev changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. TandemPairingManager.kt — Replaced .setCustomTitle(AlertDialogHelper.buildCustomTitle(...)) with .setTitle() 2. TandemUICommunication.kt — Added NotificationManager to constructor, replaced uiInteraction.addNotification(Notification.*) with notificationManager.post(NotificationId.*, NotificationLevel.*) 3. TandemPumpConnector.kt — Changed sendBasalProfile(profile: PumpProfile) to sendBasalProfile(profile: Profile), replaced profile.dia with profile.iCfg?.dia 4. ActionsActivity.kt — Changed base class from DaggerComponentActivity to DaggerAppCompatActivity, removed ComposeUiProvider injection pattern, added notificationManager for TandemUICommunication constructor 5. DataActivity.kt — Same changes as ActionsActivity 6. TandemModule.kt — Removed TandemComposeUiComponent subcomponent, uncommented @ContributesAndroidInjector for both activities 7. TandemMobiPumpPlugin.kt — Wrapped 5 PumpSync calls in runBlocking {} 8. TandemMobiPumpFragment.kt — Removed EventExtendedBolusChange and EventTempBasalChange imports and subscriptions --- .../common/comm/maint/TandemPairingManager.kt | 2 +- .../common/comm/ui/TandemUICommunication.kt | 14 +-- .../driver/connector/TandemPumpConnector.kt | 4 +- .../tandem/di/TandemComposeUiComponent.kt | 20 ----- .../app/aaps/pump/tandem/di/TandemModule.kt | 15 ++-- .../pump/tandem/mobi/TandemMobiPumpPlugin.kt | 85 +++++++++++-------- .../pump/tandem/mobi/ui/ActionsActivity.kt | 16 ++-- .../aaps/pump/tandem/mobi/ui/DataActivity.kt | 16 ++-- .../tandem/mobi/ui/TandemMobiPumpFragment.kt | 10 --- 9 files changed, 77 insertions(+), 105 deletions(-) delete mode 100644 pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemComposeUiComponent.kt diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/maint/TandemPairingManager.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/maint/TandemPairingManager.kt index 9a90d5a5135..ee544ca2ce7 100644 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/maint/TandemPairingManager.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/maint/TandemPairingManager.kt @@ -350,7 +350,7 @@ class TandemPairingManager constructor( input.inputType = InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_NORMAL MaterialAlertDialogBuilder(context, app.aaps.core.ui.R.style.DialogTheme) - .setCustomTitle(AlertDialogHelper.buildCustomTitle(context, resourceHelper.gs(R.string.tandem_ble_config_pairing_title))) + .setTitle(resourceHelper.gs(R.string.tandem_ble_config_pairing_title)) .setMessage(resourceHelper.gs(R.string.tandem_ble_config_pairing_message, btName, btAddress)) .setView(input) .setPositiveButton(context.getString(app.aaps.core.ui.R.string.ok)) { dialog: DialogInterface, _: Int -> diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/ui/TandemUICommunication.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/ui/TandemUICommunication.kt index 878f5cd3d10..1182030bbeb 100644 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/ui/TandemUICommunication.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/ui/TandemUICommunication.kt @@ -3,6 +3,9 @@ package app.aaps.pump.tandem.common.comm.ui import android.content.Context import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag +import app.aaps.core.interfaces.notifications.NotificationId +import app.aaps.core.interfaces.notifications.NotificationLevel +import app.aaps.core.interfaces.notifications.NotificationManager import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.pump.common.defs.PumpRunningState import app.aaps.pump.tandem.common.comm.TandemCommunicationManager @@ -49,7 +52,8 @@ class TandemUICommunication @Inject constructor ( var context: Context, var aapsLogger: AAPSLogger, var pumpUtil: TandemPumpUtil, - var uiInteraction: UiInteraction + var uiInteraction: UiInteraction, + var notificationManager: NotificationManager ): CommunicationListener { var TAG = LTag.PUMPCOMM @@ -282,10 +286,10 @@ class TandemUICommunication @Inject constructor ( aapsLogger.error(TAG,"$req was not successful. The pump returned an error fulfilling the request." ) - uiInteraction.addNotification( - Notification.TANDEM_PUMP_MESSAGE_ERROR, - text = "$req was not successful. The pump returned an error fulfilling the request." , - level = Notification.URGENT + notificationManager.post( + id = NotificationId.TANDEM_PUMP_MESSAGE_ERROR, + text = "$req was not successful. The pump returned an error fulfilling the request.", + level = NotificationLevel.URGENT ) // val show = AlertDialog.Builder(context) diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/driver/connector/TandemPumpConnector.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/driver/connector/TandemPumpConnector.kt index b8505eb40b8..365d03a645f 100644 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/driver/connector/TandemPumpConnector.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/driver/connector/TandemPumpConnector.kt @@ -946,7 +946,7 @@ class TandemPumpConnector @Inject constructor(var tandemPumpStatus: TandemPumpSt IDPSegmentStatus.CORRECTION_FACTOR) // TODO(jwoglom): use IDPManager which handles some of these complexities - override fun sendBasalProfile(profile: PumpProfile): DataCommandResponse { + override fun sendBasalProfile(profile: Profile): DataCommandResponse { aapsLogger.info(LTag.PUMPCOMM, "sendBasalProfile") @@ -989,7 +989,7 @@ class TandemPumpConnector @Inject constructor(var tandemPumpStatus: TandemPumpSt idpSegments[0].profileBasalRate, idpSegments[0].profileTargetBG, idpSegments[0].profileISF, - profile.dia.toInt() * 60, + (profile.iCfg?.dia?.toInt() ?: 0) * 60, 0) // for AAPS profile we are setting this to 0 val responseMessage = getCommunicationManager()?.sendCommand(createIDPRequest) as CreateIDPResponse? diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemComposeUiComponent.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemComposeUiComponent.kt deleted file mode 100644 index 087df24789d..00000000000 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemComposeUiComponent.kt +++ /dev/null @@ -1,20 +0,0 @@ -package app.aaps.pump.tandem.di - -import app.aaps.core.interfaces.ui.compose.ComposeUiFactory -import app.aaps.core.interfaces.ui.compose.ComposeUi -import app.aaps.pump.tandem.mobi.ui.ActionsActivity -import app.aaps.pump.tandem.mobi.ui.DataActivity -import dagger.Subcomponent - -@Subcomponent -interface TandemComposeUiComponent : ComposeUi { - fun inject(activity: ActionsActivity) - fun inject(activity: DataActivity) - // fun inject(activity: PairingActivity) - - - @Subcomponent.Factory - interface FactoryCompose : ComposeUiFactory { - override fun create(): TandemComposeUiComponent - } -} \ No newline at end of file diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemModule.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemModule.kt index 705e8c9997e..7511dc9285d 100644 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemModule.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemModule.kt @@ -2,8 +2,6 @@ package app.aaps.pump.tandem.di import app.aaps.core.interfaces.di.PumpDriver import app.aaps.core.interfaces.plugin.PluginBase -// import app.aaps.core.interfaces.ui.compose.ComposeUiFactory -// import app.aaps.implementation.ui.ComposeUiModule import app.aaps.pump.tandem.common.comm.TandemDataConverter import app.aaps.pump.tandem.common.comm.history.HistoryRetriever import app.aaps.pump.tandem.common.comm.maint.TandemConnectionFixer @@ -16,6 +14,8 @@ import app.aaps.pump.tandem.common.driver.connector.TandemPumpConnectionManager import app.aaps.pump.tandem.common.driver.connector.TandemPumpConnector import app.aaps.pump.tandem.common.service.TandemService import app.aaps.pump.tandem.common.util.TandemPumpUtil +import app.aaps.pump.tandem.mobi.ui.ActionsActivity +import app.aaps.pump.tandem.mobi.ui.DataActivity import app.aaps.pump.tandem.mobi.ui.TandemMobiPumpFragment import app.aaps.pump.tandem.mobi.ui.wizard.TandemMobiConnectionWizardActivity import app.aaps.pump.tandem.mobi.driver.TandemMobiPumpDriverConfiguration @@ -29,8 +29,7 @@ import dagger.hilt.components.SingletonComponent import dagger.multibindings.IntKey import dagger.multibindings.IntoMap -@Module(includes = [TandemDatabaseModule::class, TandemModuleImpl::class], - subcomponents = [TandemComposeUiComponent::class]) +@Module(includes = [TandemDatabaseModule::class, TandemModuleImpl::class]) @InstallIn(SingletonComponent::class) @Suppress("unused") abstract class TandemModule { @@ -75,8 +74,8 @@ abstract class TandemModule { // Compose UI Activities - //@ContributesAndroidInjector abstract fun contributesActionsActivity(): ActionsActivity - // @ContributesAndroidInjector abstract fun contributesTandemUICommunication(): TandemUICommunication + @ContributesAndroidInjector abstract fun contributesActionsActivity(): ActionsActivity + @ContributesAndroidInjector abstract fun contributesDataActivity(): DataActivity // @Provides // @Singleton @@ -87,10 +86,6 @@ abstract class TandemModule { // @ContributesAndroidInjector abstract fun contributesTandemPumpDriverConfiguration(): TandemPumpDriverConfiguration - // @Binds - // @IntoMap - // @ComposeUiModule("tandem") - // abstract fun bindTandemComposeUiFactory(factory: TandemComposeUiComponent.FactoryCompose): ComposeUiFactory // Pump plugin registration — @IntKey range 1000–1200, see PluginsListModule for overview diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/TandemMobiPumpPlugin.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/TandemMobiPumpPlugin.kt index a7e8fbfd656..7e71c737fa2 100755 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/TandemMobiPumpPlugin.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/TandemMobiPumpPlugin.kt @@ -37,6 +37,7 @@ import app.aaps.core.interfaces.rx.events.EventRefreshOverview import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.DecimalFormatter import app.aaps.core.interfaces.utils.fabric.FabricPrivacy +import kotlinx.coroutines.runBlocking import app.aaps.core.keys.interfaces.Preferences import app.aaps.core.validators.preferences.AdaptiveIntPreference import app.aaps.core.validators.preferences.AdaptiveListPreference @@ -883,12 +884,14 @@ class TandemMobiPumpPlugin @Inject constructor( } if (tbrId!=null) { - pumpSync.syncStopTemporaryBasalWithPumpId( - timestamp = System.currentTimeMillis(), - pumpSerial = serialNumber(), - pumpType = PumpType.TANDEM_MOBI_BT, - endPumpId = getPrefixedIdForDb(pumpEventId = tbrId, isBolus = false) - ) + runBlocking { + pumpSync.syncStopTemporaryBasalWithPumpId( + timestamp = System.currentTimeMillis(), + pumpSerial = serialNumber(), + pumpType = PumpType.TANDEM_MOBI_BT, + endPumpId = getPrefixedIdForDb(pumpEventId = tbrId, isBolus = false) + ) + } pumpStatus.currentTempBasalInternal = null preferences.put(TandemLongNonPreferenceKey.LastTbrId, 0L) @@ -1263,24 +1266,28 @@ class TandemMobiPumpPlugin @Inject constructor( TandemLongNonPreferenceKey.StandardBoluses) if (detailedBolusInfo.carbs > 0.0) { - pumpSync.syncCarbsWithTimestamp( - timestamp = now, - amount = detailedBolusInfo.carbs, - pumpId = getPrefixedIdForDb(pumpEventId = bolusData.bolusId!!, isBolus = true), - pumpType = pumpType, - pumpSerial = serialNumber() - ) + runBlocking { + pumpSync.syncCarbsWithTimestamp( + timestamp = now, + amount = detailedBolusInfo.carbs, + pumpId = getPrefixedIdForDb(pumpEventId = bolusData.bolusId!!, isBolus = true), + pumpType = pumpType, + pumpSerial = serialNumber() + ) + } } if (detailedBolusInfo.insulin > 0.0) { - pumpSync.syncBolusWithPumpId( - timestamp = now, - amount = PumpInsulin(detailedBolusInfo.insulin), - pumpId = getPrefixedIdForDb(pumpEventId = bolusData.bolusId!!, isBolus = true), - pumpType = pumpType, - pumpSerial = serialNumber(), - type = detailedBolusInfo.bolusType - ) + runBlocking { + pumpSync.syncBolusWithPumpId( + timestamp = now, + amount = PumpInsulin(detailedBolusInfo.insulin), + pumpId = getPrefixedIdForDb(pumpEventId = bolusData.bolusId!!, isBolus = true), + pumpType = pumpType, + pumpSerial = serialNumber(), + type = detailedBolusInfo.bolusType + ) + } } //readPumpHistoryAfterAction(bolusInfo = detailedBolusInfo) @@ -1382,16 +1389,18 @@ class TandemMobiPumpPlugin @Inject constructor( preferences.put(key = TandemLongNonPreferenceKey.LastTbrId, value = controlCommandResponse.id!!) - pumpSync.syncTemporaryBasalWithPumpId( - timestamp = controlCommandResponse.start!!, - isAbsolute = false, - pumpSerial = serialNumber(), - pumpType = PumpType.TANDEM_MOBI_BT, - type = tbrType, - duration = (controlCommandResponse.durationMinutes * 60 * 1000).toLong(), - rate = PumpRate(percent.toDouble()), - pumpId = getPrefixedIdForDb(pumpEventId = controlCommandResponse.id!!, isBolus =false) - ) + runBlocking { + pumpSync.syncTemporaryBasalWithPumpId( + timestamp = controlCommandResponse.start!!, + isAbsolute = false, + pumpSerial = serialNumber(), + pumpType = PumpType.TANDEM_MOBI_BT, + type = tbrType, + duration = (controlCommandResponse.durationMinutes * 60 * 1000).toLong(), + rate = PumpRate(percent.toDouble()), + pumpId = getPrefixedIdForDb(pumpEventId = controlCommandResponse.id!!, isBolus = false) + ) + } incrementStatistics(statsKey = TandemLongNonPreferenceKey.TbrsSet) @@ -1514,12 +1523,14 @@ class TandemMobiPumpPlugin @Inject constructor( val controlCommandResponse = commandResponseCancel.value as ControlCommandResponse - pumpSync.syncStopTemporaryBasalWithPumpId( - timestamp = System.currentTimeMillis(), - pumpSerial = serialNumber(), - pumpType = PumpType.TANDEM_MOBI_BT, - endPumpId = getPrefixedIdForDb(pumpEventId = controlCommandResponse.id.toLong(), isBolus = false) - ) + runBlocking { + pumpSync.syncStopTemporaryBasalWithPumpId( + timestamp = System.currentTimeMillis(), + pumpSerial = serialNumber(), + pumpType = PumpType.TANDEM_MOBI_BT, + endPumpId = getPrefixedIdForDb(pumpEventId = controlCommandResponse.id.toLong(), isBolus = false) + ) + } pumpStatus.currentTempBasalInternal = null preferences.put(TandemLongNonPreferenceKey.LastTbrId, 0L) diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/ActionsActivity.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/ActionsActivity.kt index 3a96862f1ff..645d788a2dd 100644 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/ActionsActivity.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/ActionsActivity.kt @@ -30,9 +30,8 @@ import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag +import app.aaps.core.interfaces.notifications.NotificationManager import app.aaps.core.interfaces.resources.ResourceHelper -import app.aaps.core.interfaces.ui.compose.ComposeUiProvider -import app.aaps.core.interfaces.ui.compose.DaggerComponentActivity import app.aaps.core.keys.interfaces.Preferences import app.aaps.pump.common.test.ResourceHelperTest import app.aaps.pump.tandem.common.comm.ui.TandemUICommunication @@ -43,7 +42,6 @@ import app.aaps.pump.tandem.common.driver.connector.TandemPumpConnector import app.aaps.pump.tandem.common.driver.tandemDataStore import app.aaps.pump.tandem.common.keys.TandemLongNonPreferenceKey import app.aaps.pump.tandem.common.util.TandemPumpUtil -import app.aaps.pump.tandem.di.TandemComposeUiComponent import app.aaps.pump.tandem.mobi.ui.actions.Actions import app.aaps.pump.tandem.mobi.ui.actions.PumpInfo import app.aaps.pump.tandem.mobi.ui.actions.cartridge.CartridgeActions @@ -54,10 +52,11 @@ import app.aaps.pump.tandem.mobi.ui.actions.cartridge.SiteReminder import app.aaps.pump.tandem.mobi.ui.theme.TMobiScreensTheme import app.aaps.shared.tests.AAPSLoggerTest import com.jwoglom.pumpx2.pump.messages.Message +import dagger.android.support.DaggerAppCompatActivity import javax.inject.Inject -class ActionsActivity : DaggerComponentActivity() { +class ActionsActivity : DaggerAppCompatActivity() { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var tandemPumpStatus: TandemPumpStatus @@ -67,6 +66,7 @@ class ActionsActivity : DaggerComponentActivity() { @Inject lateinit var tandemPumpConnector: TandemPumpConnector @Inject lateinit var resourceHelper: ResourceHelper @Inject lateinit var uiInteraction: app.aaps.core.interfaces.ui.UiInteraction + @Inject lateinit var notificationManager: NotificationManager var sectionState: ActionsLandingSection = ActionsLandingSection.ACTIONS @@ -82,17 +82,13 @@ class ActionsActivity : DaggerComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - val composeUiComponent = (application as ComposeUiProvider) - .getComposeUiModule("tandem") as TandemComposeUiComponent - - composeUiComponent.inject(this) - tandemUICommunication = TandemUICommunication(dataStore = tandemDataStore, pumpStatus = tandemPumpStatus, context = context, pumpUtil = tandemPumpUtil, aapsLogger= aapsLogger, - uiInteraction = uiInteraction) + uiInteraction = uiInteraction, + notificationManager = notificationManager) if (intent != null && intent.extras != null && intent.getStringExtra("section") != null) { sectionState = ActionsLandingSection.entries.find { diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/DataActivity.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/DataActivity.kt index f218bef4af2..23102ca60d0 100644 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/DataActivity.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/DataActivity.kt @@ -34,9 +34,8 @@ import androidx.compose.ui.unit.dp import androidx.navigation.NavHostController import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag +import app.aaps.core.interfaces.notifications.NotificationManager import app.aaps.core.interfaces.resources.ResourceHelper -import app.aaps.core.interfaces.ui.compose.ComposeUiProvider -import app.aaps.core.interfaces.ui.compose.DaggerComponentActivity import app.aaps.pump.common.test.ResourceHelperTest import app.aaps.pump.tandem.common.comm.ui.TandemUICommunication import app.aaps.pump.tandem.common.data.defs.RefreshData @@ -48,7 +47,6 @@ import app.aaps.pump.tandem.common.driver.TandemPumpStatus import app.aaps.pump.tandem.common.driver.connector.TandemPumpConnector import app.aaps.pump.tandem.common.driver.tandemDataStore import app.aaps.pump.tandem.common.util.TandemPumpUtil -import app.aaps.pump.tandem.di.TandemComposeUiComponent import app.aaps.pump.tandem.mobi.ui.actions.Actions import app.aaps.pump.tandem.mobi.ui.data.DataDisplayMain import app.aaps.pump.tandem.mobi.ui.data.History @@ -60,10 +58,11 @@ import com.jwoglom.pumpx2.pump.messages.Message import com.jwoglom.pumpx2.pump.messages.response.qualifyingEvent.QualifyingEvent import java.time.LocalDateTime import java.time.ZoneId +import dagger.android.support.DaggerAppCompatActivity import javax.inject.Inject -class DataActivity : DaggerComponentActivity() { +class DataActivity : DaggerAppCompatActivity() { @Inject lateinit var aapsLogger: AAPSLogger @Inject lateinit var tandemPumpStatus: TandemPumpStatus @@ -73,6 +72,7 @@ class DataActivity : DaggerComponentActivity() { @Inject lateinit var resourceHelper: ResourceHelper @Inject lateinit var dbDataHandler: DbDataHandler @Inject lateinit var uiInteraction: app.aaps.core.interfaces.ui.UiInteraction + @Inject lateinit var notificationManager: NotificationManager var sectionState: DataLandingSection = DataLandingSection.DATA @@ -87,11 +87,6 @@ class DataActivity : DaggerComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - - val composeUiComponent = (application as ComposeUiProvider) - .getComposeUiModule("tandem") as TandemComposeUiComponent - - composeUiComponent.inject(this) if (intent != null && intent.extras != null && intent.getStringExtra("section") != null) { sectionState = DataLandingSection.entries.find { @@ -104,7 +99,8 @@ class DataActivity : DaggerComponentActivity() { context = context, pumpUtil = tandemPumpUtil, aapsLogger= aapsLogger, - uiInteraction = uiInteraction) + uiInteraction = uiInteraction, + notificationManager = notificationManager) enableEdgeToEdge() setContent { diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/TandemMobiPumpFragment.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/TandemMobiPumpFragment.kt index 03b3b494b69..dd4a6ce96c9 100755 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/TandemMobiPumpFragment.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/mobi/ui/TandemMobiPumpFragment.kt @@ -20,10 +20,8 @@ import app.aaps.core.interfaces.queue.CommandQueue import app.aaps.core.interfaces.resources.ResourceHelper import app.aaps.core.interfaces.rx.AapsSchedulers import app.aaps.core.interfaces.rx.bus.RxBus -import app.aaps.core.interfaces.rx.events.EventExtendedBolusChange import app.aaps.core.interfaces.rx.events.EventQueueChanged import app.aaps.core.interfaces.rx.events.EventRefreshButtonState -import app.aaps.core.interfaces.rx.events.EventTempBasalChange import app.aaps.core.interfaces.sharedPreferences.SP import app.aaps.core.interfaces.utils.DateUtil import app.aaps.core.interfaces.utils.fabric.FabricPrivacy @@ -191,14 +189,6 @@ class TandemMobiPumpFragment : DaggerFragment() { .toObservable(EventPumpDriverStateChanged::class.java) .observeOn(aapsSchedulers.main) .subscribe({ updateCurrentActivity(it.driverStatus) }, { fabricPrivacy.logException(it) }) - disposable += rxBus - .toObservable(EventExtendedBolusChange::class.java) - .observeOn(aapsSchedulers.main) - .subscribe({ updateGUI(PumpUpdateFragmentType.TreatmentValues) }, { fabricPrivacy.logException(it) }) - disposable += rxBus - .toObservable(EventTempBasalChange::class.java) - .observeOn(aapsSchedulers.main) - .subscribe({ updateGUI(PumpUpdateFragmentType.TreatmentValues) }, { fabricPrivacy.logException(it) }) disposable += rxBus .toObservable(EventPumpFragmentValuesChanged::class.java) .observeOn(aapsSchedulers.main) From 68c97b2327d1cdc57151bbdee5ef722d0d30109b Mon Sep 17 00:00:00 2001 From: James Woglom Date: Sun, 5 Apr 2026 22:12:33 -0400 Subject: [PATCH 2/3] add notificationManager param --- .../tandem/common/comm/history/HistoryRetriever.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/history/HistoryRetriever.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/history/HistoryRetriever.kt index 20c92254ea5..4b9a6c81ee1 100644 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/history/HistoryRetriever.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/common/comm/history/HistoryRetriever.kt @@ -6,6 +6,7 @@ import androidx.annotation.VisibleForTesting import app.aaps.core.interfaces.logging.AAPSLogger import app.aaps.core.interfaces.logging.LTag import app.aaps.core.interfaces.rx.bus.RxBus +import app.aaps.core.interfaces.notifications.NotificationManager import app.aaps.core.interfaces.ui.UiInteraction import app.aaps.core.keys.interfaces.Preferences import app.aaps.pump.common.defs.PumpDriverState @@ -70,7 +71,8 @@ class HistoryRetriever @Inject constructor( val rxBus: RxBus, var context: Context, val dbDataHandler: DbDataHandler, - val uiInteraction: UiInteraction + val uiInteraction: UiInteraction, + val notificationManager: NotificationManager ) { @@ -115,7 +117,8 @@ class HistoryRetriever @Inject constructor( context = context, pumpUtil = pumpUtil, aapsLogger= aapsLogger, - uiInteraction = uiInteraction) + uiInteraction = uiInteraction, + notificationManager = notificationManager) communication.historyRetriever = this this.communication.tandemCommunicationManager = tandemPumpConnector.getCommunicationManager() @@ -186,7 +189,8 @@ class HistoryRetriever @Inject constructor( context = context, pumpUtil = pumpUtil, aapsLogger= aapsLogger, - uiInteraction = uiInteraction) + uiInteraction = uiInteraction, + notificationManager = notificationManager) communication.historyRetriever = this this.communication.tandemCommunicationManager = tandemPumpConnector.getCommunicationManager() From 03c8c44d3244db1a8806e81b509a4a604d9b7542 Mon Sep 17 00:00:00 2001 From: James Woglom Date: Sun, 5 Apr 2026 22:25:50 -0400 Subject: [PATCH 3/3] fix TandemModule di --- .../pump/common/di/PumpCommonModuleImpl.kt | 31 ------------------- .../app/aaps/pump/tandem/di/TandemModule.kt | 2 +- 2 files changed, 1 insertion(+), 32 deletions(-) delete mode 100644 pump/common/src/main/kotlin/app/aaps/pump/common/di/PumpCommonModuleImpl.kt diff --git a/pump/common/src/main/kotlin/app/aaps/pump/common/di/PumpCommonModuleImpl.kt b/pump/common/src/main/kotlin/app/aaps/pump/common/di/PumpCommonModuleImpl.kt deleted file mode 100644 index 0efbb699b02..00000000000 --- a/pump/common/src/main/kotlin/app/aaps/pump/common/di/PumpCommonModuleImpl.kt +++ /dev/null @@ -1,31 +0,0 @@ -package app.aaps.pump.common.di - -import app.aaps.core.interfaces.logging.AAPSLogger -import app.aaps.core.interfaces.pump.PumpSync -import app.aaps.core.interfaces.sharedPreferences.SP -import app.aaps.core.keys.interfaces.Preferences -import dagger.Module -import dagger.Provides -import app.aaps.pump.common.sync.PumpSyncStorage -import dagger.hilt.InstallIn -import dagger.hilt.components.SingletonComponent -import javax.inject.Singleton - -@Module -@InstallIn(SingletonComponent::class) -@Suppress("unused") -class PumpCommonModuleImpl { - - @Provides - @Singleton - fun providesPumpSyncStorage( - pumpSync: PumpSync, - preferences: Preferences, - aapsLogger: AAPSLogger - ): PumpSyncStorage { - return PumpSyncStorage(pumpSync = pumpSync, - preferences = preferences, - aapsLogger = aapsLogger) - } - -} \ No newline at end of file diff --git a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemModule.kt b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemModule.kt index 7511dc9285d..35fa18cf9ee 100644 --- a/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemModule.kt +++ b/pump/tandem/src/main/kotlin/app/aaps/pump/tandem/di/TandemModule.kt @@ -92,7 +92,7 @@ abstract class TandemModule { @Binds @PumpDriver @IntoMap - @IntKey(1090) + @IntKey(1140) abstract fun bindTandemMobiPumpPlugin(plugin: TandemMobiPumpPlugin): PluginBase