From b247b814282ec88a81cfd9c6031eb04441d55c18 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Wed, 10 May 2017 16:33:41 +0200 Subject: [PATCH] use helper class to query settings --- .../plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java | 2 +- .../plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java index 5b69b61728..6dcd4fe653 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSAMA/DetermineBasalAdapterAMAJS.java @@ -246,7 +246,7 @@ public class DetermineBasalAdapterAMAJS { mGlucoseStatus = new V8Object(mV8rt); mGlucoseStatus.add("glucose", glucoseStatus.glucose); - if(PreferenceManager.getDefaultSharedPreferences(MainApp.instance()).getBoolean("always_use_shortavg", false)){ + if(SP.getBoolean("always_use_shortavg", false)){ mGlucoseStatus.add("delta", glucoseStatus.short_avgdelta); } else { mGlucoseStatus.add("delta", glucoseStatus.delta); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java index d51864aea3..bb6cc26157 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/OpenAPSMA/DetermineBasalAdapterMAJS.java @@ -22,6 +22,7 @@ import info.nightscout.androidaps.data.MealData; import info.nightscout.androidaps.interfaces.PumpInterface; import info.nightscout.androidaps.plugins.Loop.ScriptReader; import info.nightscout.androidaps.plugins.NSClientInternal.data.NSProfile; +import info.nightscout.utils.SP; public class DetermineBasalAdapterMAJS { private static Logger log = LoggerFactory.getLogger(DetermineBasalAdapterMAJS.class); @@ -254,7 +255,7 @@ public class DetermineBasalAdapterMAJS { mIobData.add("hightempinsulin", iobData.hightempinsulin); mGlucoseStatus.add("glucose", glucoseStatus.glucose); - if(PreferenceManager.getDefaultSharedPreferences(MainApp.instance()).getBoolean("always_use_shortavg", false)){ + if(SP.getBoolean("always_use_shortavg", false)){ mGlucoseStatus.add("delta", glucoseStatus.short_avgdelta); } else { mGlucoseStatus.add("delta", glucoseStatus.delta);