From 5efad357214389c6ce0ddba4f7e8ea5b79b335f7 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 28 Jul 2018 23:57:25 +0200 Subject: [PATCH] NSUpload refactor --- .../java/info/nightscout/androidaps/MainApp.java | 3 +-- .../nightscout/androidaps/db/DatabaseHelper.java | 3 +-- .../plugins/Actions/dialogs/FillDialog.java | 2 +- .../Careportal/Dialogs/NewNSTreatmentDialog.java | 2 +- .../ConfigBuilder/ConfigBuilderPlugin.java | 2 +- .../androidaps/plugins/Food/FoodFragment.java | 2 +- .../androidaps/plugins/Loop/LoopPlugin.java | 3 +-- .../plugins/NSClientInternal}/NSUpload.java | 16 +++++++++++----- .../plugins/OpenAPSSMB/OpenAPSSMBPlugin.java | 2 +- .../Overview/Dialogs/ErrorHelperActivity.java | 2 +- .../plugins/Overview/Dialogs/NewCarbsDialog.java | 2 +- .../plugins/Overview/OverviewFragment.java | 3 +-- .../PumpDanaR/activities/DanaRNSHistorySync.java | 2 +- .../plugins/PumpDanaR/comm/MsgError.java | 2 +- .../services/DanaRExecutionService.java | 2 +- .../services/DanaRKoreanExecutionService.java | 2 +- .../comm/DanaRS_Packet_Notify_Alarm.java | 2 +- .../plugins/PumpDanaRS/services/BLEComm.java | 2 +- .../PumpDanaRS/services/DanaRSService.java | 2 +- .../services/DanaRv2ExecutionService.java | 2 +- .../plugins/PumpInsight/InsightPlugin.java | 2 +- .../history/HistoryIntentAdapter.java | 2 +- .../plugins/PumpVirtual/VirtualPumpPlugin.java | 2 +- .../SmsCommunicator/SmsCommunicatorPlugin.java | 2 +- .../plugins/Source/BGSourceFragment.java | 2 +- .../plugins/Source/SourceDexcomG5Plugin.java | 2 +- .../plugins/Source/SourcePoctechPlugin.java | 2 +- .../plugins/Treatments/TreatmentsPlugin.java | 2 +- .../fragments/TreatmentsBolusFragment.java | 5 +---- .../fragments/TreatmentsCareportalFragment.java | 2 +- .../TreatmentsExtendedBolusesFragment.java | 5 +---- .../TreatmentsProfileSwitchFragment.java | 2 +- .../fragments/TreatmentsTempTargetFragment.java | 2 +- .../TreatmentsTemporaryBasalsFragment.java | 2 +- .../java/info/nightscout/utils/HardLimits.java | 1 + .../info/nightscout/utils/LocalAlertUtils.java | 1 + .../Dialogs/NewNSTreatmentDialogTest.java | 3 +-- 37 files changed, 47 insertions(+), 50 deletions(-) rename app/src/main/java/info/nightscout/{utils => androidaps/plugins/NSClientInternal}/NSUpload.java (98%) diff --git a/app/src/main/java/info/nightscout/androidaps/MainApp.java b/app/src/main/java/info/nightscout/androidaps/MainApp.java index dbb6ddee8b..3870799929 100644 --- a/app/src/main/java/info/nightscout/androidaps/MainApp.java +++ b/app/src/main/java/info/nightscout/androidaps/MainApp.java @@ -10,7 +10,6 @@ import android.support.v4.content.LocalBroadcastManager; import com.crashlytics.android.Crashlytics; import com.crashlytics.android.answers.Answers; -import com.crashlytics.android.answers.CustomEvent; import com.j256.ormlite.android.apptools.OpenHelperManager; import com.squareup.otto.Bus; import com.squareup.otto.LoggingBus; @@ -78,7 +77,7 @@ import info.nightscout.androidaps.receivers.DataReceiver; import info.nightscout.androidaps.receivers.KeepAliveReceiver; import info.nightscout.androidaps.receivers.NSAlarmReceiver; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import io.fabric.sdk.android.Fabric; diff --git a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java index ba6f2e5dd0..19a20bdfc4 100644 --- a/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java +++ b/app/src/main/java/info/nightscout/androidaps/db/DatabaseHelper.java @@ -28,7 +28,6 @@ import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; import info.nightscout.androidaps.Config; -import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.data.OverlappingIntervals; import info.nightscout.androidaps.data.Profile; @@ -48,7 +47,7 @@ import info.nightscout.androidaps.plugins.PumpDanaR.activities.DanaRNSHistorySyn import info.nightscout.androidaps.plugins.PumpDanaR.comm.RecordTypes; import info.nightscout.androidaps.plugins.PumpVirtual.VirtualPumpPlugin; import info.nightscout.utils.JsonHelper; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.PercentageSplitter; import info.nightscout.utils.ToastUtils; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/FillDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/FillDialog.java index 558a7c381c..cd649d30cd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/FillDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Actions/dialogs/FillDialog.java @@ -39,7 +39,7 @@ import info.nightscout.androidaps.plugins.Overview.Dialogs.ErrorHelperActivity; import info.nightscout.androidaps.queue.Callback; import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.NumberPicker; import info.nightscout.utils.SP; import info.nightscout.utils.SafeParse; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java index 666a4a27a3..802a072002 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialog.java @@ -55,7 +55,7 @@ import info.nightscout.utils.DefaultValueHelper; import info.nightscout.utils.FabricPrivacy; import info.nightscout.utils.HardLimits; import info.nightscout.utils.JsonHelper; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.NumberPicker; import info.nightscout.utils.SP; import info.nightscout.utils.SafeParse; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java index eb35a3cc60..8a1b4a9764 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/ConfigBuilder/ConfigBuilderPlugin.java @@ -47,7 +47,7 @@ import info.nightscout.androidaps.plugins.Sensitivity.SensitivityOref0Plugin; import info.nightscout.androidaps.queue.Callback; import info.nightscout.androidaps.queue.CommandQueue; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import info.nightscout.utils.ToastUtils; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Food/FoodFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Food/FoodFragment.java index 1acf6ea083..677fac5fb2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Food/FoodFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Food/FoodFragment.java @@ -33,7 +33,7 @@ import info.nightscout.androidaps.R; import info.nightscout.androidaps.events.EventFoodDatabaseChanged; import info.nightscout.androidaps.plugins.Common.SubscriberFragment; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SpinnerHelper; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java index 480646ccfc..3e49e9b2e2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Loop/LoopPlugin.java @@ -32,7 +32,6 @@ import info.nightscout.androidaps.db.BgReading; import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.events.Event; import info.nightscout.androidaps.events.EventNewBG; -import info.nightscout.androidaps.events.EventTreatmentChange; import info.nightscout.androidaps.interfaces.APSInterface; import info.nightscout.androidaps.interfaces.Constraint; import info.nightscout.androidaps.interfaces.PluginBase; @@ -48,7 +47,7 @@ import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.androidaps.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; /** diff --git a/app/src/main/java/info/nightscout/utils/NSUpload.java b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSUpload.java similarity index 98% rename from app/src/main/java/info/nightscout/utils/NSUpload.java rename to app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSUpload.java index 00d5e39821..46ef2fae73 100644 --- a/app/src/main/java/info/nightscout/utils/NSUpload.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/NSClientInternal/NSUpload.java @@ -1,4 +1,4 @@ -package info.nightscout.utils; +package info.nightscout.androidaps.plugins.NSClientInternal; import android.content.Context; import android.content.Intent; @@ -21,6 +21,8 @@ import java.util.Date; import java.util.List; import java.util.Locale; +import info.nightscout.androidaps.Config; +import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.Services.Intents; @@ -37,13 +39,16 @@ import info.nightscout.androidaps.plugins.Loop.APSResult; import info.nightscout.androidaps.plugins.Loop.DeviceStatus; import info.nightscout.androidaps.plugins.Loop.LoopPlugin; import info.nightscout.androidaps.plugins.NSClientInternal.data.DbLogger; +import info.nightscout.utils.BatteryLevel; +import info.nightscout.utils.DateUtil; +import info.nightscout.utils.SP; /** * Created by mike on 26.05.2017. */ public class NSUpload { - private static Logger log = LoggerFactory.getLogger(NSUpload.class); + private static Logger log = LoggerFactory.getLogger(Constants.NSCLIENT); public static void uploadTempBasalStartAbsolute(TemporaryBasal temporaryBasal, Double originalExtendedAmount) { try { @@ -232,7 +237,8 @@ public class NSUpload { deviceStatus.enacted.put("requested", requested); } } else { - log.debug("OpenAPS data too old to upload"); + if (Config.logNsclient) + log.debug("OpenAPS data too old to upload"); } deviceStatus.device = "openaps://" + Build.MANUFACTURER + " " + Build.MODEL; JSONObject pumpstatus = ConfigBuilderPlugin.getActivePump().getJSONStatus(profile, profileName); @@ -490,7 +496,7 @@ public class NSUpload { try { data.put("eventType", "Note"); data.put("created_at", DateUtil.toISOString(new Date())); - data.put("notes", MainApp.gs(R.string.androidaps_start)+" - "+ Build.MANUFACTURER + " "+ Build.MODEL); + data.put("notes", MainApp.gs(R.string.androidaps_start) + " - " + Build.MANUFACTURER + " " + Build.MODEL); } catch (JSONException e) { log.error("Unhandled exception", e); } @@ -500,7 +506,7 @@ public class NSUpload { intent.addFlags(Intent.FLAG_INCLUDE_STOPPED_PACKAGES); context.sendBroadcast(intent); DbLogger.dbAdd(intent, data.toString()); - } + } } public static void uploadEvent(String careportalEvent, long time, @Nullable String notes) { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java index 570b76502f..455a87df40 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSSMB/OpenAPSSMBPlugin.java @@ -33,7 +33,7 @@ import info.nightscout.androidaps.plugins.OpenAPSMA.events.EventOpenAPSUpdateRes import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.DateUtil; import info.nightscout.utils.HardLimits; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.Profiler; import info.nightscout.utils.Round; import info.nightscout.utils.ToastUtils; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/ErrorHelperActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/ErrorHelperActivity.java index 90cf9aecd5..c556a6c844 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/ErrorHelperActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/ErrorHelperActivity.java @@ -4,7 +4,7 @@ import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import info.nightscout.androidaps.R; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; public class ErrorHelperActivity extends AppCompatActivity { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java index b51270938d..cd03cb7b6a 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/Dialogs/NewCarbsDialog.java @@ -21,7 +21,7 @@ import android.widget.RadioButton; import com.google.common.base.Joiner; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java index b5e97a59d8..b0655d894e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Overview/OverviewFragment.java @@ -86,7 +86,6 @@ import info.nightscout.androidaps.plugins.Careportal.OptionsToShow; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.ConstraintsObjectives.ObjectivesPlugin; import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensData; -import info.nightscout.androidaps.plugins.IobCobCalculator.AutosensResult; import info.nightscout.androidaps.plugins.IobCobCalculator.CobInfo; import info.nightscout.androidaps.plugins.IobCobCalculator.IobCobCalculatorPlugin; import info.nightscout.androidaps.plugins.IobCobCalculator.events.EventAutosensCalculationFinished; @@ -115,7 +114,7 @@ import info.nightscout.utils.DateUtil; import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.DefaultValueHelper; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.OKDialog; import info.nightscout.utils.Profiler; import info.nightscout.utils.SP; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRNSHistorySync.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRNSHistorySync.java index 0967952240..0697389c48 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRNSHistorySync.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/activities/DanaRNSHistorySync.java @@ -18,7 +18,7 @@ import info.nightscout.androidaps.db.DanaRHistoryRecord; import info.nightscout.androidaps.plugins.PumpDanaR.comm.RecordTypes; import info.nightscout.androidaps.plugins.PumpDanaR.events.EventDanaRSyncStatus; import info.nightscout.utils.DateUtil; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; /** * Created by mike on 20.07.2016. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgError.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgError.java index dcd6a4c819..8c41d47c7f 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgError.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/comm/MsgError.java @@ -8,7 +8,7 @@ import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.plugins.Overview.events.EventOverviewBolusProgress; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; public class MsgError extends MessageBase { private static Logger log = LoggerFactory.getLogger(Constants.PUMPCOMM); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/services/DanaRExecutionService.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/services/DanaRExecutionService.java index 730c43643b..22c7f8187b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/services/DanaRExecutionService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaR/services/DanaRExecutionService.java @@ -62,7 +62,7 @@ import info.nightscout.androidaps.plugins.PumpDanaR.events.EventDanaRNewStatus; import info.nightscout.androidaps.plugins.Treatments.Treatment; import info.nightscout.androidaps.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; public class DanaRExecutionService extends AbstractDanaRExecutionService { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/services/DanaRKoreanExecutionService.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/services/DanaRKoreanExecutionService.java index 25a4e21b72..579aa916d2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/services/DanaRKoreanExecutionService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRKorean/services/DanaRKoreanExecutionService.java @@ -54,7 +54,7 @@ import info.nightscout.androidaps.plugins.PumpDanaRKorean.comm.MsgSettingBasal_k import info.nightscout.androidaps.plugins.PumpDanaRKorean.comm.MsgStatusBasic_k; import info.nightscout.androidaps.plugins.Treatments.Treatment; import info.nightscout.androidaps.queue.commands.Command; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; public class DanaRKoreanExecutionService extends AbstractDanaRExecutionService { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Notify_Alarm.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Notify_Alarm.java index 2723dc03a4..ba81fe1a77 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Notify_Alarm.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/comm/DanaRS_Packet_Notify_Alarm.java @@ -9,7 +9,7 @@ import info.nightscout.androidaps.Config; import info.nightscout.androidaps.Constants; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; public class DanaRS_Packet_Notify_Alarm extends DanaRS_Packet { private Logger log = LoggerFactory.getLogger(Constants.PUMPCOMM); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/BLEComm.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/BLEComm.java index 5e948c09f5..7ba99a75ba 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/BLEComm.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/BLEComm.java @@ -36,7 +36,7 @@ import info.nightscout.androidaps.plugins.PumpDanaRS.comm.DanaRSMessageHashTable import info.nightscout.androidaps.plugins.PumpDanaRS.comm.DanaRS_Packet; import info.nightscout.androidaps.plugins.PumpDanaRS.events.EventDanaRSPacket; import info.nightscout.androidaps.plugins.PumpDanaRS.events.EventDanaRSPairingSuccess; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/DanaRSService.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/DanaRSService.java index 0264e2148a..87d2b45c18 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/DanaRSService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRS/services/DanaRSService.java @@ -78,7 +78,7 @@ import info.nightscout.androidaps.plugins.Treatments.Treatment; import info.nightscout.androidaps.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.utils.DateUtil; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import info.nightscout.utils.T; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/services/DanaRv2ExecutionService.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/services/DanaRv2ExecutionService.java index 770af49e75..1b75e15246 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/services/DanaRv2ExecutionService.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpDanaRv2/services/DanaRv2ExecutionService.java @@ -70,7 +70,7 @@ import info.nightscout.androidaps.plugins.Treatments.Treatment; import info.nightscout.androidaps.queue.Callback; import info.nightscout.androidaps.queue.commands.Command; import info.nightscout.utils.DateUtil; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import info.nightscout.utils.T; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java index 5fd8e25f26..3d8863bd3e 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/InsightPlugin.java @@ -51,7 +51,7 @@ import info.nightscout.androidaps.plugins.PumpInsight.utils.StatusItem; import info.nightscout.androidaps.plugins.Treatments.Treatment; import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.DateUtil; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import sugar.free.sightparser.applayer.descriptors.ActiveBolus; import sugar.free.sightparser.applayer.descriptors.ActiveBolusType; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/history/HistoryIntentAdapter.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/history/HistoryIntentAdapter.java index 2c2235bf47..87e427737b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/history/HistoryIntentAdapter.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpInsight/history/HistoryIntentAdapter.java @@ -6,7 +6,7 @@ import info.nightscout.androidaps.R; import info.nightscout.androidaps.db.CareportalEvent; import info.nightscout.androidaps.db.TDD; import info.nightscout.utils.DateUtil; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import org.json.JSONException; import org.json.JSONObject; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java index 12977b89bf..1586522791 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/PumpVirtual/VirtualPumpPlugin.java @@ -30,7 +30,7 @@ import info.nightscout.androidaps.plugins.Overview.notifications.Notification; import info.nightscout.androidaps.plugins.PumpVirtual.events.EventVirtualPumpUpdateGui; import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.DateUtil; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java index 55f7ee9e50..a318715253 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/SmsCommunicator/SmsCommunicatorPlugin.java @@ -45,7 +45,7 @@ import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.androidaps.queue.Callback; import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import info.nightscout.utils.SafeParse; import info.nightscout.utils.T; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Source/BGSourceFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Source/BGSourceFragment.java index 3e9a79d459..cdd77ca1b2 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Source/BGSourceFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Source/BGSourceFragment.java @@ -27,7 +27,7 @@ import info.nightscout.androidaps.events.EventNewBG; import info.nightscout.androidaps.plugins.Common.SubscriberFragment; import info.nightscout.utils.DateUtil; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; /** * Created by mike on 16.10.2017. diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Source/SourceDexcomG5Plugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Source/SourceDexcomG5Plugin.java index b47f8ae1e1..b9f707a914 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Source/SourceDexcomG5Plugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Source/SourceDexcomG5Plugin.java @@ -18,7 +18,7 @@ import info.nightscout.androidaps.interfaces.BgSourceInterface; import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.PluginType; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Source/SourcePoctechPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Source/SourcePoctechPlugin.java index 071943065d..321c1b5394 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Source/SourcePoctechPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Source/SourcePoctechPlugin.java @@ -19,7 +19,7 @@ import info.nightscout.androidaps.interfaces.PluginBase; import info.nightscout.androidaps.interfaces.PluginDescription; import info.nightscout.androidaps.interfaces.PluginType; import info.nightscout.utils.JsonHelper; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java index 0a1ed1c2d7..dca46916f5 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/TreatmentsPlugin.java @@ -48,7 +48,7 @@ import info.nightscout.androidaps.plugins.Sensitivity.SensitivityAAPSPlugin; import info.nightscout.androidaps.plugins.Sensitivity.SensitivityWeightedAveragePlugin; import info.nightscout.utils.DateUtil; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import info.nightscout.utils.T; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsBolusFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsBolusFragment.java index ee62733596..dfb63cd3a7 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsBolusFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsBolusFragment.java @@ -20,9 +20,6 @@ import android.widget.TextView; import com.crashlytics.android.answers.CustomEvent; import com.squareup.otto.Subscribe; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import java.util.List; import info.nightscout.androidaps.MainApp; @@ -40,7 +37,7 @@ import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.FabricPrivacy; import info.nightscout.utils.DateUtil; import info.nightscout.utils.DecimalFormatter; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import static info.nightscout.utils.DateUtil.now; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsCareportalFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsCareportalFragment.java index 7e69883a3d..f5da54e1ac 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsCareportalFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsCareportalFragment.java @@ -28,7 +28,7 @@ import info.nightscout.androidaps.events.EventCareportalEventChange; import info.nightscout.androidaps.plugins.Common.SubscriberFragment; import info.nightscout.androidaps.plugins.NSClientInternal.UploadQueue; import info.nightscout.utils.DateUtil; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import info.nightscout.utils.Translator; diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsExtendedBolusesFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsExtendedBolusesFragment.java index 389965c6fd..037a1a0023 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsExtendedBolusesFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsExtendedBolusesFragment.java @@ -18,9 +18,6 @@ import android.widget.TextView; import com.crashlytics.android.answers.CustomEvent; import com.squareup.otto.Subscribe; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.data.Intervals; @@ -35,7 +32,7 @@ import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.DateUtil; import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; public class TreatmentsExtendedBolusesFragment extends SubscriberFragment { diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsProfileSwitchFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsProfileSwitchFragment.java index 307f9c8ee6..90350c312d 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsProfileSwitchFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsProfileSwitchFragment.java @@ -33,7 +33,7 @@ import info.nightscout.androidaps.plugins.Common.SubscriberFragment; import info.nightscout.androidaps.plugins.NSClientInternal.UploadQueue; import info.nightscout.utils.DateUtil; import info.nightscout.utils.DecimalFormatter; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTempTargetFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTempTargetFragment.java index df67349839..d1fb7bbf3c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTempTargetFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTempTargetFragment.java @@ -31,7 +31,7 @@ import info.nightscout.androidaps.plugins.NSClientInternal.UploadQueue; import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.DateUtil; import info.nightscout.utils.DecimalFormatter; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; /** diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTemporaryBasalsFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTemporaryBasalsFragment.java index 957c5c02f1..9b61eba2ae 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTemporaryBasalsFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/Treatments/fragments/TreatmentsTemporaryBasalsFragment.java @@ -33,7 +33,7 @@ import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; import info.nightscout.utils.DateUtil; import info.nightscout.utils.DecimalFormatter; import info.nightscout.utils.FabricPrivacy; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; public class TreatmentsTemporaryBasalsFragment extends SubscriberFragment { diff --git a/app/src/main/java/info/nightscout/utils/HardLimits.java b/app/src/main/java/info/nightscout/utils/HardLimits.java index 8e1a05db0d..1a36561b62 100644 --- a/app/src/main/java/info/nightscout/utils/HardLimits.java +++ b/app/src/main/java/info/nightscout/utils/HardLimits.java @@ -5,6 +5,7 @@ import org.slf4j.LoggerFactory; import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; /** * Created by mike on 22.02.2017. diff --git a/app/src/main/java/info/nightscout/utils/LocalAlertUtils.java b/app/src/main/java/info/nightscout/utils/LocalAlertUtils.java index 5556cae935..9fabe03ec2 100644 --- a/app/src/main/java/info/nightscout/utils/LocalAlertUtils.java +++ b/app/src/main/java/info/nightscout/utils/LocalAlertUtils.java @@ -14,6 +14,7 @@ import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.Loop.LoopPlugin; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.androidaps.plugins.Overview.events.EventDismissNotification; import info.nightscout.androidaps.plugins.Overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.Overview.notifications.Notification; diff --git a/app/src/test/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialogTest.java b/app/src/test/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialogTest.java index 185f400e4f..b02750b5b8 100644 --- a/app/src/test/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialogTest.java +++ b/app/src/test/java/info/nightscout/androidaps/plugins/Careportal/Dialogs/NewNSTreatmentDialogTest.java @@ -18,12 +18,11 @@ import info.nightscout.androidaps.MainApp; import info.nightscout.androidaps.R; import info.nightscout.androidaps.db.DatabaseHelper; import info.nightscout.androidaps.db.ProfileSwitch; -import info.nightscout.androidaps.plugins.Careportal.Dialogs.NewNSTreatmentDialog; import info.nightscout.androidaps.plugins.ConfigBuilder.ConfigBuilderPlugin; import info.nightscout.androidaps.plugins.ProfileNS.NSProfilePlugin; import info.nightscout.androidaps.plugins.Treatments.TreatmentService; import info.nightscout.androidaps.plugins.Treatments.TreatmentsPlugin; -import info.nightscout.utils.NSUpload; +import info.nightscout.androidaps.plugins.NSClientInternal.NSUpload; import info.nightscout.utils.SP; import static info.nightscout.androidaps.plugins.Careportal.CareportalFragment.PROFILESWITCH;