From 0a25fa3c9a4379073a34d29398219594d452b446 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 10 Dec 2021 08:58:23 +0100 Subject: [PATCH 1/3] share code between aap and wear --- app/build.gradle | 1 + .../activities/MyPreferenceFragment.kt | 2 +- .../androidaps/activities/SurveyActivity.kt | 2 +- .../androidaps/dialogs/ExtendedBolusDialog.kt | 2 +- .../androidaps/dialogs/FillDialog.kt | 2 +- .../androidaps/dialogs/InsulinDialog.kt | 9 +-- .../androidaps/dialogs/TempBasalDialog.kt | 2 +- .../androidaps/dialogs/TreatmentDialog.kt | 2 +- .../androidaps/dialogs/WizardDialog.kt | 2 +- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 2 +- .../overview/dialogs/EditQuickWizardDialog.kt | 2 +- .../smsCommunicator/SmsCommunicatorPlugin.kt | 1 + .../general/wear/ActionStringHandler.kt | 1 + .../profile/local/LocalProfileFragment.kt | 1 + .../sensitivity/AbstractSensitivityPlugin.kt | 2 +- .../setupwizard/elements/SWEditIntNumber.kt | 2 +- .../setupwizard/elements/SWEditNumber.kt | 2 +- .../elements/SWEditNumberWithUnits.kt | 2 +- .../androidaps/utils/ActivityMonitor.kt | 3 +- .../androidaps/utils/ui/TimeListEdit.java | 2 +- core/build.gradle | 1 + .../androidaps/activities/TDDStatsActivity.kt | 2 +- .../nightscout/androidaps/utils/DateUtil.kt | 1 + .../androidaps/utils/SafeParse.java | 50 --------------- .../sharedPreferences/SPImplementation.kt | 2 +- .../androidaps/utils/ui/NumberPicker.kt | 2 +- settings.gradle | 1 + shared/.gitignore | 1 + shared/build.gradle | 16 +++++ shared/consumer-rules.pro | 0 shared/proguard-rules.pro | 21 ++++++ shared/src/main/AndroidManifest.xml | 5 ++ .../java/info/nightscout/shared/SafeParse.kt | 64 +++++++++++++++++++ .../info/nightscout/shared}/SafeParseTest.kt | 4 +- wear/build.gradle | 2 + .../java/info/nightscout/androidaps/Aaps.java | 1 - .../BaseComplicationProviderService.java | 25 ++++++-- .../ComplicationTapBroadcastReceiver.java | 30 +++++---- .../androidaps/data/ListenerService.java | 21 ++++-- .../nightscout/androidaps/di/AppComponent.kt | 3 +- .../androidaps/di/ServicesModule.kt | 14 ++++ .../interaction/actions/BolusActivity.java | 3 +- .../interaction/actions/CPPActivity.java | 3 +- .../interaction/actions/ECarbActivity.java | 3 +- .../interaction/actions/FillActivity.java | 3 +- .../actions/TempTargetActivity.java | 3 +- .../interaction/actions/WizardActivity.java | 3 +- .../interaction/utils/Inevitable.java | 17 +++-- .../interaction/utils/SafeParse.java | 46 ------------- .../interaction/utils/WearUtil.java | 8 ++- .../androidaps/watchfaces/Steampunk.java | 3 +- .../testing/mockers/RawDataMocker.java | 2 +- 52 files changed, 240 insertions(+), 164 deletions(-) delete mode 100644 core/src/main/java/info/nightscout/androidaps/utils/SafeParse.java create mode 100644 shared/.gitignore create mode 100644 shared/build.gradle create mode 100644 shared/consumer-rules.pro create mode 100644 shared/proguard-rules.pro create mode 100644 shared/src/main/AndroidManifest.xml create mode 100644 shared/src/main/java/info/nightscout/shared/SafeParse.kt rename {wear/src/test/java/info/nightscout/androidaps/interaction/utils => shared/src/test/java/info/nightscout/shared}/SafeParseTest.kt (98%) create mode 100644 wear/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt delete mode 100644 wear/src/main/java/info/nightscout/androidaps/interaction/utils/SafeParse.java diff --git a/app/build.gradle b/app/build.gradle index e537f839fc..28842488a3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -176,6 +176,7 @@ allprojects { dependencies { wearApp project(':wear') + implementation project(':shared') implementation project(':core') implementation project(':automation') implementation project(':combo') diff --git a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt index b9cd7b9d0a..3a879c0f1a 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -49,7 +49,7 @@ import info.nightscout.androidaps.plugins.source.GlimpPlugin import info.nightscout.androidaps.plugins.source.PoctechPlugin import info.nightscout.androidaps.plugins.source.TomatoPlugin import info.nightscout.androidaps.plugins.source.GlunovoPlugin -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.alertDialogs.OKDialog.show import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck diff --git a/app/src/main/java/info/nightscout/androidaps/activities/SurveyActivity.kt b/app/src/main/java/info/nightscout/androidaps/activities/SurveyActivity.kt index 72f728c869..bcc618a0d3 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/SurveyActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/SurveyActivity.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.utils.ActivityMonitor import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.InstanceId -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.stats.TddCalculator import info.nightscout.androidaps.utils.stats.TirCalculator diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt index 152295027f..4c86819465 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/ExtendedBolusDialog.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.HtmlHelper -import info.nightscout.androidaps.utils.SafeParse +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 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 1ab91a7abc..f247a8a026 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/FillDialog.kt @@ -25,7 +25,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.HtmlHelper -import info.nightscout.androidaps.utils.SafeParse +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 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 56d6784870..32ad387659 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/InsulinDialog.kt @@ -12,23 +12,24 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.data.DetailedBolusInfo import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.entities.TemporaryTarget import info.nightscout.androidaps.database.entities.UserEntry.Action import info.nightscout.androidaps.database.entities.UserEntry.Sources +import info.nightscout.androidaps.database.entities.ValueWithUnit import info.nightscout.androidaps.database.transactions.InsertAndCancelCurrentTemporaryTargetTransaction import info.nightscout.androidaps.databinding.DialogInsulinBinding +import info.nightscout.androidaps.extensions.formatColor +import info.nightscout.androidaps.extensions.toVisibility +import info.nightscout.androidaps.interfaces.* import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.alertDialogs.OKDialog -import info.nightscout.androidaps.extensions.formatColor import info.nightscout.androidaps.utils.extensions.toSignedString -import info.nightscout.androidaps.extensions.toVisibility -import info.nightscout.androidaps.interfaces.* import info.nightscout.androidaps.utils.resources.ResourceHelper +import info.nightscout.shared.SafeParse import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import java.text.DecimalFormat diff --git a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt index cb87789269..65ee820eeb 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TempBasalDialog.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.HtmlHelper -import info.nightscout.androidaps.utils.SafeParse +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 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 21130e5816..3769e1b245 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -27,7 +27,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.HtmlHelper -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.extensions.formatColor 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 92afb1141e..c7dda7d515 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/WizardDialog.kt @@ -30,7 +30,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.extensions.valueToUnits diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt index 6e3a2fb43a..cf8871b924 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.plugins.aps.logger.LoggerCallback import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.sharedPreferences.SP import org.json.JSONArray diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt index 72e1b46983..acddc63f1d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/dialogs/EditQuickWizardDialog.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.general.overview.events.EventQuickWizardChange import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.extensions.selectedItemPosition import info.nightscout.androidaps.utils.extensions.setEnableForChildren 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 1ca68a21c6..f071fe389d 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 @@ -47,6 +47,7 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.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 org.apache.commons.lang3.StringUtils 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 9b9a8df370..ec15d0ef48 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 @@ -39,6 +39,7 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.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 java.text.DateFormat 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 bd5dcb7823..b06502a153 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 @@ -30,6 +30,7 @@ import info.nightscout.androidaps.utils.resources.ResourceHelper 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 java.text.DecimalFormat diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt index bfd9630b12..978305970c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.Round -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.sharedPreferences.SP import kotlin.math.max diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditIntNumber.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditIntNumber.kt index ad471cadd3..af3b66544b 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditIntNumber.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditIntNumber.kt @@ -8,7 +8,7 @@ import android.widget.LinearLayout import android.widget.TextView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.setupwizard.SWIntNumberValidator -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.ui.NumberPicker import java.text.DecimalFormat diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumber.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumber.kt index f29f7a1328..331494737a 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumber.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumber.kt @@ -8,7 +8,7 @@ import android.widget.LinearLayout import android.widget.TextView import dagger.android.HasAndroidInjector import info.nightscout.androidaps.setupwizard.SWNumberValidator -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.ui.NumberPicker import java.text.DecimalFormat diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt index c6f6f87935..b8a1520bda 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWEditNumberWithUnits.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.setupwizard.SWNumberValidator -import info.nightscout.androidaps.utils.SafeParse +import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.ui.NumberPicker import java.text.DecimalFormat import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt b/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt index 52f7f9a20f..02b2264278 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt @@ -9,6 +9,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.SafeParse import javax.inject.Inject import javax.inject.Singleton @@ -64,7 +65,7 @@ class ActivityMonitor @Inject constructor( if (key.startsWith("Monitor") && key.endsWith("total")) { val v = if (value is Long) value else SafeParse.stringToLong(value as String) val activity = key.split("_")[1].replace("Activity", "") - val duration = dateUtil.niceTimeScalar(v as Long, rh) + val duration = dateUtil.niceTimeScalar(v, rh) val start = sp.getLong(key.replace("total", "start"), 0) val days = T.msecs(dateUtil.now() - start).days() result += rh.gs(R.string.activitymonitorformat, activity, duration, days) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/ui/TimeListEdit.java b/app/src/main/java/info/nightscout/androidaps/utils/ui/TimeListEdit.java index 1a19937aa9..6a5264fcd2 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/ui/TimeListEdit.java +++ b/app/src/main/java/info/nightscout/androidaps/utils/ui/TimeListEdit.java @@ -27,7 +27,7 @@ import java.util.List; import info.nightscout.androidaps.R; import info.nightscout.androidaps.logging.AAPSLogger; import info.nightscout.androidaps.utils.DateUtil; -import info.nightscout.androidaps.utils.SafeParse; +import info.nightscout.shared.SafeParse; /** * Created by mike on 29.12.2016. diff --git a/core/build.gradle b/core/build.gradle index 8f3db0440e..abc0a93709 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -12,5 +12,6 @@ apply from: "${project.rootDir}/gradle/test_dependencies.gradle" apply from: "${project.rootDir}/gradle/jacoco_global.gradle" dependencies { + implementation project(':shared') implementation project(':database') } 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 4b0fb71da7..8ead99abf1 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt @@ -30,10 +30,10 @@ import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.FabricPrivacy -import info.nightscout.androidaps.utils.SafeParse import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.SafeParse import io.reactivex.disposables.CompositeDisposable import java.text.DateFormat import java.text.DecimalFormat diff --git a/core/src/main/java/info/nightscout/androidaps/utils/DateUtil.kt b/core/src/main/java/info/nightscout/androidaps/utils/DateUtil.kt index d2d9feef7b..2a3aea9e32 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/DateUtil.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/DateUtil.kt @@ -5,6 +5,7 @@ import androidx.collection.LongSparseArray import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.core.R import info.nightscout.androidaps.utils.resources.ResourceHelper +import info.nightscout.shared.SafeParse import org.joda.time.DateTime import org.joda.time.format.DateTimeFormat import org.joda.time.format.ISODateTimeFormat diff --git a/core/src/main/java/info/nightscout/androidaps/utils/SafeParse.java b/core/src/main/java/info/nightscout/androidaps/utils/SafeParse.java deleted file mode 100644 index 0ea68bd1eb..0000000000 --- a/core/src/main/java/info/nightscout/androidaps/utils/SafeParse.java +++ /dev/null @@ -1,50 +0,0 @@ -package info.nightscout.androidaps.utils; - -/** - * Created by mike on 23.06.2016. - */ -public class SafeParse { - // TODO return logging with dagger -// private static Logger log = StacktraceLoggerWrapper.getLogger(SafeParse.class); - public static Double stringToDouble(String input) { - Double result = 0d; - input = input.replace(",", "."); - input = input.replace("−", "-"); - if (input.equals("")) - return 0d; - try { - result = Double.parseDouble(input); - } catch (Exception e) { -// log.error("Error parsing " + input + " to double"); - } - return result; - } - - public static Integer stringToInt(String input) { - Integer result = 0; - input = input.replace(",", "."); - input = input.replace("−", "-"); - if (input.equals("")) - return 0; - try { - result = Integer.parseInt(input); - } catch (Exception e) { -// log.error("Error parsing " + input + " to int"); - } - return result; - } - - public static Long stringToLong(String input) { - Long result = 0L; - input = input.replace(",", "."); - input = input.replace("−", "-"); - if (input.equals("")) - return 0L; - try { - result = Long.parseLong(input); - } catch (Exception e) { -// log.error("Error parsing " + input + " to long"); - } - return result; - } -} diff --git a/core/src/main/java/info/nightscout/androidaps/utils/sharedPreferences/SPImplementation.kt b/core/src/main/java/info/nightscout/androidaps/utils/sharedPreferences/SPImplementation.kt index 6592ece693..085ae897e5 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/sharedPreferences/SPImplementation.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/sharedPreferences/SPImplementation.kt @@ -1,8 +1,8 @@ package info.nightscout.androidaps.utils.sharedPreferences import android.content.SharedPreferences -import info.nightscout.androidaps.utils.SafeParse import info.nightscout.androidaps.utils.resources.ResourceHelper +import info.nightscout.shared.SafeParse import javax.inject.Inject import javax.inject.Singleton diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt b/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt index 9f5c51f010..f2f2b5e91c 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/ui/NumberPicker.kt @@ -20,8 +20,8 @@ import android.widget.Button import android.widget.EditText import android.widget.LinearLayout import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.utils.SafeParse import info.nightscout.androidaps.utils.ToastUtils +import info.nightscout.shared.SafeParse import java.text.NumberFormat import java.util.concurrent.Executors import java.util.concurrent.ScheduledExecutorService diff --git a/settings.gradle b/settings.gradle index 69eee62615..db9ca9d97f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,3 +17,4 @@ include ':omnipod-dash' include ':diaconn' include ':openhumans' +include ':shared' diff --git a/shared/.gitignore b/shared/.gitignore new file mode 100644 index 0000000000..42afabfd2a --- /dev/null +++ b/shared/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/shared/build.gradle b/shared/build.gradle new file mode 100644 index 0000000000..20e4ae5030 --- /dev/null +++ b/shared/build.gradle @@ -0,0 +1,16 @@ +apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-kapt' +apply plugin: 'kotlin-allopen' +apply plugin: 'com.hiya.jacoco-android' + +apply from: "${project.rootDir}/gradle/android_dependencies.gradle" +apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle" +apply from: "${project.rootDir}/gradle/test_dependencies.gradle" +apply from: "${project.rootDir}/gradle/jacoco_global.gradle" + +android { + defaultConfig { + minSdkVersion 23 // for wear + } +} diff --git a/shared/consumer-rules.pro b/shared/consumer-rules.pro new file mode 100644 index 0000000000..e69de29bb2 diff --git a/shared/proguard-rules.pro b/shared/proguard-rules.pro new file mode 100644 index 0000000000..481bb43481 --- /dev/null +++ b/shared/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/shared/src/main/AndroidManifest.xml b/shared/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..c299e9eece --- /dev/null +++ b/shared/src/main/AndroidManifest.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/shared/src/main/java/info/nightscout/shared/SafeParse.kt b/shared/src/main/java/info/nightscout/shared/SafeParse.kt new file mode 100644 index 0000000000..1c415b858b --- /dev/null +++ b/shared/src/main/java/info/nightscout/shared/SafeParse.kt @@ -0,0 +1,64 @@ +package info.nightscout.shared + +import java.lang.Exception + +object SafeParse { + + // TODO return logging with dagger + // private static Logger log = StacktraceLoggerWrapper.getLogger(SafeParse.class); + @JvmStatic fun stringToDouble(inputString: String?): Double { + var input = inputString ?: return 0.0 + var result = 0.0 + input = input.replace(",", ".") + input = input.replace("−", "-") + if (input == "") return 0.0 + try { + result = input.toDouble() + } catch (e: Exception) { +// log.error("Error parsing " + input + " to double"); + } + return result + } + + @JvmStatic fun stringToFloat(inputString: String?): Float { + var input = inputString ?: return 0f + var result = 0f + input = input.replace(",", ".") + input = input.replace("−", "-") + if (input == "") return 0f + try { + result = input.toFloat() + } catch (e: Exception) { +// log.error("Error parsing " + input + " to float"); + } + return result + } + + @JvmStatic fun stringToInt(inputString: String?): Int { + var input = inputString ?: return 0 + var result = 0 + input = input.replace(",", ".") + input = input.replace("−", "-") + if (input == "") return 0 + try { + result = input.toInt() + } catch (e: Exception) { +// log.error("Error parsing " + input + " to int"); + } + return result + } + + fun stringToLong(inputString: String?): Long { + var input = inputString ?: return 0L + var result = 0L + input = input.replace(",", ".") + input = input.replace("−", "-") + if (input == "") return 0L + try { + result = input.toLong() + } catch (e: Exception) { +// log.error("Error parsing " + input + " to long"); + } + return result + } +} \ No newline at end of file diff --git a/wear/src/test/java/info/nightscout/androidaps/interaction/utils/SafeParseTest.kt b/shared/src/test/java/info/nightscout/shared/SafeParseTest.kt similarity index 98% rename from wear/src/test/java/info/nightscout/androidaps/interaction/utils/SafeParseTest.kt rename to shared/src/test/java/info/nightscout/shared/SafeParseTest.kt index be9a420b54..bc08de96db 100644 --- a/wear/src/test/java/info/nightscout/androidaps/interaction/utils/SafeParseTest.kt +++ b/shared/src/test/java/info/nightscout/shared/SafeParseTest.kt @@ -1,10 +1,8 @@ -package info.nightscout.androidaps.interaction.utils +package info.nightscout.shared import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test -import java.lang.NullPointerException - @Suppress("SpellCheckingInspection") class SafeParseTest { diff --git a/wear/build.gradle b/wear/build.gradle index 5c2b02f9ee..260c35477e 100644 --- a/wear/build.gradle +++ b/wear/build.gradle @@ -114,6 +114,8 @@ allprojects { dependencies { + implementation project(':shared') + implementation fileTree(include: ['*.jar'], dir: 'libs') //implementation files("libs/hellocharts-library-1.5.5.jar") //compile "com.ustwo.android:clockwise-wearable:1.0.2" diff --git a/wear/src/main/java/info/nightscout/androidaps/Aaps.java b/wear/src/main/java/info/nightscout/androidaps/Aaps.java index 54f12a970c..0fb4858f4c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/Aaps.java +++ b/wear/src/main/java/info/nightscout/androidaps/Aaps.java @@ -1,7 +1,6 @@ package info.nightscout.androidaps; import android.annotation.SuppressLint; -import android.app.Application; import android.content.Context; import android.content.Intent; import android.content.SharedPreferences; diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/BaseComplicationProviderService.java b/wear/src/main/java/info/nightscout/androidaps/complications/BaseComplicationProviderService.java index f510c9e267..6295068fc5 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/BaseComplicationProviderService.java +++ b/wear/src/main/java/info/nightscout/androidaps/complications/BaseComplicationProviderService.java @@ -18,6 +18,10 @@ import java.util.HashSet; import java.util.Set; import androidx.localbroadcastmanager.content.LocalBroadcastManager; + +import javax.inject.Inject; + +import dagger.android.AndroidInjection; import info.nightscout.androidaps.R; import info.nightscout.androidaps.Aaps; import info.nightscout.androidaps.data.RawDisplayData; @@ -35,6 +39,15 @@ import info.nightscout.androidaps.interaction.utils.WearUtil; */ public abstract class BaseComplicationProviderService extends ComplicationProviderService { + @Inject Inevitable inevitable; + + // Not derived from DaggerService, do injection here + @Override + public void onCreate() { + AndroidInjection.inject(this); + super.onCreate(); + } + private static final String TAG = BaseComplicationProviderService.class.getSimpleName(); private static final String KEY_COMPLICATIONS = "complications"; @@ -286,13 +299,13 @@ public abstract class BaseComplicationProviderService extends ComplicationProvid /* * Schedule check for field update */ - public static void checkIfUpdateNeeded() { + public void checkIfUpdateNeeded() { Persistence p = new Persistence(); Log.d(TAG, "Pending check if update needed - "+p.getString(KEY_COMPLICATIONS, "")); - Inevitable.task(TASK_ID_REFRESH_COMPLICATION, 15 * Constants.SECOND_IN_MS, () -> { + inevitable.task(TASK_ID_REFRESH_COMPLICATION, 15 * Constants.SECOND_IN_MS, () -> { if (WearUtil.isBelowRateLimit("complication-checkIfUpdateNeeded", 5)) { Log.d(TAG, "Checking if update needed"); requestUpdateIfSinceChanged(); @@ -307,7 +320,7 @@ public abstract class BaseComplicationProviderService extends ComplicationProvid * Check if displayed since field (field that shows how old, in minutes, is reading) * is up-to-date or need to be changed (a minute or more elapsed) */ - private static void requestUpdateIfSinceChanged() { + private void requestUpdateIfSinceChanged() { final Persistence persistence = new Persistence(); final RawDisplayData raw = new RawDisplayData(); @@ -342,11 +355,11 @@ public abstract class BaseComplicationProviderService extends ComplicationProvid /* * Request update for specified list of providers */ - private static void requestUpdate(Set providers) { + private void requestUpdate(Set providers) { for (String provider: providers) { Log.d(TAG, "Pending update of "+provider); // We wait with updating allowing all request, from various sources, to arrive - Inevitable.task("update-req-"+provider, 700, () -> { + inevitable.task("update-req-"+provider, 700, () -> { if (WearUtil.isBelowRateLimit("update-req-"+provider, 2)) { Log.d(TAG, "Requesting update of "+provider); final ComponentName componentName = new ComponentName(Aaps.getAppContext(), provider); @@ -395,7 +408,7 @@ public abstract class BaseComplicationProviderService extends ComplicationProvid /* * Listen to broadcast --> new data was stored by ListenerService to Persistence */ - public static class MessageReceiver extends BroadcastReceiver { + public class MessageReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { Set complications = Persistence.setOf(KEY_COMPLICATIONS); diff --git a/wear/src/main/java/info/nightscout/androidaps/complications/ComplicationTapBroadcastReceiver.java b/wear/src/main/java/info/nightscout/androidaps/complications/ComplicationTapBroadcastReceiver.java index 8e791b0fbb..9024071853 100644 --- a/wear/src/main/java/info/nightscout/androidaps/complications/ComplicationTapBroadcastReceiver.java +++ b/wear/src/main/java/info/nightscout/androidaps/complications/ComplicationTapBroadcastReceiver.java @@ -1,7 +1,6 @@ package info.nightscout.androidaps.complications; import android.app.PendingIntent; -import android.content.BroadcastReceiver; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -12,8 +11,11 @@ import android.widget.Toast; import androidx.annotation.StringRes; -import info.nightscout.androidaps.R; +import javax.inject.Inject; + +import dagger.android.DaggerBroadcastReceiver; import info.nightscout.androidaps.Aaps; +import info.nightscout.androidaps.R; import info.nightscout.androidaps.interaction.actions.BolusActivity; import info.nightscout.androidaps.interaction.actions.ECarbActivity; import info.nightscout.androidaps.interaction.actions.WizardActivity; @@ -26,7 +28,9 @@ import info.nightscout.androidaps.interaction.utils.WearUtil; /* * Created by dlvoy on 2019-11-12 */ -public class ComplicationTapBroadcastReceiver extends BroadcastReceiver { +public class ComplicationTapBroadcastReceiver extends DaggerBroadcastReceiver { + + @Inject WearUtil wearUtil; private static final String TAG = ComplicationTapBroadcastReceiver.class.getSimpleName(); @@ -41,6 +45,7 @@ public class ComplicationTapBroadcastReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { + super.onReceive(context, intent); Bundle extras = intent.getExtras(); ComponentName provider = extras.getParcelable(EXTRA_PROVIDER_COMPONENT); int complicationId = extras.getInt(EXTRA_COMPLICATION_ID); @@ -51,7 +56,7 @@ public class ComplicationTapBroadcastReceiver extends BroadcastReceiver { action = ComplicationAction.valueOf(ComplicationAction.class, complicationAction); } catch (IllegalArgumentException | NullPointerException ex) { // but how? - Log.e(TAG, "Cannot interpret complication action: "+complicationAction); + Log.e(TAG, "Cannot interpret complication action: " + complicationAction); } action = remapActionWithUserPreferences(action); @@ -67,35 +72,36 @@ public class ComplicationTapBroadcastReceiver extends BroadcastReceiver { // do nothing return; case WIZARD: - intentOpen = new Intent(Aaps.getAppContext(), WizardActivity.class); + intentOpen = new Intent(context, WizardActivity.class); break; case BOLUS: - intentOpen = new Intent(Aaps.getAppContext(), BolusActivity.class); + intentOpen = new Intent(context, BolusActivity.class); break; case ECARB: - intentOpen = new Intent(Aaps.getAppContext(), ECarbActivity.class); + intentOpen = new Intent(context, ECarbActivity.class); break; case STATUS: - intentOpen = new Intent(Aaps.getAppContext(), StatusMenuActivity.class); + intentOpen = new Intent(context, StatusMenuActivity.class); break; case WARNING_OLD: case WARNING_SYNC: - long oneAndHalfMinuteAgo = WearUtil.timestamp() - (Constants.MINUTE_IN_MS+Constants.SECOND_IN_MS * 30); + long oneAndHalfMinuteAgo = + wearUtil.timestamp() - (Constants.MINUTE_IN_MS + Constants.SECOND_IN_MS * 30); long since = extras.getLong(EXTRA_COMPLICATION_SINCE, oneAndHalfMinuteAgo); @StringRes int labelId = (action == ComplicationAction.WARNING_SYNC) ? R.string.msg_warning_sync : R.string.msg_warning_old; String msg = String.format(context.getString(labelId), DisplayFormat.shortTimeSince(since)); - Toast.makeText(Aaps.getAppContext(), msg, Toast.LENGTH_LONG).show(); + Toast.makeText(context, msg, Toast.LENGTH_LONG).show(); break; case MENU: default: - intentOpen = new Intent(Aaps.getAppContext(), MainMenuActivity.class); + intentOpen = new Intent(context, MainMenuActivity.class); } if (intentOpen != null) { // Perform intent - open dialog intentOpen.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - Aaps.getAppContext().startActivity(intentOpen); + context.startActivity(intentOpen); } } diff --git a/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java b/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java index 78803079b8..4f2751becb 100644 --- a/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java +++ b/wear/src/main/java/info/nightscout/androidaps/data/ListenerService.java @@ -38,12 +38,15 @@ import com.google.android.gms.wearable.WearableListenerService; import java.util.Set; import java.util.concurrent.TimeUnit; +import javax.inject.Inject; + +import dagger.android.AndroidInjection; import info.nightscout.androidaps.R; import info.nightscout.androidaps.interaction.AAPSPreferences; import info.nightscout.androidaps.interaction.actions.AcceptActivity; import info.nightscout.androidaps.interaction.actions.CPPActivity; import info.nightscout.androidaps.interaction.utils.Persistence; -import info.nightscout.androidaps.interaction.utils.SafeParse; +import info.nightscout.shared.SafeParse; import info.nightscout.androidaps.interaction.utils.WearUtil; @@ -53,6 +56,8 @@ import info.nightscout.androidaps.interaction.utils.WearUtil; public class ListenerService extends WearableListenerService implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener, ChannelApi.ChannelListener { + @Inject WearUtil wearUtil; + private static final String WEARABLE_DATA_PATH = "/nightscout_watch_data"; private static final String WEARABLE_RESEND_PATH = "/nightscout_watch_data_resend"; private static final String WEARABLE_CANCELBOLUS_PATH = "/nightscout_watch_cancel_bolus"; @@ -69,8 +74,8 @@ public class ListenerService extends WearableListenerService implements GoogleAp public static final String ACTION_CANCELNOTIFICATION_REQUEST_PATH = "/nightscout_watch_cancelnotificationrequest"; - public static final int BOLUS_PROGRESS_NOTIF_ID = 001; - public static final int CONFIRM_NOTIF_ID = 002; + public static final int BOLUS_PROGRESS_NOTIF_ID = 1; + public static final int CONFIRM_NOTIF_ID = 2; public static final int CHANGE_NOTIF_ID = 556677; private static final String ACTION_RESEND = "com.dexdrip.stephenblack.nightwatch.RESEND_DATA"; @@ -104,6 +109,13 @@ public class ListenerService extends WearableListenerService implements GoogleAp private String localnode = null; private final String logPrefix = ""; // "WR: " + // Not derived from DaggerService, do injection here + @Override + public void onCreate() { + AndroidInjection.inject(this); + super.onCreate(); + } + public class DataRequester extends AsyncTask { Context mContext; String path; @@ -364,7 +376,8 @@ public class ListenerService extends WearableListenerService implements GoogleAp } } - Log.d(TAG, logPrefix + "sendData: execute lastRequest:" + WearUtil.dateTimeText(lastRequest)); + Log.d(TAG, + logPrefix + "sendData: execute lastRequest:" + wearUtil.dateTimeText(lastRequest)); mDataRequester = (DataRequester) new DataRequester(this, path, payload).execute(); // executeTask(mDataRequester); diff --git a/wear/src/main/java/info/nightscout/androidaps/di/AppComponent.kt b/wear/src/main/java/info/nightscout/androidaps/di/AppComponent.kt index 83ffba9dd0..e211b615bc 100644 --- a/wear/src/main/java/info/nightscout/androidaps/di/AppComponent.kt +++ b/wear/src/main/java/info/nightscout/androidaps/di/AppComponent.kt @@ -11,7 +11,8 @@ import javax.inject.Singleton @Component( modules = [ AndroidInjectionModule::class, - WearModule::class + WearModule::class, + ServicesModule::class ] ) interface AppComponent : AndroidInjector { diff --git a/wear/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt b/wear/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt new file mode 100644 index 0000000000..838344a26c --- /dev/null +++ b/wear/src/main/java/info/nightscout/androidaps/di/ServicesModule.kt @@ -0,0 +1,14 @@ +package info.nightscout.androidaps.di + +import dagger.Module +import dagger.android.ContributesAndroidInjector +import info.nightscout.androidaps.complications.BaseComplicationProviderService +import info.nightscout.androidaps.data.ListenerService + +@Module +@Suppress("unused") +abstract class ServicesModule { + + @ContributesAndroidInjector abstract fun contributesListenerService(): ListenerService + @ContributesAndroidInjector abstract fun contributesBaseComplicationProviderService(): BaseComplicationProviderService +} \ No newline at end of file diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.java index 6faec96119..3a95b0b053 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/BolusActivity.java @@ -1,7 +1,6 @@ package info.nightscout.androidaps.interaction.actions; -import android.content.res.Resources; import android.os.Bundle; import android.support.wearable.view.DotsPageIndicator; import android.support.wearable.view.GridPagerAdapter; @@ -17,7 +16,7 @@ import java.text.DecimalFormat; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.ListenerService; import info.nightscout.androidaps.interaction.utils.PlusMinusEditText; -import info.nightscout.androidaps.interaction.utils.SafeParse; +import info.nightscout.shared.SafeParse; /** * Created by adrian on 09/02/17. diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CPPActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CPPActivity.java index 3851843b16..2eb596c177 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CPPActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/CPPActivity.java @@ -1,7 +1,6 @@ package info.nightscout.androidaps.interaction.actions; -import android.content.res.Resources; import android.os.Bundle; import android.support.wearable.view.DotsPageIndicator; import android.support.wearable.view.GridPagerAdapter; @@ -17,7 +16,7 @@ import java.text.DecimalFormat; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.ListenerService; import info.nightscout.androidaps.interaction.utils.PlusMinusEditText; -import info.nightscout.androidaps.interaction.utils.SafeParse; +import info.nightscout.shared.SafeParse; /** * Created by adrian on 09/02/17. diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.java index 1495624bac..57f61f4d94 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/ECarbActivity.java @@ -1,7 +1,6 @@ package info.nightscout.androidaps.interaction.actions; -import android.content.res.Resources; import android.os.Bundle; import android.support.wearable.view.DotsPageIndicator; import android.support.wearable.view.GridPagerAdapter; @@ -17,7 +16,7 @@ import java.text.DecimalFormat; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.ListenerService; import info.nightscout.androidaps.interaction.utils.PlusMinusEditText; -import info.nightscout.androidaps.interaction.utils.SafeParse; +import info.nightscout.shared.SafeParse; /** * Created by adrian on 04/08/18. diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.java index b141cd053a..e953f750d3 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/FillActivity.java @@ -1,7 +1,6 @@ package info.nightscout.androidaps.interaction.actions; -import android.content.res.Resources; import android.os.Bundle; import android.support.wearable.view.DotsPageIndicator; import android.support.wearable.view.GridPagerAdapter; @@ -17,7 +16,7 @@ import java.text.DecimalFormat; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.ListenerService; import info.nightscout.androidaps.interaction.utils.PlusMinusEditText; -import info.nightscout.androidaps.interaction.utils.SafeParse; +import info.nightscout.shared.SafeParse; /** * Created by adrian on 09/02/17. diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.java index 6893b0af32..bfa7d6e86c 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/TempTargetActivity.java @@ -2,7 +2,6 @@ package info.nightscout.androidaps.interaction.actions; import android.content.SharedPreferences; -import android.content.res.Resources; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.wearable.view.DotsPageIndicator; @@ -19,7 +18,7 @@ import java.text.DecimalFormat; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.ListenerService; import info.nightscout.androidaps.interaction.utils.PlusMinusEditText; -import info.nightscout.androidaps.interaction.utils.SafeParse; +import info.nightscout.shared.SafeParse; /** * Created by adrian on 09/02/17. diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.java b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.java index 80ea09f64f..8447541fcf 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/actions/WizardActivity.java @@ -2,7 +2,6 @@ package info.nightscout.androidaps.interaction.actions; import android.content.SharedPreferences; -import android.content.res.Resources; import android.os.Bundle; import android.preference.PreferenceManager; import android.support.wearable.view.DotsPageIndicator; @@ -19,7 +18,7 @@ import java.text.DecimalFormat; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.ListenerService; import info.nightscout.androidaps.interaction.utils.PlusMinusEditText; -import info.nightscout.androidaps.interaction.utils.SafeParse; +import info.nightscout.shared.SafeParse; /** * Created by adrian on 09/02/17. diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.java b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.java index 54361b6678..2e45d3d227 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/Inevitable.java @@ -5,6 +5,9 @@ import android.util.Log; import java.util.concurrent.ConcurrentHashMap; +import javax.inject.Inject; +import javax.inject.Singleton; + import info.nightscout.androidaps.BuildConfig; /** @@ -16,15 +19,20 @@ import info.nightscout.androidaps.BuildConfig; * */ +@Singleton public class Inevitable { + @Inject WearUtil wearUtil; + + @Inject Inevitable() {} + private static final String TAG = Inevitable.class.getSimpleName(); private static final int MAX_QUEUE_TIME = (int) Constants.MINUTE_IN_MS * 6; private static final boolean debug = BuildConfig.DEBUG; private static final ConcurrentHashMap tasks = new ConcurrentHashMap<>(); - public static synchronized void task(final String id, long idle_for, Runnable runnable) { + public void task(final String id, long idle_for, Runnable runnable) { if (idle_for > MAX_QUEUE_TIME) { throw new RuntimeException(id + " Requested time: " + idle_for + " beyond max queue time"); } @@ -34,14 +42,15 @@ public class Inevitable { task.extendTime(idle_for); if (debug) - Log.d(TAG, "Extending time for: " + id + " to " + WearUtil.dateTimeText(task.when)); + Log.d(TAG, "Extending time for: " + id + " to " + wearUtil.dateTimeText(task.when)); } else { // otherwise create new task if (runnable == null) return; // extension only if already exists tasks.put(id, new Task(id, idle_for, runnable)); if (debug) { - Log.d(TAG, "Creating task: " + id + " due: " + WearUtil.dateTimeText(tasks.get(id).when)); + Log.d(TAG, + "Creating task: " + id + " due: " + wearUtil.dateTimeText(tasks.get(id).when)); } // create a thread to wait and execute in background @@ -64,7 +73,7 @@ public class Inevitable { } } - public static synchronized void stackableTask(String id, long idle_for, Runnable runnable) { + public void stackableTask(String id, long idle_for, Runnable runnable) { int stack = 0; while (tasks.get(id = id + "-" + stack) != null) { stack++; diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/SafeParse.java b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/SafeParse.java deleted file mode 100644 index 81ef482194..0000000000 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/SafeParse.java +++ /dev/null @@ -1,46 +0,0 @@ -package info.nightscout.androidaps.interaction.utils; - -/** - * Created by mike on 23.06.2016. - */ -public class SafeParse { - public static Double stringToDouble(String input) { - Double result = 0d; - input = input.replace(",", "."); - try { - result = Double.parseDouble(input); - } catch (Exception e) { - } - return result; - } - - public static Integer stringToInt(String input) { - Integer result = 0; - input = input.replace(",", "."); - try { - result = Integer.parseInt(input); - } catch (Exception e) { - } - return result; - } - - public static Long stringToLong(String input) { - Long result = 0L; - input = input.replace(",", "."); - try { - result = Long.parseLong(input); - } catch (Exception e) { - } - return result; - } - - public static Float stringToFloat(String input) { - Float result = 0f; - input = input.replace(",", "."); - try { - result = Float.valueOf(input); - } catch (Exception e) { - } - return result; - } -} diff --git a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearUtil.java b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearUtil.java index 624fe60e1d..748aa484aa 100644 --- a/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearUtil.java +++ b/wear/src/main/java/info/nightscout/androidaps/interaction/utils/WearUtil.java @@ -15,6 +15,8 @@ import java.util.Map; import java.util.Set; import info.nightscout.androidaps.Aaps; + +import javax.inject.Inject; import javax.inject.Singleton; /** @@ -25,6 +27,10 @@ import javax.inject.Singleton; @Singleton public class WearUtil { + @Inject Context context; + + @Inject WearUtil() {} + private final static boolean debug_wakelocks = false; private static final Map rateLimits = new HashMap(); private static final String TAG = WearUtil.class.getName(); @@ -33,7 +39,7 @@ public class WearUtil { // Time related util methods //============================================================================================== - public static String dateTimeText(long timeInMs) { + public String dateTimeText(long timeInMs) { Date d = new Date(timeInMs); return "" + d.getDay() + "." + d.getMonth() + "." + d.getYear() + " " + d.getHours() + ":" + d.getMinutes() + ":" + d.getSeconds(); } diff --git a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java index 8368ebd5fe..3451a3393f 100644 --- a/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java +++ b/wear/src/main/java/info/nightscout/androidaps/watchfaces/Steampunk.java @@ -10,7 +10,8 @@ import android.view.animation.RotateAnimation; import info.nightscout.androidaps.R; import info.nightscout.androidaps.interaction.menus.MainMenuActivity; -import info.nightscout.androidaps.interaction.utils.SafeParse; +import info.nightscout.shared.SafeParse; + /** * Created by andrew-warrington on 01/12/2017. */ diff --git a/wear/src/test/java/info/nightscout/androidaps/testing/mockers/RawDataMocker.java b/wear/src/test/java/info/nightscout/androidaps/testing/mockers/RawDataMocker.java index 7d06f00c51..c87c5e7b38 100644 --- a/wear/src/test/java/info/nightscout/androidaps/testing/mockers/RawDataMocker.java +++ b/wear/src/test/java/info/nightscout/androidaps/testing/mockers/RawDataMocker.java @@ -1,7 +1,7 @@ package info.nightscout.androidaps.testing.mockers; import info.nightscout.androidaps.data.RawDisplayData; -import info.nightscout.androidaps.interaction.utils.SafeParse; +import info.nightscout.shared.SafeParse; import static info.nightscout.androidaps.testing.mockers.WearUtilMocker.backInTime; From 29559c0413b6f56967222ccde34bfd3dc2d5e449 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 10 Dec 2021 12:17:03 +0100 Subject: [PATCH 2/3] move SP to shared module --- .../nightscout/androidaps/MainActivity.kt | 2 +- .../info/nightscout/androidaps/MainApp.kt | 2 +- .../activities/HistoryBrowseActivity.kt | 2 +- .../activities/MyPreferenceFragment.kt | 2 +- .../fragments/TreatmentsBolusCarbsFragment.kt | 3 +- .../fragments/TreatmentsCareportalFragment.kt | 2 +- .../TreatmentsProfileSwitchFragment.kt | 2 +- .../fragments/TreatmentsTempTargetFragment.kt | 2 +- .../dependencyInjection/AppModule.kt | 2 +- .../androidaps/dialogs/LoopDialog.kt | 2 +- .../androidaps/dialogs/TreatmentDialog.kt | 1 - .../androidaps/dialogs/WizardDialog.kt | 2 +- .../plugins/aps/loop/LoopFragment.kt | 2 +- .../androidaps/plugins/aps/loop/LoopPlugin.kt | 2 +- .../openAPSAMA/DetermineBasalAdapterAMAJS.kt | 2 +- .../openAPSSMB/DetermineBasalAdapterSMBJS.kt | 2 +- .../aps/openAPSSMB/OpenAPSSMBPlugin.kt | 2 +- .../configBuilder/ConfigBuilderPlugin.kt | 2 +- .../ProfileFunctionImplementation.kt | 3 +- .../constraints/dstHelper/DstHelperPlugin.kt | 2 +- .../objectives/ObjectivesFragment.kt | 3 +- .../objectives/ObjectivesPlugin.kt | 2 +- .../objectives/objectives/Objective.kt | 2 +- .../constraints/safety/SafetyPlugin.kt | 2 +- .../SignatureVerifierPlugin.kt | 2 +- .../storage/StorageConstraintPlugin.kt | 1 - .../versionChecker/VersionCheckerPlugin.kt | 2 +- .../general/actions/ActionsFragment.kt | 2 +- .../plugins/general/food/FoodPlugin.kt | 2 +- .../maintenance/ImportExportPrefsImpl.kt | 2 +- .../general/maintenance/MaintenancePlugin.kt | 2 +- .../DataSyncSelectorImplementation.kt | 2 +- .../general/nsclient/NSClientAddAckWorker.kt | 2 +- .../nsclient/NSClientAddUpdateWorker.kt | 2 +- .../general/nsclient/NSClientFragment.kt | 2 +- .../general/nsclient/NSClientMbgWorker.kt | 2 +- .../general/nsclient/NSClientPlugin.kt | 2 +- .../nsclient/NsClientReceiverDelegate.kt | 2 +- .../general/nsclient/data/NSDeviceStatus.kt | 2 +- .../general/nsclient/data/NSSettingsStatus.kt | 2 +- .../nsclient/services/NSClientService.kt | 2 +- .../plugins/general/overview/OverviewData.kt | 2 +- .../general/overview/OverviewFragment.kt | 2 +- .../plugins/general/overview/OverviewMenus.kt | 2 +- .../general/overview/OverviewPlugin.kt | 2 +- .../general/overview/StatusLightHandler.kt | 8 ++-- .../notifications/NotificationStore.kt | 2 +- .../notifications/NotificationWithAction.kt | 2 +- .../PersistentNotificationPlugin.kt | 1 - .../smsCommunicator/SmsCommunicatorPlugin.kt | 2 +- .../smsCommunicator/otp/OneTimePassword.kt | 2 +- .../general/tidepool/TidepoolFragment.kt | 2 +- .../general/tidepool/TidepoolPlugin.kt | 2 +- .../general/tidepool/comm/TidepoolUploader.kt | 2 +- .../general/tidepool/comm/UploadChunk.kt | 2 +- .../tidepool/messages/AuthRequestMessage.kt | 2 +- .../general/wear/ActionStringHandler.kt | 2 +- .../plugins/general/wear/WearPlugin.kt | 2 +- .../wearintegration/WatchUpdaterService.java | 2 +- .../xdripStatusline/StatusLinePlugin.kt | 2 +- .../insulin/InsulinOrefFreePeakPlugin.kt | 2 +- .../IobCobCalculatorPlugin.kt | 2 +- .../iob/iobCobCalculator/IobCobOref1Thread.kt | 2 +- .../iob/iobCobCalculator/IobCobThread.kt | 2 +- .../profile/local/LocalProfilePlugin.kt | 2 +- .../plugins/pump/virtual/VirtualPumpPlugin.kt | 2 +- .../sensitivity/AbstractSensitivityPlugin.kt | 2 +- .../sensitivity/SensitivityAAPSPlugin.kt | 2 +- .../sensitivity/SensitivityOref1Plugin.kt | 2 +- .../SensitivityWeightedAveragePlugin.kt | 2 +- .../androidaps/plugins/source/DexcomPlugin.kt | 2 +- .../plugins/source/EversensePlugin.kt | 2 +- .../androidaps/plugins/source/GlimpPlugin.kt | 2 +- .../plugins/source/GlunovoPlugin.kt | 2 +- .../androidaps/plugins/source/MM640gPlugin.kt | 2 +- .../plugins/source/NSClientSourcePlugin.kt | 2 +- .../plugins/source/PoctechPlugin.kt | 2 +- .../plugins/source/RandomBgPlugin.kt | 2 +- .../androidaps/plugins/source/TomatoPlugin.kt | 2 +- .../queue/CommandQueueImplementation.kt | 2 +- .../androidaps/queue/QueueThread.kt | 2 +- .../androidaps/setupwizard/SWDefinition.kt | 2 +- .../setupwizard/SetupWizardActivity.kt | 2 +- .../androidaps/setupwizard/elements/SWItem.kt | 2 +- .../androidaps/skins/SkinProvider.kt | 2 +- .../androidaps/utils/ActivityMonitor.kt | 2 +- .../androidaps/utils/AndroidPermission.kt | 1 - .../androidaps/utils/LocalAlertUtils.kt | 2 +- .../androidaps/utils/XDripBroadcast.kt | 2 +- .../androidaps/utils/wizard/BolusWizard.kt | 2 +- .../androidaps/utils/wizard/QuickWizard.kt | 2 +- .../utils/wizard/QuickWizardEntry.kt | 2 +- .../androidaps/data/QuickWizardTest.kt | 2 +- .../interfaces/ConstraintsCheckerTest.kt | 2 +- .../plugins/aps/loop/LoopPluginTest.kt | 2 +- .../configBuilder/ConfigBuilderPluginTest.kt | 2 +- .../dstHelper/DstHelperPluginTest.kt | 2 +- .../objectives/ObjectivesPluginTest.kt | 2 +- .../constraints/safety/SafetyPluginTest.kt | 2 +- .../SignatureVerifierPluginTest.kt | 2 +- .../maintenance/MaintenancePluginTest.kt | 2 +- .../nsclient/NsClientReceiverDelegateTest.kt | 2 +- .../SmsCommunicatorPluginTest.kt | 2 +- .../insulin/InsulinOrefFreePeakPluginTest.kt | 2 +- .../pump/virtual/VirtualPumpPluginUTest.kt | 2 +- .../AbstractSensitivityPluginTest.kt | 2 +- .../plugins/source/GlimpPluginTest.kt | 2 +- .../plugins/source/MM640GPluginTest.kt | 2 +- .../plugins/source/NSClientPluginTest.kt | 2 +- .../treatments/TreatmentsPluginTest.kt | 2 +- .../queue/CommandQueueImplementationTest.kt | 2 +- .../androidaps/queue/QueueThreadTest.kt | 2 +- automation/build.gradle | 1 + .../general/automation/AutomationPlugin.kt | 2 +- .../actions/ActionCarePortalEvent.kt | 2 +- .../general/automation/triggers/Trigger.kt | 2 +- .../androidaps/services/LocationService.kt | 2 +- .../automation/actions/ActionsTestBase.kt | 2 +- .../automation/triggers/TriggerTestBase.kt | 2 +- combo/build.gradle | 1 + .../plugins/pump/combo/ComboFragment.java | 2 - .../plugins/pump/combo/ComboPlugin.java | 2 +- .../plugins/pump/combo/ComboPluginTest.kt | 2 +- .../DaggerAppCompatActivityWithResult.kt | 4 +- .../activities/ErrorHelperActivity.kt | 2 +- .../androidaps/activities/TDDStatsActivity.kt | 2 +- .../nightscout/androidaps/di/CoreModule.kt | 6 +-- .../dialogs/DialogFragmentWithDate.kt | 2 +- .../androidaps/extensions/JSONObjectExt.kt | 2 +- .../info/nightscout/androidaps/logging/L.kt | 2 +- .../androidaps/plugins/aps/loop/APSResult.kt | 2 +- .../configBuilder/RunningConfiguration.kt | 2 +- .../versionChecker/VersionCheckerUtils.kt | 2 +- .../iob/iobCobCalculator/data/AutosensData.kt | 2 +- .../plugins/pump/PumpSyncImplementation.kt | 2 +- .../androidaps/services/AlarmSoundService.kt | 2 +- .../androidaps/utils/DefaultValueHelper.kt | 2 +- .../androidaps/utils/FabricPrivacy.kt | 2 +- .../nightscout/androidaps/utils/HardLimits.kt | 2 +- .../utils/protection/PasswordCheck.kt | 2 +- .../utils/protection/ProtectionCheck.kt | 2 +- core/src/main/res/values/layout.xml | 2 - .../nightscout/androidaps/data/ProfileTest.kt | 2 +- .../plugins/aps/loop/APSResultTest.kt | 2 +- .../VersionCheckerUtilsKtTest.kt | 2 +- .../formats/EncryptedPrefsFormatTest.kt | 2 +- dana/build.gradle | 1 + .../androidaps/dana/DanaFragment.kt | 2 +- .../nightscout/androidaps/dana/DanaPump.kt | 2 +- .../androidaps/dana/DanaPumpTest.kt | 2 +- danar/build.gradle | 1 + .../danaRKorean/DanaRKoreanPlugin.kt | 2 +- .../androidaps/danaRv2/DanaRv2Plugin.java | 2 +- .../services/DanaRv2ExecutionService.java | 2 +- .../androidaps/danar/AbstractDanaRPlugin.java | 2 +- .../androidaps/danar/DanaRPlugin.java | 2 +- .../AbstractDanaRExecutionService.java | 2 +- .../danar/services/DanaRExecutionService.java | 2 +- .../plugins/pump/danaR/DanaRPluginTest.kt | 2 +- .../plugins/pump/danaR/comm/DanaRTestBase.kt | 2 +- .../pump/danaRKorean/DanaRKoreanPluginTest.kt | 2 +- .../plugins/pump/danaRv2/DanaRv2PluginTest.kt | 2 +- danars/build.gradle | 1 + .../androidaps/danars/DanaRSPlugin.kt | 2 +- .../danars/activities/BLEScanActivity.kt | 2 +- .../danars/activities/EnterPinActivity.kt | 2 +- .../comm/DanaRSPacketAPSHistoryEvents.kt | 2 +- .../androidaps/danars/services/BLEComm.kt | 2 +- .../danars/services/DanaRSService.kt | 2 +- .../androidaps/danars/DanaRSTestBase.kt | 2 +- diaconn/build.gradle | 1 + .../androidaps/diaconn/DiaconnG8Fragment.kt | 2 +- .../androidaps/diaconn/DiaconnG8Plugin.kt | 2 +- .../activities/DiaconnG8BLEScanActivity.kt | 2 +- .../DiaconnG8UserOptionsActivity.kt | 2 +- .../packet/BasalLimitInquireResponsePacket.kt | 2 +- .../BigAPSMainInfoInquireResponsePacket.kt | 2 +- .../packet/BigLogInquireResponsePacket.kt | 2 +- .../BigMainInfoInquireResponsePacket.kt | 2 +- .../packet/BolusSpeedInquireResponsePacket.kt | 2 +- .../packet/BolusSpeedSettingReportPacket.kt | 2 +- .../IncarnationInquireResponsePacket.kt | 2 +- .../diaconn/service/DiaconnG8Service.kt | 2 +- insight/build.gradle | 1 + .../pump/insight/LocalInsightPlugin.java | 2 +- .../InsightConnectionService.java | 2 +- medtronic/build.gradle | 1 + .../pump/medtronic/MedtronicPumpPlugin.kt | 2 +- .../medtronic/data/MedtronicHistoryData.kt | 2 +- .../medtronic/driver/MedtronicPumpStatus.kt | 2 +- .../pump/MedtronicPumpHistoryDecoderUTest.kt | 2 +- .../data/MedtronicHistoryDataUTest.kt | 2 +- omnipod-dash/build.gradle | 1 + .../omnipod/dash/OmnipodDashPumpPlugin.kt | 2 +- .../state/OmnipodDashPodStateManagerImpl.kt | 2 +- .../dash/ui/OmnipodDashOverviewFragment.kt | 2 +- .../action/DashInitializePodViewModel.kt | 2 +- .../action/DashInsertCannulaViewModel.kt | 2 +- omnipod-eros/build.gradle | 1 + .../omnipod/eros/OmnipodErosPumpPlugin.java | 2 +- .../eros/manager/AapsErosPodStateManager.java | 2 +- .../eros/manager/AapsOmnipodErosManager.java | 2 +- .../eros/ui/OmnipodErosOverviewFragment.kt | 2 +- .../omnipod/eros/util/OmnipodAlertUtil.java | 2 +- .../manager/AapsErosPodStateManagerTest.kt | 2 +- openhumans/build.gradle | 1 + .../general/openhumans/OpenHumansUploader.kt | 2 +- .../openhumans/delegates/OHAppIDDelegate.kt | 2 +- .../openhumans/delegates/OHCounterDelegate.kt | 2 +- .../openhumans/delegates/OHStateDelegate.kt | 2 +- pump-common/build.gradle | 1 + .../plugins/pump/common/PumpPluginAbstract.kt | 2 +- .../pump/common/di/PumpCommonModule.kt | 2 +- .../pump/common/sync/PumpSyncStorage.kt | 2 +- rileylink/build.gradle | 1 + .../dialog/RileyLinkBLEConfigActivity.java | 2 +- .../RileyLinkCommunicationManager.java | 2 +- .../pump/common/hw/rileylink/ble/RFSpy.java | 2 +- .../common/hw/rileylink/ble/RileyLinkBLE.java | 2 +- .../hw/rileylink/ble/device/OrangeLinkImpl.kt | 2 +- .../RileyLinkStatusGeneralFragment.java | 2 +- .../service/RileyLinkBroadcastReceiver.java | 2 +- .../rileylink/service/RileyLinkService.java | 2 +- .../tasks/InitializePumpManagerTask.java | 2 +- shared/build.gradle | 8 ++++ .../shared}/sharedPreferences/SP.kt | 2 +- .../sharedPreferences/SPImplementation.kt | 44 +++++++++---------- .../src/main/res/values-sw600dp/layout.xml | 0 shared/src/main/res/values/layout.xml | 3 ++ .../info/nightscout/shared/SafeParseTest.kt | 18 ++++---- 230 files changed, 266 insertions(+), 255 deletions(-) rename {core/src/main/java/info/nightscout/androidaps/utils => shared/src/main/java/info/nightscout/shared}/sharedPreferences/SP.kt (96%) rename {core/src/main/java/info/nightscout/androidaps/utils => shared/src/main/java/info/nightscout/shared}/sharedPreferences/SPImplementation.kt (71%) rename {core => shared}/src/main/res/values-sw600dp/layout.xml (100%) create mode 100644 shared/src/main/res/values/layout.xml diff --git a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt index fb5a073adf..cf72c44e58 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainActivity.kt @@ -53,7 +53,7 @@ import info.nightscout.androidaps.utils.extensions.isRunningRealPumpTest import info.nightscout.androidaps.utils.locale.LocaleHelper import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.tabs.TabPageAdapter import info.nightscout.androidaps.utils.ui.UIRunnable import io.reactivex.disposables.CompositeDisposable diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.kt b/app/src/main/java/info/nightscout/androidaps/MainApp.kt index 043cc10b06..1298a7f70b 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.kt +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.kt @@ -38,7 +38,7 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.locale.LocaleHelper import info.nightscout.androidaps.utils.protection.PasswordCheck -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.exceptions.UndeliverableException import io.reactivex.plugins.RxJavaPlugins 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 2a2bf5e03d..e71eb17302 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/HistoryBrowseActivity.kt @@ -38,7 +38,7 @@ import info.nightscout.androidaps.plugins.sensitivity.SensitivityWeightedAverage import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import java.util.* diff --git a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt index 3a879c0f1a..62435f5d19 100644 --- a/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/activities/MyPreferenceFragment.kt @@ -54,7 +54,7 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog.show import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.protection.ProtectionCheck import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject class MyPreferenceFragment : PreferenceFragmentCompat(), OnSharedPreferenceChangeListener { 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 b6a1af7745..f2fa8ff6b6 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 @@ -43,14 +43,13 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +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 java.util.concurrent.TimeUnit import javax.inject.Inject -import kotlin.math.abs class TreatmentsBolusCarbsFragment : DaggerFragment() { 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 9c6b08ddf3..5118ee9864 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 @@ -35,7 +35,7 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.Completable import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign 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 266cf3d12c..0e4174386b 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 @@ -39,7 +39,7 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.Completable import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign 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 067b349049..cb926b51fd 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 @@ -42,7 +42,7 @@ import info.nightscout.androidaps.extensions.lowValueToUnitsToString import info.nightscout.androidaps.extensions.toVisibility import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.Completable import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign diff --git a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt index 95f18111f8..b9e47df7cd 100644 --- a/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt +++ b/app/src/main/java/info/nightscout/androidaps/dependencyInjection/AppModule.kt @@ -34,9 +34,9 @@ import info.nightscout.androidaps.utils.resources.IconsProviderImplementation import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers import info.nightscout.androidaps.utils.rx.DefaultAapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP import info.nightscout.androidaps.utils.storage.FileStorage import info.nightscout.androidaps.utils.storage.Storage +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Singleton @Suppress("unused") 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 af5f3d3742..a2736b6f51 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/LoopDialog.kt @@ -39,7 +39,7 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import javax.inject.Inject 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 3769e1b245..dfc224f064 100644 --- a/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt +++ b/app/src/main/java/info/nightscout/androidaps/dialogs/TreatmentDialog.kt @@ -1,7 +1,6 @@ package info.nightscout.androidaps.dialogs import android.content.Context -import android.opengl.Visibility import android.os.Bundle import android.text.Editable import android.text.TextWatcher 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 c7dda7d515..8d15dab3f0 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.extensions.valueToUnits import info.nightscout.androidaps.interfaces.* import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.wizard.BolusWizard import io.reactivex.disposables.CompositeDisposable import java.text.DecimalFormat 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 eb55ddadb0..c8ecc0182c 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 @@ -18,7 +18,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import javax.inject.Inject 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 394cf145d5..1aa08b8182 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 @@ -58,7 +58,7 @@ import info.nightscout.androidaps.extensions.plannedRemainingMinutes 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.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt index 5eb53e3e46..022195f343 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSAMA/DetermineBasalAdapterAMAJS.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.plugins.aps.loop.ScriptReader import info.nightscout.androidaps.plugins.aps.openAPSSMB.SMBDefaults import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt index cf8871b924..44aee7385d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/DetermineBasalAdapterSMBJS.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.plugins.configBuilder.ConstraintChecker import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatus import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt index d611899969..602d28a9d6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMB/OpenAPSSMBPlugin.kt @@ -24,7 +24,7 @@ import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler import info.nightscout.androidaps.utils.Round import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt index a6190167bd..a36af95c88 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPlugin.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.configBuilder.events.EventConfigBuilderUpdateGui import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import javax.inject.Singleton 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 05afc2fd86..f2a9b69a16 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 @@ -21,10 +21,9 @@ import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign -import java.security.spec.InvalidParameterSpecException import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/dstHelper/DstHelperPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/dstHelper/DstHelperPlugin.kt index 7880a30ac4..f0315a0355 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/dstHelper/DstHelperPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/dstHelper/DstHelperPlugin.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.general.overview.notifications.Notific import info.nightscout.androidaps.plugins.general.overview.notifications.NotificationWithAction import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import javax.inject.Singleton 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 a982a3a6ff..42b6893869 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 @@ -4,7 +4,6 @@ import android.graphics.Color import android.os.Bundle import android.os.Handler import android.os.HandlerThread -import android.os.Looper import android.os.SystemClock import android.view.Gravity import android.view.LayoutInflater @@ -41,7 +40,7 @@ import info.nightscout.androidaps.utils.alertDialogs.OKDialog import io.reactivex.rxkotlin.plusAssign import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt index fb14354044..c8e172a62d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPlugin.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.plugins.constraints.objectives.objectives.* import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.kt index 2c5731bef4..0da7daa37c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/objectives/objectives/Objective.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import kotlin.math.floor diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt index 8e55ff8de9..db39fd254e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPlugin.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Round import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt index 2fedf66fd5..0814885a67 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPlugin.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.general.overview.notifications.Notification import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.spongycastle.util.encoders.Hex import java.io.* import java.net.URL diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/storage/StorageConstraintPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/storage/StorageConstraintPlugin.kt index 003310eb07..a7c3ca406a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/storage/StorageConstraintPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/storage/StorageConstraintPlugin.kt @@ -14,7 +14,6 @@ import info.nightscout.androidaps.interfaces.PluginType import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.bus.RxBus -import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification import info.nightscout.androidaps.plugins.general.overview.notifications.Notification import info.nightscout.androidaps.utils.resources.ResourceHelper diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerPlugin.kt index d3834719f8..908f87842e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerPlugin.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.general.overview.notifications.Notific import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.extensions.daysToMillis import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.concurrent.TimeUnit import javax.inject.Inject import javax.inject.Singleton 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 0b75cebd8f..e2c2719d64 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 @@ -46,7 +46,7 @@ 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 info.nightscout.androidaps.utils.sharedPreferences.SP +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodPlugin.kt index 79eeb7dab7..2f60f37d93 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/food/FoodPlugin.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.receivers.DataWorker import info.nightscout.androidaps.utils.JsonHelper import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt index be4eba7ac2..6cd90d1a73 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/ImportExportPrefsImpl.kt @@ -41,7 +41,7 @@ import info.nightscout.androidaps.utils.alertDialogs.WarningDialog import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.storage.Storage import info.nightscout.androidaps.utils.userEntry.UserEntryPresentationHelper import java.io.File diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePlugin.kt index 2437ff645a..31cc4d0f97 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePlugin.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.io.* import java.util.* import java.util.zip.ZipEntry diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/DataSyncSelectorImplementation.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/DataSyncSelectorImplementation.kt index 9b575d484b..09fc618546 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/DataSyncSelectorImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/DataSyncSelectorImplementation.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.profile.local.LocalProfilePlugin import info.nightscout.androidaps.utils.DateUtil -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddAckWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddAckWorker.kt index 1bfbd3e4e2..9f92fddbfa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddAckWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddAckWorker.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.plugins.general.nsclient.acks.NSAddAck import info.nightscout.androidaps.plugins.general.nsclient.events.EventNSClientNewLog import info.nightscout.androidaps.receivers.DataWorker import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject class NSClientAddAckWorker( diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt index 7fb2a22a5c..3f56fda609 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientAddUpdateWorker.kt @@ -28,7 +28,7 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.JsonHelper import info.nightscout.androidaps.utils.JsonHelper.safeGetLong import info.nightscout.androidaps.utils.buildHelper.BuildHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.concurrent.TimeUnit import javax.inject.Inject 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 c63d153c7b..6ccf6efdfc 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 @@ -20,7 +20,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientMbgWorker.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientMbgWorker.kt index 0d4a16f335..538a9ab2c9 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientMbgWorker.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NSClientMbgWorker.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.plugins.general.nsclient.data.NSMbg import info.nightscout.androidaps.receivers.DataWorker import info.nightscout.androidaps.utils.buildHelper.BuildHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject class NSClientMbgWorker( 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 e1e3b08af9..2f4042c290 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 @@ -37,7 +37,7 @@ import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegate.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegate.kt index dadb14687c..9415489c78 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegate.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegate.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.events.EventPreferenceChange import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSDeviceStatus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSDeviceStatus.kt index 5352f7f463..9b7284ca20 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSDeviceStatus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSDeviceStatus.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.utils.JsonHelper import info.nightscout.androidaps.utils.Round import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSSettingsStatus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSSettingsStatus.kt index 3f66d4d7f6..22023d494d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSSettingsStatus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/nsclient/data/NSSettingsStatus.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.JsonHelper import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject import javax.inject.Inject 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 d1af9971a4..2717bd4d20 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 @@ -48,7 +48,7 @@ import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.socket.client.IO import io.socket.client.Socket diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt index 1d1d41b1cb..303f13f026 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewData.kt @@ -26,7 +26,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.CobInfo import info.nightscout.androidaps.plugins.iob.iobCobCalculator.data.AutosensData import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import javax.inject.Singleton 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 8f5cadc882..e997068791 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 @@ -72,7 +72,7 @@ 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 info.nightscout.androidaps.utils.sharedPreferences.SP +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 diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt index fcf110da98..8a7861ca25 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton 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 d44ef07cdf..9a2637b35f 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 @@ -23,7 +23,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 info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import org.json.JSONObject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt index 8fe3863db2..8338645de3 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/StatusLightHandler.kt @@ -3,21 +3,21 @@ package info.nightscout.androidaps.plugins.general.overview import android.graphics.Color import android.widget.TextView import androidx.annotation.StringRes -import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.ValueWrapper import info.nightscout.androidaps.database.entities.TherapyEvent +import info.nightscout.androidaps.extensions.age import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.plugins.pump.omnipod.eros.OmnipodErosPumpPlugin import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.OmnipodConstants +import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.WarnColors -import info.nightscout.androidaps.extensions.age -import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt index df65d1209d..1710073f47 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationStore.kt @@ -23,7 +23,7 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventUpdateOve import info.nightscout.androidaps.services.AlarmSoundServiceHelper import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt index 075308ec44..7fd641201f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/notifications/NotificationWithAction.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.plugins.general.nsclient.data.NSAlarm import info.nightscout.androidaps.utils.DefaultValueHelper import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject @Suppress("SpellCheckingInspection") 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 6d2b6cc4a2..33e60c8568 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 @@ -1,6 +1,5 @@ package info.nightscout.androidaps.plugins.general.persistentNotification -import android.app.NotificationChannel import android.app.NotificationManager import android.app.PendingIntent import android.content.Context 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 f071fe389d..1f1c5deb6d 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 @@ -45,7 +45,7 @@ import info.nightscout.androidaps.receivers.DataWorker import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.textValidator.ValidatingEditTextPreference import info.nightscout.shared.SafeParse import io.reactivex.disposables.CompositeDisposable diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/otp/OneTimePassword.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/otp/OneTimePassword.kt index 2e73121ce7..9a8034ac00 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/otp/OneTimePassword.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/smsCommunicator/otp/OneTimePassword.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.net.URLEncoder import javax.crypto.KeyGenerator import javax.crypto.SecretKey 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 5f35b21487..1daf65abc4 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 @@ -16,7 +16,7 @@ import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolU import info.nightscout.androidaps.utils.FabricPrivacy import io.reactivex.rxkotlin.plusAssign import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import javax.inject.Inject 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 9c4a64c25e..68769831af 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 @@ -33,7 +33,7 @@ import info.nightscout.androidaps.utils.ToastUtils import io.reactivex.rxkotlin.plusAssign import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import java.util.* import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolUploader.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolUploader.kt index 8518637177..6351461cec 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolUploader.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/TidepoolUploader.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.utils.DateUtil 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.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import okhttp3.MediaType.Companion.toMediaTypeOrNull import okhttp3.OkHttpClient import okhttp3.RequestBody.Companion.toRequestBody diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/UploadChunk.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/UploadChunk.kt index 14cfcd282f..0a798ce0e4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/UploadChunk.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/comm/UploadChunk.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.plugins.general.tidepool.events.EventTidepoolS import info.nightscout.androidaps.plugins.general.tidepool.utils.GsonInstance import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/AuthRequestMessage.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/AuthRequestMessage.kt index 7b5d8a679d..ff37f00226 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/AuthRequestMessage.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/tidepool/messages/AuthRequestMessage.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.plugins.general.tidepool.messages import info.nightscout.androidaps.R import info.nightscout.androidaps.utils.StringUtils -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import okhttp3.Credentials class AuthRequestMessage : BaseMessage() { 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 ec15d0ef48..434662b980 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 @@ -37,7 +37,7 @@ import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.wizard.BolusWizard import info.nightscout.shared.SafeParse import io.reactivex.disposables.CompositeDisposable 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 3ae44c8ebb..2f2b4c5749 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 @@ -19,7 +19,7 @@ import info.nightscout.androidaps.plugins.general.wear.wearintegration.WatchUpda import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/WatchUpdaterService.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/WatchUpdaterService.java index af401aa92a..8c47acb4d0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/WatchUpdaterService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/wear/wearintegration/WatchUpdaterService.java @@ -62,7 +62,7 @@ import info.nightscout.androidaps.utils.DecimalFormatter; import info.nightscout.androidaps.utils.DefaultValueHelper; import info.nightscout.androidaps.utils.TrendCalculator; import info.nightscout.androidaps.utils.resources.ResourceHelper; -import info.nightscout.androidaps.utils.sharedPreferences.SP; +import info.nightscout.shared.sharedPreferences.SP; public class WatchUpdaterService extends WearableListenerService implements GoogleApiClient.ConnectionCallbacks, GoogleApiClient.OnConnectionFailedListener { @Inject public GlucoseStatusProvider glucoseStatusProvider; 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 2f7ad1fe31..c0566c0e6e 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 @@ -14,7 +14,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 info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt index 60647d165e..643d6916ea 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPlugin.kt @@ -10,7 +10,7 @@ import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject 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 ab304ade34..45154bbb2d 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 @@ -33,7 +33,7 @@ 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 info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import org.json.JSONArray diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Thread.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Thread.kt index 92a8480e9c..189b1d5157 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Thread.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobOref1Thread.kt @@ -30,7 +30,7 @@ import info.nightscout.androidaps.utils.Profiler import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import kotlin.math.abs diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobThread.kt b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobThread.kt index 0fb83bd837..6dd6c0cfa0 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobThread.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/IobCobThread.kt @@ -28,7 +28,7 @@ import info.nightscout.androidaps.utils.Profiler import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import kotlin.math.abs diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfilePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfilePlugin.kt index 642bc9587d..473e72b690 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfilePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/profile/local/LocalProfilePlugin.kt @@ -26,7 +26,7 @@ import info.nightscout.androidaps.receivers.DataWorker import info.nightscout.androidaps.utils.* import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import org.json.JSONObject 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 d347844d5c..b241e4ea0e 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 @@ -27,7 +27,7 @@ import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.TimeChangeType import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import org.json.JSONException diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt index 978305970c..5b05bdd7fa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPlugin.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.Round import info.nightscout.shared.SafeParse import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import kotlin.math.max import kotlin.math.min diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt index e382ed36eb..c453e5eae7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityAAPSPlugin.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject import java.util.* diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt index 56b6770796..4395c195bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityOref1Plugin.kt @@ -21,7 +21,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject import java.util.* diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt index 4be4c1eacb..bfd01be256 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/sensitivity/SensitivityWeightedAveragePlugin.kt @@ -20,7 +20,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/DexcomPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/DexcomPlugin.kt index 0d8d6893f9..ebcf1d7bd2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/DexcomPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/DexcomPlugin.kt @@ -27,7 +27,7 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/EversensePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/EversensePlugin.kt index e1f464f7f3..8f48484838 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/EversensePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/EversensePlugin.kt @@ -21,7 +21,7 @@ import info.nightscout.androidaps.receivers.DataWorker import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/GlimpPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/GlimpPlugin.kt index d23831a413..f1fd816845 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/GlimpPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/GlimpPlugin.kt @@ -18,7 +18,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton 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 1dca40f24c..537828e0c1 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 @@ -25,7 +25,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/MM640gPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/MM640gPlugin.kt index 63da6b8761..83a362276f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/MM640gPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/MM640gPlugin.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.receivers.DataWorker import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt index 0069586498..c645b669ab 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/NSClientSourcePlugin.kt @@ -26,7 +26,7 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/PoctechPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/PoctechPlugin.kt index f6442181fb..75581ee8df 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/PoctechPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/PoctechPlugin.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.utils.JsonHelper.safeGetString import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import javax.inject.Inject 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 d0e0f08ff0..6261e02cfe 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 @@ -17,7 +17,7 @@ import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import java.util.* diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/source/TomatoPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/source/TomatoPlugin.kt index fd0eeb48dc..bb63ae43bb 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/source/TomatoPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/source/TomatoPlugin.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.utils.XDripBroadcast import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP 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 29eb916b3c..527a996c00 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt +++ b/app/src/main/java/info/nightscout/androidaps/queue/CommandQueueImplementation.kt @@ -39,7 +39,7 @@ import info.nightscout.androidaps.utils.HtmlHelper import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import io.reactivex.rxkotlin.subscribeBy diff --git a/app/src/main/java/info/nightscout/androidaps/queue/QueueThread.kt b/app/src/main/java/info/nightscout/androidaps/queue/QueueThread.kt index aec3c01ea0..b3b2be4695 100644 --- a/app/src/main/java/info/nightscout/androidaps/queue/QueueThread.kt +++ b/app/src/main/java/info/nightscout/androidaps/queue/QueueThread.kt @@ -16,7 +16,7 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventDismissBo import info.nightscout.androidaps.queue.events.EventQueueChanged import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP class QueueThread internal constructor( private val queue: CommandQueue, diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt index 96e757bc3e..aad9ac4d0b 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SWDefinition.kt @@ -31,7 +31,7 @@ import info.nightscout.androidaps.utils.CryptoUtil import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.extensions.isRunningTest import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import javax.inject.Singleton 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 2239207183..eef7197a7b 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/SetupWizardActivity.kt @@ -23,7 +23,7 @@ import info.nightscout.androidaps.utils.FabricPrivacy 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.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import javax.inject.Inject import kotlin.math.max diff --git a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWItem.kt b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWItem.kt index f2d7a42aff..f41d29b056 100644 --- a/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWItem.kt +++ b/app/src/main/java/info/nightscout/androidaps/setupwizard/elements/SWItem.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.setupwizard.events.EventSWUpdate import info.nightscout.androidaps.utils.protection.PasswordCheck import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.concurrent.Executors import java.util.concurrent.ScheduledFuture import java.util.concurrent.TimeUnit diff --git a/app/src/main/java/info/nightscout/androidaps/skins/SkinProvider.kt b/app/src/main/java/info/nightscout/androidaps/skins/SkinProvider.kt index 5ea6a97501..33ff64b9fe 100644 --- a/app/src/main/java/info/nightscout/androidaps/skins/SkinProvider.kt +++ b/app/src/main/java/info/nightscout/androidaps/skins/SkinProvider.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.skins import info.nightscout.androidaps.R import info.nightscout.androidaps.dependencyInjection.SkinsModule -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import okhttp3.internal.toImmutableMap import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt b/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt index 02b2264278..98fbdec104 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/ActivityMonitor.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.SafeParse import javax.inject.Inject import javax.inject.Singleton diff --git a/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.kt b/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.kt index 90f9af31c1..c5bcba42a8 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.kt @@ -15,7 +15,6 @@ import androidx.fragment.app.FragmentActivity import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R import info.nightscout.androidaps.activities.DaggerAppCompatActivityWithResult -import info.nightscout.androidaps.interfaces.PluginType import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.general.overview.events.EventDismissNotification import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification 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 1e8cf7d3b4..89df0bf34b 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/LocalAlertUtils.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/LocalAlertUtils.kt @@ -21,7 +21,7 @@ import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotifi import info.nightscout.androidaps.plugins.general.overview.notifications.Notification import info.nightscout.androidaps.plugins.general.smsCommunicator.SmsCommunicatorPlugin import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/utils/XDripBroadcast.kt b/app/src/main/java/info/nightscout/androidaps/utils/XDripBroadcast.kt index 3aa0436d1f..6e8982f918 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/XDripBroadcast.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/XDripBroadcast.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.services.Intents import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONException import org.json.JSONObject 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 74950918f5..f6b83fc5f6 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 @@ -30,7 +30,7 @@ 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 info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import java.util.* diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizard.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizard.kt index 928e01ecd7..a254831690 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizard.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizard.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.utils.wizard import dagger.android.HasAndroidInjector import info.nightscout.androidaps.R -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONArray import org.json.JSONObject import javax.inject.Inject diff --git a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt index e0d88db22d..c4858d3f9a 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/wizard/QuickWizardEntry.kt @@ -16,7 +16,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.JsonHelper.safeGetInt import info.nightscout.androidaps.utils.JsonHelper.safeGetString -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt b/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt index 5299f9ab21..08d00db6eb 100644 --- a/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/data/QuickWizardTest.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.R import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import info.nightscout.androidaps.utils.wizard.QuickWizard import info.nightscout.androidaps.utils.wizard.QuickWizardEntry import org.json.JSONArray diff --git a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt index a7ebd22d07..4c6c4d1ec6 100644 --- a/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/interfaces/ConstraintsCheckerTest.kt @@ -30,7 +30,7 @@ import info.nightscout.androidaps.plugins.source.GlimpPlugin import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.Profiler import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt index e613a040c0..8c6c3186bb 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/aps/loop/LoopPluginTest.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt index 4d198b4dd0..8f5500f6fa 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/configBuilder/ConfigBuilderPluginTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.interfaces.PumpSync import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Before import org.junit.Test import org.mockito.Mock diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/dstHelper/DstHelperPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/dstHelper/DstHelperPluginTest.kt index 7bf202c94e..69117ed385 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/dstHelper/DstHelperPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/dstHelper/DstHelperPluginTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.interfaces.ActivePlugin import info.nightscout.androidaps.interfaces.Loop import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt index 91b0abb662..540a0f038a 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/objectives/ObjectivesPluginTest.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.constraints.objectives.objectives.Objective import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.kt index 01a4f20313..f21efddce0 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/safety/SafetyPluginTest.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.plugins.sensitivity.SensitivityOref1Plugin import info.nightscout.androidaps.plugins.source.GlimpPlugin import info.nightscout.androidaps.utils.HardLimits import info.nightscout.androidaps.utils.buildHelper.BuildHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt index abc82bdbe4..e3b723104a 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/constraints/signatureVerifier/SignatureVerifierPluginTest.kt @@ -6,7 +6,7 @@ import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Test import org.mockito.Mock diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePluginTest.kt index 5d3464d400..7b1c3b9909 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/general/maintenance/MaintenancePluginTest.kt @@ -7,7 +7,7 @@ import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.plugins.general.nsclient.data.NSSettingsStatus import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegateTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegateTest.kt index c9e688baa7..57f27309ec 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegateTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/general/nsclient/NsClientReceiverDelegateTest.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.events.EventNetworkChange import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test 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 651d71c7d3..b07f6b9f39 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 @@ -30,7 +30,7 @@ import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.XDripBroadcast -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.Single import org.junit.Assert import org.junit.Before diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPluginTest.kt index 619655ffd0..52174ece95 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/insulin/InsulinOrefFreePeakPluginTest.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.interfaces.Insulin import info.nightscout.androidaps.interfaces.ProfileFunction import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert.assertEquals import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt index 7a5256ffa6..c9f1edf7f2 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/pump/virtual/VirtualPumpPluginUTest.kt @@ -13,7 +13,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt index 724e4f567a..9ab404998b 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/sensitivity/AbstractSensitivityPluginTest.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject import org.junit.Assert import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt index e6282c23c3..e8719daa23 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/GlimpPluginTest.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt index e1c4662fd9..f8822c7115 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/MM640GPluginTest.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt index c2408fad32..c3dc928913 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/source/NSClientPluginTest.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import info.nightscout.androidaps.TestBase import info.nightscout.androidaps.interfaces.Config import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPluginTest.kt b/app/src/test/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPluginTest.kt index d097a38721..3f0583fbc4 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPluginTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/plugins/treatments/TreatmentsPluginTest.kt @@ -4,7 +4,7 @@ import dagger.android.AndroidInjector import dagger.android.HasAndroidInjector import info.nightscout.androidaps.TestBaseWithProfile import info.nightscout.androidaps.database.AppRepository -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Test import org.mockito.Mock 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 48d7e4ded6..436d51a803 100644 --- a/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueImplementationTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/queue/CommandQueueImplementationTest.kt @@ -28,7 +28,7 @@ import info.nightscout.androidaps.utils.buildHelper.BuildHelper import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.Single import org.junit.Assert import org.junit.Before diff --git a/app/src/test/java/info/nightscout/androidaps/queue/QueueThreadTest.kt b/app/src/test/java/info/nightscout/androidaps/queue/QueueThreadTest.kt index 8edc20aa4c..2aafe9cbd1 100644 --- a/app/src/test/java/info/nightscout/androidaps/queue/QueueThreadTest.kt +++ b/app/src/test/java/info/nightscout/androidaps/queue/QueueThreadTest.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvid import info.nightscout.androidaps.queue.commands.Command import info.nightscout.androidaps.queue.commands.CommandTempBasalAbsolute import info.nightscout.androidaps.utils.buildHelper.BuildHelperImpl -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/automation/build.gradle b/automation/build.gradle index 5e06a3e587..b73447296f 100644 --- a/automation/build.gradle +++ b/automation/build.gradle @@ -13,4 +13,5 @@ apply from: "${project.rootDir}/gradle/jacoco_global.gradle" dependencies { implementation project(':core') implementation project(':database') + implementation project(':shared') } \ No newline at end of file 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 78a4e1dab7..fdfc638a9c 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 @@ -24,7 +24,7 @@ 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 info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import org.json.JSONArray 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 7a1b698e47..afdabc6efe 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 @@ -23,7 +23,7 @@ import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.JsonHelper import info.nightscout.androidaps.utils.T -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import org.json.JSONObject diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt index e9c1160edf..d7545727ee 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/Trigger.kt @@ -24,7 +24,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv import info.nightscout.androidaps.services.LastLocationDataContainer import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP 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 038757bc19..5f0be6f3d9 100644 --- a/automation/src/main/java/info/nightscout/androidaps/services/LocationService.kt +++ b/automation/src/main/java/info/nightscout/androidaps/services/LocationService.kt @@ -26,7 +26,7 @@ import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import javax.inject.Inject diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionsTestBase.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionsTestBase.kt index 8ae0d90fc6..f7089fbbeb 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionsTestBase.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/actions/ActionsTestBase.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.logging.UserEntryLogger import info.nightscout.androidaps.plugins.general.automation.TestBaseWithProfile import info.nightscout.androidaps.plugins.general.automation.triggers.Trigger import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Before import org.mockito.Mock import org.mockito.Mockito.`when` diff --git a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTestBase.kt b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTestBase.kt index b8af1dbee0..3e289c6946 100644 --- a/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTestBase.kt +++ b/automation/src/test/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerTestBase.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensDataStore import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProvider import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.services.LastLocationDataContainer -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Before import org.mockito.Mock import org.mockito.Mockito.`when` diff --git a/combo/build.gradle b/combo/build.gradle index c81f96b15c..885f8dc936 100644 --- a/combo/build.gradle +++ b/combo/build.gradle @@ -11,4 +11,5 @@ apply from: "${project.rootDir}/gradle/jacoco_global.gradle" dependencies { implementation project(':core') + implementation project(':shared') } \ No newline at end of file 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 30ca0686c8..8faedd6950 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,6 @@ 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.androidaps.utils.sharedPreferences.SP; import io.reactivex.disposables.CompositeDisposable; public class ComboFragment extends DaggerFragment { @@ -36,7 +35,6 @@ public class ComboFragment extends DaggerFragment { @Inject CommandQueue commandQueue; @Inject ResourceHelper rh; @Inject RxBus rxBus; - @Inject SP sp; @Inject DateUtil dateUtil; @Inject FabricPrivacy fabricPrivacy; @Inject AapsSchedulers aapsSchedulers; diff --git a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java index 28c5cca1b0..a74f5911be 100644 --- a/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java +++ b/combo/src/main/java/info/nightscout/androidaps/plugins/pump/combo/ComboPlugin.java @@ -64,7 +64,7 @@ import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.InstanceId; import info.nightscout.androidaps.utils.T; import info.nightscout.androidaps.utils.resources.ResourceHelper; -import info.nightscout.androidaps.utils.sharedPreferences.SP; +import info.nightscout.shared.sharedPreferences.SP; /** * Driver for the Roche Accu-Chek Combo pump, using the ruffy app for BT communication. diff --git a/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt b/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt index efc08c4b1d..1b0b39e742 100644 --- a/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt +++ b/combo/src/test/java/info/nightscout/androidaps/plugins/pump/combo/ComboPluginTest.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.pump.combo.ruffyscripter.history.Bolus import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.junit.Assert import org.junit.Before import org.junit.Test diff --git a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt b/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt index 0a2941fe7b..3f210e79d6 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/DaggerAppCompatActivityWithResult.kt @@ -10,12 +10,12 @@ import info.nightscout.androidaps.interfaces.ImportExportPrefs import info.nightscout.androidaps.plugins.general.maintenance.PrefsFileContract import info.nightscout.androidaps.utils.alertDialogs.OKDialog import info.nightscout.androidaps.utils.permissions.OptimizationPermissionContract -import info.nightscout.androidaps.utils.resources.ResourceHelperImplementation +import info.nightscout.androidaps.utils.resources.ResourceHelper import javax.inject.Inject open class DaggerAppCompatActivityWithResult : DaggerAppCompatActivity() { - @Inject lateinit var rh: ResourceHelperImplementation + @Inject lateinit var rh: ResourceHelper @Inject lateinit var importExportPrefs: ImportExportPrefs val callForPrefFile = registerForActivityResult(PrefsFileContract()) { 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 93b6dc14e0..be7820d5c4 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/ErrorHelperActivity.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.AppRepository import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnouncementTransaction import info.nightscout.androidaps.dialogs.ErrorDialog -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import javax.inject.Inject 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 8ead99abf1..3613384a13 100644 --- a/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt +++ b/core/src/main/java/info/nightscout/androidaps/activities/TDDStatsActivity.kt @@ -32,7 +32,7 @@ import info.nightscout.androidaps.queue.Callback import info.nightscout.androidaps.utils.FabricPrivacy import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.rx.AapsSchedulers -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import info.nightscout.shared.SafeParse import io.reactivex.disposables.CompositeDisposable import java.text.DateFormat diff --git a/core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt b/core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt index b67b8e50ff..411fbf386a 100644 --- a/core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt +++ b/core/src/main/java/info/nightscout/androidaps/di/CoreModule.kt @@ -10,8 +10,8 @@ import info.nightscout.androidaps.logging.AAPSLoggerProduction import info.nightscout.androidaps.logging.L import info.nightscout.androidaps.utils.resources.ResourceHelper import info.nightscout.androidaps.utils.resources.ResourceHelperImplementation -import info.nightscout.androidaps.utils.sharedPreferences.SP -import info.nightscout.androidaps.utils.sharedPreferences.SPImplementation +import info.nightscout.shared.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SPImplementation import javax.inject.Singleton @Module(includes = [ @@ -27,7 +27,7 @@ open class CoreModule { @Provides @Singleton - fun provideSharedPreferences(context: Context, rh: ResourceHelper): SP = SPImplementation(PreferenceManager.getDefaultSharedPreferences(context), rh) + fun provideSharedPreferences(context: Context): SP = SPImplementation(PreferenceManager.getDefaultSharedPreferences(context), context) @Provides @Singleton diff --git a/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt b/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt index 25ff67e21d..9b3f79611b 100644 --- a/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt +++ b/core/src/main/java/info/nightscout/androidaps/dialogs/DialogFragmentWithDate.kt @@ -17,7 +17,7 @@ import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.extensions.toVisibility -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt b/core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt index 15f400315a..31ad6b567c 100644 --- a/core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt +++ b/core/src/main/java/info/nightscout/androidaps/extensions/JSONObjectExt.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.extensions import androidx.annotation.StringRes import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONObject fun JSONObject.putInt(@StringRes key: Int, sp: SP, rh: ResourceHelper): JSONObject = diff --git a/core/src/main/java/info/nightscout/androidaps/logging/L.kt b/core/src/main/java/info/nightscout/androidaps/logging/L.kt index ad3ca2dad4..0a5278fbcb 100644 --- a/core/src/main/java/info/nightscout/androidaps/logging/L.kt +++ b/core/src/main/java/info/nightscout/androidaps/logging/L.kt @@ -1,6 +1,6 @@ package info.nightscout.androidaps.logging -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import javax.inject.Singleton diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt b/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt index 5c5aaed393..11b18463d8 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/aps/loop/APSResult.kt @@ -19,7 +19,7 @@ import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.DecimalFormatter import info.nightscout.androidaps.utils.HtmlHelper.fromHtml import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject import java.util.* diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt b/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt index 5ce9eb1fda..1e7c2dd47d 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/configBuilder/RunningConfiguration.kt @@ -11,7 +11,7 @@ import info.nightscout.androidaps.plugins.general.overview.notifications.Notific import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.utils.JsonHelper import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import org.json.JSONException import org.json.JSONObject import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt b/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt index ce9d6a7ab1..d5e7ccb254 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/constraints/versionChecker/VersionCheckerUtils.kt @@ -12,7 +12,7 @@ import info.nightscout.androidaps.receivers.ReceiverStatusStore import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.io.IOException import java.net.URL import java.util.concurrent.TimeUnit diff --git a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt index 1064d1c420..b19a578ed7 100644 --- a/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt +++ b/core/src/main/java/info/nightscout/androidaps/plugins/iob/iobCobCalculator/data/AutosensData.kt @@ -14,7 +14,7 @@ import info.nightscout.androidaps.plugins.general.overview.graphExtensions.Scale import info.nightscout.androidaps.plugins.iob.iobCobCalculator.AutosensResult import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.util.* import javax.inject.Inject import kotlin.math.min 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 820e119063..d206bbf6a9 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 @@ -19,7 +19,7 @@ import info.nightscout.androidaps.plugins.pump.common.defs.PumpType import info.nightscout.androidaps.utils.DateUtil import info.nightscout.androidaps.utils.T import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt b/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt index 35bc4ca815..6f21cbb1e5 100644 --- a/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt +++ b/core/src/main/java/info/nightscout/androidaps/services/AlarmSoundService.kt @@ -15,7 +15,7 @@ import info.nightscout.androidaps.interfaces.NotificationHolder import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import kotlin.math.ln import kotlin.math.pow diff --git a/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt b/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt index f69a51fd12..65a54b63c0 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/DefaultValueHelper.kt @@ -6,7 +6,7 @@ import info.nightscout.androidaps.core.R import info.nightscout.androidaps.interfaces.GlucoseUnit import info.nightscout.androidaps.interfaces.Profile import info.nightscout.androidaps.interfaces.ProfileFunction -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/core/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt b/core/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt index ac4f6e56b6..55cbba76b6 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/FabricPrivacy.kt @@ -9,7 +9,7 @@ import info.nightscout.androidaps.annotations.OpenForTesting import info.nightscout.androidaps.core.R import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.logging.LTag -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton 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 4899f6316e..9ef5543d02 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/HardLimits.kt @@ -8,7 +8,7 @@ import info.nightscout.androidaps.database.transactions.InsertTherapyEventAnnoun import info.nightscout.androidaps.logging.AAPSLogger import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.utils.resources.ResourceHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import io.reactivex.disposables.CompositeDisposable import io.reactivex.rxkotlin.plusAssign import javax.inject.Inject diff --git a/core/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt b/core/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt index 83090741e0..021df1d7e0 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/protection/PasswordCheck.kt @@ -13,7 +13,7 @@ import info.nightscout.androidaps.plugins.general.maintenance.PrefFileListProvid import info.nightscout.androidaps.utils.CryptoUtil import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.androidaps.utils.alertDialogs.AlertDialogHelper -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import java.io.File import javax.inject.Inject import javax.inject.Singleton diff --git a/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt b/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt index 9bc9a18fe4..d06583e17d 100644 --- a/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt +++ b/core/src/main/java/info/nightscout/androidaps/utils/protection/ProtectionCheck.kt @@ -2,7 +2,7 @@ package info.nightscout.androidaps.utils.protection import androidx.fragment.app.FragmentActivity import info.nightscout.androidaps.core.R -import info.nightscout.androidaps.utils.sharedPreferences.SP +import info.nightscout.shared.sharedPreferences.SP import javax.inject.Inject import javax.inject.Singleton diff --git a/core/src/main/res/values/layout.xml b/core/src/main/res/values/layout.xml index dcd51d9ab7..5629fe5956 100644 --- a/core/src/main/res/values/layout.xml +++ b/core/src/main/res/values/layout.xml @@ -1,6 +1,4 @@ - false -