Fix others flavors
This commit is contained in:
parent
ff67c44e8f
commit
aeb18e0b7c
7 changed files with 20 additions and 24 deletions
|
@ -167,7 +167,7 @@ abstract class PluginsModule {
|
|||
abstract fun bindMDIPlugin(plugin: MDIPlugin): PluginBase
|
||||
|
||||
@Binds
|
||||
@NotNSClient
|
||||
@AllConfigs
|
||||
@IntoMap
|
||||
@IntKey(180)
|
||||
abstract fun bindVirtualPumpPlugin(plugin: VirtualPumpPlugin): PluginBase
|
||||
|
|
|
@ -17,6 +17,7 @@ import info.nightscout.androidaps.activities.PreferencesActivity
|
|||
import info.nightscout.androidaps.events.EventRebuildTabs
|
||||
import info.nightscout.androidaps.interfaces.*
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper
|
||||
import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui
|
||||
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||
import info.nightscout.androidaps.utils.extensions.plusAssign
|
||||
import info.nightscout.androidaps.utils.protection.ProtectionCheck
|
||||
|
|
|
@ -9,7 +9,6 @@ import java.util.ArrayList;
|
|||
import javax.inject.Inject;
|
||||
import javax.inject.Singleton;
|
||||
|
||||
import dagger.Lazy;
|
||||
import dagger.android.HasAndroidInjector;
|
||||
import info.nightscout.androidaps.R;
|
||||
import info.nightscout.androidaps.events.EventAppInitialized;
|
||||
|
@ -18,7 +17,6 @@ import info.nightscout.androidaps.events.EventRebuildTabs;
|
|||
import info.nightscout.androidaps.interfaces.APSInterface;
|
||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider;
|
||||
import info.nightscout.androidaps.interfaces.BgSourceInterface;
|
||||
import info.nightscout.androidaps.interfaces.CommandQueueProvider;
|
||||
import info.nightscout.androidaps.interfaces.InsulinInterface;
|
||||
import info.nightscout.androidaps.interfaces.PluginBase;
|
||||
import info.nightscout.androidaps.interfaces.PluginDescription;
|
||||
|
@ -30,13 +28,7 @@ import info.nightscout.androidaps.interfaces.TreatmentsInterface;
|
|||
import info.nightscout.androidaps.logging.AAPSLogger;
|
||||
import info.nightscout.androidaps.logging.LTag;
|
||||
import info.nightscout.androidaps.plugins.bus.RxBusWrapper;
|
||||
import info.nightscout.androidaps.plugins.insulin.InsulinOrefRapidActingPlugin;
|
||||
import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin;
|
||||
import info.nightscout.androidaps.plugins.profile.ns.NSProfilePlugin;
|
||||
import info.nightscout.androidaps.plugins.pump.virtual.VirtualPumpPlugin;
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref0Plugin;
|
||||
import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin;
|
||||
import info.nightscout.androidaps.plugins.treatments.TreatmentsPlugin;
|
||||
import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui;
|
||||
import info.nightscout.androidaps.utils.OKDialog;
|
||||
import info.nightscout.androidaps.utils.resources.ResourceHelper;
|
||||
import info.nightscout.androidaps.utils.sharedPreferences.SP;
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package info.nightscout.androidaps.plugins.configBuilder
|
||||
|
||||
import info.nightscout.androidaps.Config
|
||||
import info.nightscout.androidaps.interfaces.*
|
||||
import info.nightscout.androidaps.logging.AAPSLogger
|
||||
import info.nightscout.androidaps.logging.LTag
|
||||
import java.util.*
|
||||
import javax.inject.Inject
|
||||
import javax.inject.Singleton
|
||||
import kotlin.collections.ArrayList
|
||||
|
||||
@Singleton
|
||||
class PluginStore @Inject constructor(
|
||||
|
@ -27,6 +26,7 @@ class PluginStore @Inject constructor(
|
|||
return pluginStore!!
|
||||
}
|
||||
}
|
||||
|
||||
lateinit var plugins: List<@JvmSuppressWildcards PluginBase>
|
||||
|
||||
private var activeBgSource: BgSourceInterface? = null
|
||||
|
@ -83,14 +83,16 @@ class PluginStore @Inject constructor(
|
|||
var pluginsInCategory: ArrayList<PluginBase>?
|
||||
|
||||
// PluginType.APS
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.APS)
|
||||
activeAPS = getTheOneEnabledInArray(pluginsInCategory, PluginType.APS) as APSInterface?
|
||||
if (activeAPS == null) {
|
||||
activeAPS = getDefaultPlugin(PluginType.APS) as APSInterface
|
||||
(activeAPS as PluginBase).setPluginEnabled(PluginType.APS, true)
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting APSInterface")
|
||||
if (!Config.NSCLIENT && !Config.PUMPCONTROL) {
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.APS)
|
||||
activeAPS = getTheOneEnabledInArray(pluginsInCategory, PluginType.APS) as APSInterface?
|
||||
if (activeAPS == null) {
|
||||
activeAPS = getDefaultPlugin(PluginType.APS) as APSInterface
|
||||
(activeAPS as PluginBase).setPluginEnabled(PluginType.APS, true)
|
||||
aapsLogger.debug(LTag.CONFIGBUILDER, "Defaulting APSInterface")
|
||||
}
|
||||
setFragmentVisiblities((activeAPS as PluginBase).name, pluginsInCategory, PluginType.APS)
|
||||
}
|
||||
setFragmentVisiblities((activeAPS as PluginBase).name, pluginsInCategory, PluginType.APS)
|
||||
|
||||
// PluginType.INSULIN
|
||||
pluginsInCategory = getSpecificPluginsList(PluginType.INSULIN)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package info.nightscout.androidaps.plugins.configBuilder
|
||||
package info.nightscout.androidaps.plugins.configBuilder.events
|
||||
|
||||
import info.nightscout.androidaps.events.EventUpdateGui
|
||||
|
|
@ -98,13 +98,12 @@ class KeepAliveReceiver : DaggerBroadcastReceiver() {
|
|||
// if there is no BG available, we have to upload anyway to have correct
|
||||
// IOB displayed in NS
|
||||
private fun checkAPS() {
|
||||
val usedAPS = activePlugin.activeAPS
|
||||
var shouldUploadStatus = false
|
||||
if (Config.NSCLIENT) return
|
||||
if (Config.PUMPCONTROL) shouldUploadStatus = true
|
||||
if (!loopPlugin.isEnabled() || iobCobCalculatorPlugin.actualBg() == null)
|
||||
else if (!loopPlugin.isEnabled() || iobCobCalculatorPlugin.actualBg() == null)
|
||||
shouldUploadStatus = true
|
||||
else if (DateUtil.isOlderThan(usedAPS.lastAPSRun, 5)) shouldUploadStatus = true
|
||||
else if (DateUtil.isOlderThan(activePlugin.activeAPS.lastAPSRun, 5)) shouldUploadStatus = true
|
||||
if (DateUtil.isOlderThan(lastIobUpload, IOB_UPDATE_FREQUENCY) && shouldUploadStatus) {
|
||||
lastIobUpload = DateUtil.now()
|
||||
NSUpload.uploadDeviceStatus(loopPlugin, iobCobCalculatorPlugin, profileFunction, activePlugin.activePump)
|
||||
|
|
|
@ -4,6 +4,7 @@ import android.os.Bundle
|
|||
import com.crashlytics.android.Crashlytics
|
||||
import com.google.firebase.analytics.FirebaseAnalytics
|
||||
import info.nightscout.androidaps.BuildConfig
|
||||
import info.nightscout.androidaps.Config
|
||||
import info.nightscout.androidaps.MainApp
|
||||
import info.nightscout.androidaps.R
|
||||
import info.nightscout.androidaps.interfaces.ActivePluginProvider
|
||||
|
@ -132,7 +133,8 @@ class FabricPrivacy @Inject constructor(
|
|||
val hashes: List<String> = signatureVerifierPlugin.shortHashes()
|
||||
if (hashes.isNotEmpty()) mainApp.firebaseAnalytics.setUserProperty("Hash", hashes[0])
|
||||
activePlugin.activePump.let { mainApp.firebaseAnalytics.setUserProperty("Pump", it::class.java.simpleName) }
|
||||
activePlugin.activeAPS.let { mainApp.firebaseAnalytics.setUserProperty("Aps", it::class.java.simpleName) }
|
||||
if (!Config.NSCLIENT && !Config.PUMPCONTROL)
|
||||
activePlugin.activeAPS.let { mainApp.firebaseAnalytics.setUserProperty("Aps", it::class.java.simpleName) }
|
||||
activePlugin.activeBgSource.let { mainApp.firebaseAnalytics.setUserProperty("BgSource", it::class.java.simpleName) }
|
||||
mainApp.firebaseAnalytics.setUserProperty("Profile", activePlugin.activeProfileInterface.javaClass.simpleName)
|
||||
activePlugin.activeSensitivity.let { mainApp.firebaseAnalytics.setUserProperty("Sensitivity", it::class.java.simpleName) }
|
||||
|
|
Loading…
Reference in a new issue