:core:utils cleanup

This commit is contained in:
Milos Kozak 2023-09-25 12:34:13 +02:00
parent d7d01a0b3e
commit ea9132bbe3
209 changed files with 705 additions and 807 deletions

View file

@ -34,8 +34,6 @@ import app.aaps.activities.PreferencesActivity
import app.aaps.configuration.activities.DaggerAppCompatActivityWithResult
import app.aaps.configuration.activities.SingleFragmentActivity
import app.aaps.configuration.setupwizard.SetupWizardActivity
import app.aaps.core.main.utils.CryptoUtil
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.interfaces.androidPermissions.AndroidPermission
import app.aaps.core.interfaces.aps.Loop
import app.aaps.core.interfaces.configuration.Config
@ -55,6 +53,13 @@ import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator
import app.aaps.core.interfaces.ui.IconsProvider
import app.aaps.core.interfaces.versionChecker.VersionCheckerUtils
import app.aaps.core.main.utils.CryptoUtil
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.ui.UIRunnable
import app.aaps.core.ui.dialogs.OKDialog
import app.aaps.core.ui.locale.LocaleHelper
import app.aaps.core.ui.toast.ToastUtils
import app.aaps.core.utils.isRunningRealPumpTest
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.google.android.material.tabs.TabLayoutMediator
import com.google.firebase.crashlytics.FirebaseCrashlytics
@ -63,11 +68,6 @@ import com.joanzapata.iconify.fonts.FontAwesomeModule
import info.nightscout.androidaps.BuildConfig
import info.nightscout.androidaps.R
import info.nightscout.androidaps.databinding.ActivityMainBinding
import app.aaps.core.ui.UIRunnable
import app.aaps.core.ui.dialogs.OKDialog
import app.aaps.core.ui.locale.LocaleHelper
import app.aaps.core.ui.toast.ToastUtils
import info.nightscout.core.utils.isRunningRealPumpTest
import info.nightscout.database.entities.UserEntry.Action
import info.nightscout.database.entities.UserEntry.Sources
import info.nightscout.plugins.constraints.signatureVerifier.SignatureVerifierPlugin

View file

@ -5,8 +5,8 @@ import android.content.Context
import android.content.Intent
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.events.EventBTChange
import app.aaps.core.utils.extensions.safeGetParcelableExtra
import dagger.android.DaggerBroadcastReceiver
import info.nightscout.core.utils.extensions.safeGetParcelableExtra
import javax.inject.Inject
class BTReceiver : DaggerBroadcastReceiver() {

View file

@ -8,11 +8,11 @@ import androidx.work.OneTimeWorkRequest
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.receivers.Intents
import app.aaps.core.utils.extensions.copyDouble
import app.aaps.core.utils.extensions.copyLong
import app.aaps.core.utils.extensions.copyString
import app.aaps.core.utils.receivers.DataWorkerStorage
import dagger.android.DaggerBroadcastReceiver
import info.nightscout.core.utils.extensions.copyDouble
import info.nightscout.core.utils.extensions.copyLong
import info.nightscout.core.utils.extensions.copyString
import info.nightscout.core.utils.receivers.DataWorkerStorage
import info.nightscout.plugins.general.smsCommunicator.SmsCommunicatorPlugin
import info.nightscout.source.AidexPlugin
import info.nightscout.source.DexcomPlugin

View file

@ -7,12 +7,6 @@ import androidx.work.ExistingWorkPolicy
import androidx.work.OneTimeWorkRequest
import androidx.work.WorkInfo
import androidx.work.WorkManager
import app.aaps.core.main.graph.OverviewData
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.main.workflow.CalculationWorkflow
import app.aaps.core.main.workflow.CalculationWorkflow.Companion.JOB
import app.aaps.core.main.workflow.CalculationWorkflow.Companion.MAIN_CALCULATION
import app.aaps.core.main.workflow.CalculationWorkflow.Companion.PASS
import app.aaps.core.interfaces.iob.IobCobCalculator
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
@ -27,9 +21,15 @@ import app.aaps.core.interfaces.rx.events.EventOfflineChange
import app.aaps.core.interfaces.rx.events.EventPreferenceChange
import app.aaps.core.interfaces.rx.events.EventTherapyEventChange
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.main.graph.OverviewData
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.main.workflow.CalculationWorkflow
import app.aaps.core.main.workflow.CalculationWorkflow.Companion.JOB
import app.aaps.core.main.workflow.CalculationWorkflow.Companion.MAIN_CALCULATION
import app.aaps.core.main.workflow.CalculationWorkflow.Companion.PASS
import app.aaps.core.utils.receivers.DataWorkerStorage
import app.aaps.core.utils.worker.then
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.receivers.DataWorkerStorage
import info.nightscout.core.utils.worker.then
import info.nightscout.plugins.iob.iobCobCalculator.IobCobCalculatorPlugin
import info.nightscout.workflow.DummyWorker
import info.nightscout.workflow.InvokeLoopWorker

View file

@ -1,13 +1,13 @@
package app.aaps.core.main.extensions
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.interfaces.configuration.Constants
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.profile.PureProfile
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import app.aaps.core.interfaces.utils.T
import info.nightscout.core.utils.JsonHelper
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.utils.JsonHelper
import info.nightscout.database.entities.ProfileSwitch
import org.json.JSONObject
import java.util.TimeZone

View file

@ -1,12 +1,5 @@
package app.aaps.core.main.profile
import app.aaps.core.main.events.EventNewNotification
import app.aaps.core.main.extensions.blockValueBySeconds
import app.aaps.core.main.extensions.highTargetBlockValueBySeconds
import app.aaps.core.main.extensions.lowTargetBlockValueBySeconds
import app.aaps.core.main.extensions.shiftBlock
import app.aaps.core.main.extensions.shiftTargetBlock
import app.aaps.core.main.extensions.targetBlockValueBySeconds
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.notifications.Notification
@ -19,7 +12,14 @@ import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.HardLimits
import app.aaps.core.interfaces.utils.T
import info.nightscout.core.utils.MidnightUtils
import app.aaps.core.main.events.EventNewNotification
import app.aaps.core.main.extensions.blockValueBySeconds
import app.aaps.core.main.extensions.highTargetBlockValueBySeconds
import app.aaps.core.main.extensions.lowTargetBlockValueBySeconds
import app.aaps.core.main.extensions.shiftBlock
import app.aaps.core.main.extensions.shiftTargetBlock
import app.aaps.core.main.extensions.targetBlockValueBySeconds
import app.aaps.core.utils.MidnightUtils
import info.nightscout.database.entities.EffectiveProfileSwitch
import info.nightscout.database.entities.ProfileSwitch
import info.nightscout.database.entities.data.Block

View file

@ -1,7 +1,7 @@
package app.aaps.core.main.utils
import app.aaps.core.interfaces.logging.AAPSLogger
import info.nightscout.core.utils.toHex
import app.aaps.core.utils.toHex
import org.spongycastle.util.encoders.Base64
import java.nio.ByteBuffer
import java.security.MessageDigest

View file

@ -2,11 +2,6 @@ package app.aaps.core.main.wizard
import android.content.Context
import android.text.Spanned
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.extensions.highValueToUnitsToString
import app.aaps.core.main.extensions.lowValueToUnitsToString
import app.aaps.core.main.iob.round
import app.aaps.core.main.utils.extensions.formatColor
import app.aaps.core.interfaces.aps.Loop
import app.aaps.core.interfaces.automation.Automation
import app.aaps.core.interfaces.configuration.Config
@ -36,10 +31,15 @@ import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import app.aaps.core.interfaces.utils.Round
import app.aaps.core.interfaces.utils.T
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.extensions.highValueToUnitsToString
import app.aaps.core.main.extensions.lowValueToUnitsToString
import app.aaps.core.main.iob.round
import app.aaps.core.main.utils.extensions.formatColor
import app.aaps.core.ui.dialogs.OKDialog
import app.aaps.core.utils.HtmlHelper
import com.google.common.base.Joiner
import dagger.android.HasAndroidInjector
import app.aaps.core.ui.dialogs.OKDialog
import info.nightscout.core.utils.HtmlHelper
import info.nightscout.database.entities.BolusCalculatorResult
import info.nightscout.database.entities.OfflineEvent
import info.nightscout.database.entities.TemporaryTarget

View file

@ -1,8 +1,6 @@
package app.aaps.core.main.wizard
import app.aaps.annotations.OpenForTesting
import app.aaps.core.main.extensions.valueToUnits
import app.aaps.core.main.iob.round
import app.aaps.core.interfaces.aps.Loop
import app.aaps.core.interfaces.db.PersistenceLayer
import app.aaps.core.interfaces.iob.GlucoseStatusProvider
@ -13,10 +11,12 @@ import app.aaps.core.interfaces.profile.Profile
import app.aaps.core.interfaces.profile.ProfileFunction
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.main.extensions.valueToUnits
import app.aaps.core.main.iob.round
import app.aaps.core.utils.JsonHelper.safeGetInt
import app.aaps.core.utils.JsonHelper.safeGetString
import app.aaps.core.utils.MidnightUtils
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.JsonHelper.safeGetInt
import info.nightscout.core.utils.JsonHelper.safeGetString
import info.nightscout.core.utils.MidnightUtils
import info.nightscout.database.ValueWrapper
import org.json.JSONException
import org.json.JSONObject

View file

@ -1,312 +0,0 @@
package info.nightscout.core.utils;
/*
* Created by andy on 10/25/18.
*/
import org.joda.time.LocalDateTime;
import org.joda.time.Minutes;
import org.joda.time.Seconds;
import java.util.Calendar;
import java.util.GregorianCalendar;
/**
* This is simple version of ATechDate, limited only to one format (yyyymmddHHMIss)
*/
public class DateTimeUtil {
/**
* DateTime is packed as long: yyyymmddHHMMss
*
* @param atechDateTime
* @return
*/
public static LocalDateTime toLocalDateTime(long atechDateTime) {
int year = (int) (atechDateTime / 10000000000L);
atechDateTime -= year * 10000000000L;
int month = (int) (atechDateTime / 100000000L);
atechDateTime -= month * 100000000L;
int dayOfMonth = (int) (atechDateTime / 1000000L);
atechDateTime -= dayOfMonth * 1000000L;
int hourOfDay = (int) (atechDateTime / 10000L);
atechDateTime -= hourOfDay * 10000L;
int minute = (int) (atechDateTime / 100L);
atechDateTime -= minute * 100L;
int second = (int) atechDateTime;
try {
return new LocalDateTime(year, month, dayOfMonth, hourOfDay, minute, second);
} catch (Exception ex) {
//LOG.error("Error creating LocalDateTime from values [atechDateTime={}, year={}, month={}, day={}, hour={}, minute={}, second={}]. Exception: {}", atechDateTime, year, month, dayOfMonth, hourOfDay, minute, second, ex.getMessage());
//return null;
throw ex;
}
}
/**
* DateTime is packed as long: yyyymmddHHMMss
*
* @param atechDateTime
* @return
*/
public static GregorianCalendar toGregorianCalendar(long atechDateTime) {
int year = (int) (atechDateTime / 10000000000L);
atechDateTime -= year * 10000000000L;
int month = (int) (atechDateTime / 100000000L);
atechDateTime -= month * 100000000L;
int dayOfMonth = (int) (atechDateTime / 1000000L);
atechDateTime -= dayOfMonth * 1000000L;
int hourOfDay = (int) (atechDateTime / 10000L);
atechDateTime -= hourOfDay * 10000L;
int minute = (int) (atechDateTime / 100L);
atechDateTime -= minute * 100L;
int second = (int) atechDateTime;
try {
return new GregorianCalendar(year, month - 1, dayOfMonth, hourOfDay, minute, second);
} catch (Exception ex) {
//LOG.error("DateTimeUtil", String.format("Error creating GregorianCalendar from values [atechDateTime=%d, year=%d, month=%d, day=%d, hour=%d, minute=%d, second=%d]", atechDateTime, year, month, dayOfMonth, hourOfDay, minute, second));
//return null;
throw ex;
}
}
public static long toATechDate(LocalDateTime ldt) {
long atechDateTime = 0L;
atechDateTime += ldt.getYear() * 10000000000L;
atechDateTime += ldt.getMonthOfYear() * 100000000L;
atechDateTime += ldt.getDayOfMonth() * 1000000L;
atechDateTime += ldt.getHourOfDay() * 10000L;
atechDateTime += ldt.getMinuteOfHour() * 100L;
atechDateTime += ldt.getSecondOfMinute();
return atechDateTime;
}
public static long toATechDate(GregorianCalendar gc) {
long atechDateTime = 0L;
atechDateTime += gc.get(Calendar.YEAR) * 10000000000L;
atechDateTime += (gc.get(Calendar.MONTH) + 1) * 100000000L;
atechDateTime += gc.get(Calendar.DAY_OF_MONTH) * 1000000L;
atechDateTime += gc.get(Calendar.HOUR_OF_DAY) * 10000L;
atechDateTime += gc.get(Calendar.MINUTE) * 100L;
atechDateTime += gc.get(Calendar.SECOND);
return atechDateTime;
}
public static long toATechDate(long timeInMillis) {
GregorianCalendar gc = new GregorianCalendar();
gc.setTimeInMillis(timeInMillis);
return toATechDate(gc);
}
/*
public static boolean isSameDay(LocalDateTime ldt1, LocalDateTime ldt2) {
return (ldt1.getYear() == ldt2.getYear() && //
ldt1.getMonthOfYear() == ldt2.getMonthOfYear() && //
ldt1.getDayOfMonth() == ldt2.getDayOfMonth());
}
*/
public static boolean isSameDay(long ldt1, long ldt2) {
long day1 = ldt1 / 10000L;
long day2 = ldt2 / 10000L;
return day1 == day2;
}
public static long toATechDate(int year, int month, int dayOfMonth, int hour, int minutes, int seconds) {
long atechDateTime = 0L;
atechDateTime += year * 10000000000L;
atechDateTime += month * 100000000L;
atechDateTime += dayOfMonth * 1000000L;
atechDateTime += hour * 10000L;
atechDateTime += minutes * 100L;
atechDateTime += seconds;
return atechDateTime;
}
// public static long toATechDate(Date date) {
//
// long atechDateTime = 0L;
//
// atechDateTime += (date.getYear() + 1900) * 10000000000L;
// atechDateTime += (date.getMonth() + 1) * 100000000L;
// atechDateTime += date.getDate() * 1000000L;
// atechDateTime += date.getHours() * 10000L;
// atechDateTime += date.getMinutes() * 100L;
// atechDateTime += date.getSeconds();
//
// return atechDateTime;
// }
public static String toString(long atechDateTime) {
int year = (int) (atechDateTime / 10000000000L);
atechDateTime -= year * 10000000000L;
int month = (int) (atechDateTime / 100000000L);
atechDateTime -= month * 100000000L;
int dayOfMonth = (int) (atechDateTime / 1000000L);
atechDateTime -= dayOfMonth * 1000000L;
int hourOfDay = (int) (atechDateTime / 10000L);
atechDateTime -= hourOfDay * 10000L;
int minute = (int) (atechDateTime / 100L);
atechDateTime -= minute * 100L;
int second = (int) atechDateTime;
return getZeroPrefixed(dayOfMonth) + "." + getZeroPrefixed(month) + "." + year + " " + //
getZeroPrefixed(hourOfDay) + ":" + getZeroPrefixed(minute) + ":" + getZeroPrefixed(second);
}
public static String toString(GregorianCalendar gc) {
return getZeroPrefixed(gc.get(Calendar.DAY_OF_MONTH)) + "." + getZeroPrefixed(gc.get(Calendar.MONTH) + 1) + "."
+ gc.get(Calendar.YEAR) + " "
+ //
getZeroPrefixed(gc.get(Calendar.HOUR_OF_DAY)) + ":" + getZeroPrefixed(gc.get(Calendar.MINUTE)) + ":"
+ getZeroPrefixed(gc.get(Calendar.SECOND));
}
public static String toStringFromTimeInMillis(long timeInMillis) {
GregorianCalendar gc = new GregorianCalendar();
gc.setTimeInMillis(timeInMillis);
return toString(gc);
}
private static String getZeroPrefixed(int number) {
return (number < 10) ? "0" + number : "" + number;
}
public static int getYear(Long atechDateTime) {
if (atechDateTime == null || atechDateTime == 0) {
return 2000;
}
int year = (int) (atechDateTime / 10000000000L);
return year;
}
/*
public static boolean isSameDayATDAndMillis(long atechDateTime, long timeInMillis) {
GregorianCalendar dt = new GregorianCalendar();
dt.setTimeInMillis(timeInMillis);
long entryDate = toATechDate(dt);
return (isSameDay(atechDateTime, entryDate));
}
*/
public static long toMillisFromATD(long atechDateTime) {
GregorianCalendar gc = toGregorianCalendar(atechDateTime);
return gc.getTimeInMillis();
}
public static int getATechDateDifferenceAsMinutes(Long date1, Long date2) {
Minutes minutes = Minutes.minutesBetween(toLocalDateTime(date1), toLocalDateTime(date2));
return minutes.getMinutes();
}
public static int getATechDateDifferenceAsSeconds(Long date1, Long date2) {
Seconds seconds = Seconds.secondsBetween(toLocalDateTime(date1), toLocalDateTime(date2));
return seconds.getSeconds();
}
public static long getMillisFromATDWithAddedMinutes(long atd, int minutesDiff) {
GregorianCalendar oldestEntryTime = DateTimeUtil.toGregorianCalendar(atd);
oldestEntryTime.add(Calendar.MINUTE, minutesDiff);
return oldestEntryTime.getTimeInMillis();
}
public static long getATDWithAddedSeconds(Long atd, int addedSeconds) {
GregorianCalendar oldestEntryTime = DateTimeUtil.toGregorianCalendar(atd);
oldestEntryTime.add(Calendar.SECOND, addedSeconds);
return toATechDate(oldestEntryTime.getTimeInMillis());
}
/*
public static long getATDWithAddedMinutes(Long atd, int minutesDiff) {
GregorianCalendar oldestEntryTime = DateTimeUtil.toGregorianCalendar(atd);
oldestEntryTime.add(Calendar.MINUTE, minutesDiff);
return toATechDate(oldestEntryTime);
}
*/
public static long getATDWithAddedMinutes(GregorianCalendar oldestEntryTime, int minutesDiff) {
oldestEntryTime.add(Calendar.MINUTE, minutesDiff);
return toATechDate(oldestEntryTime);
}
/*
public static long getTimeInFutureFromMinutes(long startTime, int minutes) {
return startTime + getTimeInMs(minutes);
}
*/
public static long getTimeInFutureFromMinutes(int minutes) {
return System.currentTimeMillis() + getTimeInMs(minutes);
}
public static long getTimeInMs(int minutes) {
return getTimeInS(minutes) * 1000L;
}
public static int getTimeInS(int minutes) {
return minutes * 60;
}
}

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils
package app.aaps.core.utils
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "NOTHING_TO_INLINE")
inline fun Any.wait() = (this as Object).wait()

View file

@ -0,0 +1,212 @@
package app.aaps.core.utils
import org.joda.time.LocalDateTime
import org.joda.time.Minutes
import org.joda.time.Seconds
import java.util.Calendar
import java.util.GregorianCalendar
/*
* Created by andy on 10/25/18.
*/
/**
* This is simple version of ATechDate, limited only to one format (yyyymmddHHMIss)
*/
object DateTimeUtil {
/**
* DateTime is packed as long: yyyymmddHHMMss
*
* @param aTechDateTime
* @return
*/
fun toLocalDateTime(aTechDateTime: Long): LocalDateTime {
var dateTime = aTechDateTime
val year = (dateTime / 10000000000L).toInt()
dateTime -= year * 10000000000L
val month = (dateTime / 100000000L).toInt()
dateTime -= month * 100000000L
val dayOfMonth = (dateTime / 1000000L).toInt()
dateTime -= dayOfMonth * 1000000L
val hourOfDay = (dateTime / 10000L).toInt()
dateTime -= hourOfDay * 10000L
val minute = (dateTime / 100L).toInt()
dateTime -= minute * 100L
val second = dateTime.toInt()
return LocalDateTime(year, month, dayOfMonth, hourOfDay, minute, second)
}
/**
* DateTime is packed as long: yyyymmddHHMMss
*
* @param aTechDateTime
* @return
*/
private fun toGregorianCalendar(aTechDateTime: Long): GregorianCalendar {
var dateTime = aTechDateTime
val year = (dateTime / 10000000000L).toInt()
dateTime -= year * 10000000000L
val month = (dateTime / 100000000L).toInt()
dateTime -= month * 100000000L
val dayOfMonth = (dateTime / 1000000L).toInt()
dateTime -= dayOfMonth * 1000000L
val hourOfDay = (dateTime / 10000L).toInt()
dateTime -= hourOfDay * 10000L
val minute = (dateTime / 100L).toInt()
dateTime -= minute * 100L
val second = dateTime.toInt()
return GregorianCalendar(year, month - 1, dayOfMonth, hourOfDay, minute, second)
}
fun toATechDate(ldt: LocalDateTime): Long {
var aTechDateTime = 0L
aTechDateTime += ldt.year * 10000000000L
aTechDateTime += ldt.monthOfYear * 100000000L
aTechDateTime += ldt.dayOfMonth * 1000000L
aTechDateTime += ldt.hourOfDay * 10000L
aTechDateTime += ldt.minuteOfHour * 100L
aTechDateTime += ldt.secondOfMinute.toLong()
return aTechDateTime
}
fun toATechDate(gc: GregorianCalendar): Long {
var aTechDateTime = 0L
aTechDateTime += gc[Calendar.YEAR] * 10000000000L
aTechDateTime += (gc[Calendar.MONTH] + 1) * 100000000L
aTechDateTime += gc[Calendar.DAY_OF_MONTH] * 1000000L
aTechDateTime += gc[Calendar.HOUR_OF_DAY] * 10000L
aTechDateTime += gc[Calendar.MINUTE] * 100L
aTechDateTime += gc[Calendar.SECOND].toLong()
return aTechDateTime
}
@JvmStatic fun toATechDate(timeInMillis: Long): Long {
val gc = GregorianCalendar()
gc.setTimeInMillis(timeInMillis)
return toATechDate(gc)
}
/*
public static boolean isSameDay(LocalDateTime ldt1, LocalDateTime ldt2) {
return (ldt1.getYear() == ldt2.getYear() && //
ldt1.getMonthOfYear() == ldt2.getMonthOfYear() && //
ldt1.getDayOfMonth() == ldt2.getDayOfMonth());
}
*/
fun isSameDay(ldt1: Long, ldt2: Long): Boolean {
val day1 = ldt1 / 10000L
val day2 = ldt2 / 10000L
return day1 == day2
}
fun toATechDate(year: Int, month: Int, dayOfMonth: Int, hour: Int, minutes: Int, seconds: Int): Long {
var aTechDateTime = 0L
aTechDateTime += year * 10000000000L
aTechDateTime += month * 100000000L
aTechDateTime += dayOfMonth * 1000000L
aTechDateTime += hour * 10000L
aTechDateTime += minutes * 100L
aTechDateTime += seconds.toLong()
return aTechDateTime
}
fun toString(aTechDateTime: Long): String {
var dateTime = aTechDateTime
val year = (dateTime / 10000000000L).toInt()
dateTime -= year * 10000000000L
val month = (dateTime / 100000000L).toInt()
dateTime -= month * 100000000L
val dayOfMonth = (dateTime / 1000000L).toInt()
dateTime -= dayOfMonth * 1000000L
val hourOfDay = (dateTime / 10000L).toInt()
dateTime -= hourOfDay * 10000L
val minute = (dateTime / 100L).toInt()
dateTime -= minute * 100L
val second = dateTime.toInt()
return getZeroPrefixed(dayOfMonth) + "." + getZeroPrefixed(month) + "." + year + " " + //
getZeroPrefixed(hourOfDay) + ":" + getZeroPrefixed(minute) + ":" + getZeroPrefixed(second)
}
fun toString(gc: GregorianCalendar): String {
return (getZeroPrefixed(gc[Calendar.DAY_OF_MONTH]) + "." + getZeroPrefixed(gc[Calendar.MONTH] + 1) + "."
+ gc[Calendar.YEAR] + " "
+ //
getZeroPrefixed(gc[Calendar.HOUR_OF_DAY]) + ":" + getZeroPrefixed(gc[Calendar.MINUTE]) + ":"
+ getZeroPrefixed(gc[Calendar.SECOND]))
}
@JvmStatic fun toStringFromTimeInMillis(timeInMillis: Long): String {
val gc = GregorianCalendar()
gc.setTimeInMillis(timeInMillis)
return toString(gc)
}
private fun getZeroPrefixed(number: Int): String {
return if (number < 10) "0$number" else "" + number
}
fun getYear(aTechDateTime: Long?): Int {
return if (aTechDateTime == null || aTechDateTime == 0L) {
2000
} else (aTechDateTime / 10000000000L).toInt()
}
fun toMillisFromATD(aTechDateTime: Long): Long {
val gc = toGregorianCalendar(aTechDateTime)
return gc.getTimeInMillis()
}
fun getATechDateDifferenceAsMinutes(date1: Long, date2: Long): Int {
val minutes = Minutes.minutesBetween(toLocalDateTime(date1), toLocalDateTime(date2))
return minutes.minutes
}
fun getATechDateDifferenceAsSeconds(date1: Long, date2: Long): Int {
val seconds = Seconds.secondsBetween(toLocalDateTime(date1), toLocalDateTime(date2))
return seconds.seconds
}
fun getMillisFromATDWithAddedMinutes(atd: Long, minutesDiff: Int): Long {
val oldestEntryTime = toGregorianCalendar(atd)
oldestEntryTime.add(Calendar.MINUTE, minutesDiff)
return oldestEntryTime.getTimeInMillis()
}
fun getATDWithAddedSeconds(atd: Long, addedSeconds: Int): Long {
val oldestEntryTime = toGregorianCalendar(atd)
oldestEntryTime.add(Calendar.SECOND, addedSeconds)
return toATechDate(oldestEntryTime.getTimeInMillis())
}
/*
public static long getATDWithAddedMinutes(Long atd, int minutesDiff) {
GregorianCalendar oldestEntryTime = DateTimeUtil.toGregorianCalendar(atd);
oldestEntryTime.add(Calendar.MINUTE, minutesDiff);
return toATechDate(oldestEntryTime);
}
*/
fun getATDWithAddedMinutes(oldestEntryTime: GregorianCalendar, minutesDiff: Int): Long {
oldestEntryTime.add(Calendar.MINUTE, minutesDiff)
return toATechDate(oldestEntryTime)
}
/*
public static long getTimeInFutureFromMinutes(long startTime, int minutes) {
return startTime + getTimeInMs(minutes);
}
*/
@JvmStatic fun getTimeInFutureFromMinutes(minutes: Int): Long {
return System.currentTimeMillis() + getTimeInMs(minutes)
}
private fun getTimeInMs(minutes: Int): Long {
return getTimeInS(minutes) * 1000L
}
private fun getTimeInS(minutes: Int): Int {
return minutes * 60
}
}

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils
package app.aaps.core.utils
@Synchronized
fun isRunningTest(): Boolean {

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils
package app.aaps.core.utils
import java.util.Locale

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils
package app.aaps.core.utils
import android.text.Html
import android.text.SpannableStringBuilder

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils
package app.aaps.core.utils
import org.json.JSONException
import org.json.JSONObject

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils
package app.aaps.core.utils
import org.joda.time.DateTime

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils
package app.aaps.core.utils
import kotlin.math.floor

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils.extensions
package app.aaps.core.utils.extensions
import android.bluetooth.BluetoothAdapter
import android.os.SystemClock

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils.extensions
package app.aaps.core.utils.extensions
import android.content.Intent
import java.io.Serializable

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils.extensions
package app.aaps.core.utils.extensions
import android.os.Bundle
import androidx.work.Data

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils.fabric
package app.aaps.core.utils.fabric
import com.google.firebase.installations.FirebaseInstallations

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils.receivers
package app.aaps.core.utils.receivers
import android.content.Context
import android.os.Bundle

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils.receivers
package app.aaps.core.utils.receivers
/**
* class contains useful String functions

View file

@ -1,4 +1,4 @@
package info.nightscout.core.utils.worker
package app.aaps.core.utils.worker
import androidx.work.OneTimeWorkRequest
import androidx.work.WorkContinuation

View file

@ -1,7 +1,6 @@
package app.aaps.core.utils
import com.google.common.truth.Truth.assertThat
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
import org.junit.jupiter.api.Test

View file

@ -1,7 +1,6 @@
package app.aaps.core.utils.receivers
import com.google.common.truth.Truth.assertThat
import info.nightscout.core.utils.receivers.StringUtils
import org.junit.jupiter.api.Test
class StringUtilsTest {

View file

@ -1,7 +1,7 @@
package app.aaps.pump.common.utils
import app.aaps.core.utils.DateTimeUtil
import com.google.common.truth.Truth.assertThat
import info.nightscout.core.utils.DateTimeUtil
import org.junit.jupiter.api.Test
internal class DateTimeUtilUTest {

View file

@ -1,8 +1,6 @@
package info.nightscout.implementation.profile
import androidx.collection.ArrayMap
import app.aaps.core.main.extensions.pureProfileFromJson
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.plugin.ActivePlugin
@ -12,8 +10,10 @@ import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.HardLimits
import app.aaps.core.main.extensions.pureProfileFromJson
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.JsonHelper
import org.json.JSONException
import org.json.JSONObject
import javax.inject.Inject

View file

@ -14,7 +14,7 @@ import androidx.core.content.ContextCompat
import app.aaps.core.interfaces.pump.BlePreCheck
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.ui.dialogs.OKDialog
import info.nightscout.core.utils.extensions.safeEnable
import app.aaps.core.utils.extensions.safeEnable
import javax.inject.Inject
import javax.inject.Singleton

View file

@ -8,11 +8,6 @@ import android.os.SystemClock
import android.text.Spanned
import androidx.appcompat.app.AppCompatActivity
import app.aaps.annotations.OpenForTesting
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.events.EventNewNotification
import app.aaps.core.main.extensions.getCustomizedName
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.interfaces.androidPermissions.AndroidPermission
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.constraints.ConstraintsChecker
@ -43,8 +38,13 @@ import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.ui.UiInteraction
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.events.EventNewNotification
import app.aaps.core.main.extensions.getCustomizedName
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.utils.HtmlHelper
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.HtmlHelper
import info.nightscout.database.ValueWrapper
import info.nightscout.database.entities.EffectiveProfileSwitch
import info.nightscout.database.entities.ProfileSwitch

View file

@ -20,8 +20,8 @@ import app.aaps.core.interfaces.rx.events.EventQueueChanged
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.T
import app.aaps.core.ui.R
import info.nightscout.core.utils.extensions.safeDisable
import info.nightscout.core.utils.extensions.safeEnable
import app.aaps.core.utils.extensions.safeDisable
import app.aaps.core.utils.extensions.safeEnable
class QueueThread internal constructor(
private val queue: CommandQueue,

View file

@ -14,8 +14,8 @@ import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.receivers.ReceiverStatusStore
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.events.EventNetworkChange
import app.aaps.core.utils.receivers.StringUtils
import dagger.android.DaggerBroadcastReceiver
import info.nightscout.core.utils.receivers.StringUtils
import javax.inject.Inject
class NetworkChangeReceiver : DaggerBroadcastReceiver() {

View file

@ -1,7 +1,6 @@
package info.nightscout.implementation.userEntry
import android.text.Spanned
import app.aaps.core.main.R
import app.aaps.core.interfaces.configuration.Constants
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.profile.ProfileUtil
@ -10,8 +9,9 @@ import app.aaps.core.interfaces.userEntry.UserEntryPresentationHelper
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import app.aaps.core.interfaces.utils.Translator
import app.aaps.core.main.R
import app.aaps.core.utils.HtmlHelper
import dagger.Reusable
import info.nightscout.core.utils.HtmlHelper
import info.nightscout.database.entities.UserEntry
import info.nightscout.database.entities.UserEntry.Action
import info.nightscout.database.entities.UserEntry.ColorGroup

View file

@ -23,6 +23,7 @@ import javax.inject.Inject;
import app.aaps.core.interfaces.logging.AAPSLogger;
import app.aaps.core.interfaces.logging.LTag;
import app.aaps.core.interfaces.resources.ResourceHelper;
import app.aaps.core.utils.HtmlHelper;
import dagger.android.DaggerService;
import info.nightscout.androidaps.plugins.pump.insight.activities.InsightAlertActivity;
import info.nightscout.androidaps.plugins.pump.insight.app_layer.remote_control.ConfirmAlertMessage;
@ -37,7 +38,6 @@ import info.nightscout.androidaps.plugins.pump.insight.exceptions.InsightExcepti
import info.nightscout.androidaps.plugins.pump.insight.exceptions.app_layer_errors.AppLayerErrorException;
import info.nightscout.androidaps.plugins.pump.insight.utils.AlertUtils;
import info.nightscout.androidaps.plugins.pump.insight.utils.ExceptionTranslator;
import info.nightscout.core.utils.HtmlHelper;
public class InsightAlertService extends DaggerService implements InsightConnectionService.StateCallback {

View file

@ -16,13 +16,13 @@ import androidx.core.content.ContextCompat;
import javax.inject.Inject;
import app.aaps.core.utils.HtmlHelper;
import dagger.android.support.DaggerAppCompatActivity;
import info.nightscout.androidaps.insight.R;
import info.nightscout.androidaps.plugins.pump.insight.InsightAlertService;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.Alert;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.AlertStatus;
import info.nightscout.androidaps.plugins.pump.insight.utils.AlertUtils;
import info.nightscout.core.utils.HtmlHelper;
public class InsightAlertActivity extends DaggerAppCompatActivity {

View file

@ -34,13 +34,13 @@ import javax.inject.Inject;
import app.aaps.core.interfaces.pump.BlePreCheck;
import app.aaps.core.interfaces.pump.PumpSync;
import app.aaps.core.utils.extensions.BluetoothAdapterExtensionKt;
import app.aaps.core.utils.extensions.IntentExtensionKt;
import dagger.android.support.DaggerAppCompatActivity;
import info.nightscout.androidaps.insight.R;
import info.nightscout.androidaps.plugins.pump.insight.connection_service.InsightConnectionService;
import info.nightscout.androidaps.plugins.pump.insight.descriptors.InsightState;
import info.nightscout.androidaps.plugins.pump.insight.utils.ExceptionTranslator;
import info.nightscout.core.utils.extensions.BluetoothAdapterExtensionKt;
import info.nightscout.core.utils.extensions.IntentExtensionKt;
public class InsightPairingActivity extends DaggerAppCompatActivity implements InsightConnectionService.StateCallback, View.OnClickListener, InsightConnectionService.ExceptionCallback {

View file

@ -8,7 +8,7 @@ import java.io.IOException;
import java.lang.reflect.Method;
import java.util.UUID;
import info.nightscout.core.utils.extensions.BluetoothAdapterExtensionKt;
import app.aaps.core.utils.extensions.BluetoothAdapterExtensionKt;
public class ConnectionEstablisher extends Thread {

View file

@ -1,8 +1,6 @@
package info.nightscout.plugins.aps
import android.text.Spanned
import app.aaps.core.main.extensions.convertedToAbsolute
import app.aaps.core.main.extensions.convertedToPercent
import app.aaps.core.interfaces.aps.APSResult
import app.aaps.core.interfaces.constraints.Constraint
import app.aaps.core.interfaces.constraints.ConstraintsChecker
@ -17,9 +15,11 @@ import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import dagger.android.HasAndroidInjector
import app.aaps.core.main.extensions.convertedToAbsolute
import app.aaps.core.main.extensions.convertedToPercent
import app.aaps.core.ui.R
import info.nightscout.core.utils.HtmlHelper
import app.aaps.core.utils.HtmlHelper
import dagger.android.HasAndroidInjector
import info.nightscout.database.entities.GlucoseValue
import org.json.JSONException
import org.json.JSONObject

View file

@ -12,9 +12,6 @@ import android.view.ViewGroup
import androidx.core.view.MenuCompat
import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.pump.toHtml
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.interfaces.aps.Loop
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.resources.ResourceHelper
@ -24,9 +21,12 @@ import app.aaps.core.interfaces.rx.events.EventLoopUpdateGui
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.pump.toHtml
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.utils.HtmlHelper
import dagger.android.HasAndroidInjector
import dagger.android.support.DaggerFragment
import info.nightscout.core.utils.HtmlHelper
import info.nightscout.plugins.aps.R
import info.nightscout.plugins.aps.databinding.LoopFragmentBinding
import info.nightscout.plugins.aps.loop.events.EventLoopSetLastRunGui

View file

@ -2,9 +2,6 @@ package info.nightscout.plugins.aps.openAPSAMA
import android.content.Context
import app.aaps.annotations.OpenForTesting
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.extensions.target
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.interfaces.aps.APS
import app.aaps.core.interfaces.aps.AutosensResult
import app.aaps.core.interfaces.aps.DetermineBasalAdapter
@ -28,8 +25,11 @@ import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.HardLimits
import app.aaps.core.interfaces.utils.Round
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.extensions.target
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.utils.MidnightUtils
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.MidnightUtils
import info.nightscout.database.ValueWrapper
import info.nightscout.database.impl.AppRepository
import info.nightscout.plugins.aps.OpenAPSFragment

View file

@ -3,8 +3,6 @@ package info.nightscout.plugins.aps.openAPSSMB
import android.content.Context
import androidx.preference.PreferenceFragmentCompat
import androidx.preference.SwitchPreference
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.extensions.target
import app.aaps.core.interfaces.aps.APS
import app.aaps.core.interfaces.aps.AutosensResult
import app.aaps.core.interfaces.aps.DetermineBasalAdapter
@ -31,8 +29,10 @@ import app.aaps.core.interfaces.stats.TddCalculator
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.HardLimits
import app.aaps.core.interfaces.utils.Round
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.extensions.target
import app.aaps.core.utils.MidnightUtils
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.MidnightUtils
import info.nightscout.database.ValueWrapper
import info.nightscout.database.impl.AppRepository
import info.nightscout.plugins.aps.R

View file

@ -2,7 +2,7 @@ package info.nightscout.plugins.aps.utils
import android.text.Spanned
import app.aaps.core.interfaces.logging.AAPSLogger
import info.nightscout.core.utils.HtmlHelper
import app.aaps.core.utils.HtmlHelper
import org.json.JSONArray
import org.json.JSONException
import org.json.JSONObject

View file

@ -2,7 +2,7 @@ package info.nightscout.plugins.general.autotune
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.Round
import info.nightscout.core.utils.Percentile
import app.aaps.core.utils.Percentile
import info.nightscout.plugins.general.autotune.data.ATProfile
import info.nightscout.plugins.general.autotune.data.LocalInsulin
import info.nightscout.plugins.general.autotune.data.PreppedGlucose

View file

@ -1,10 +1,5 @@
package info.nightscout.plugins.general.autotune
import app.aaps.core.main.extensions.convertedToAbsolute
import app.aaps.core.main.extensions.durationInMinutes
import app.aaps.core.main.extensions.toJson
import app.aaps.core.main.extensions.toTemporaryBasal
import app.aaps.core.main.iob.round
import app.aaps.core.interfaces.configuration.Constants
import app.aaps.core.interfaces.iob.Iob
import app.aaps.core.interfaces.iob.IobTotal
@ -16,7 +11,12 @@ import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.Round
import app.aaps.core.interfaces.utils.T
import info.nightscout.core.utils.MidnightUtils
import app.aaps.core.main.extensions.convertedToAbsolute
import app.aaps.core.main.extensions.durationInMinutes
import app.aaps.core.main.extensions.toJson
import app.aaps.core.main.extensions.toTemporaryBasal
import app.aaps.core.main.iob.round
import app.aaps.core.utils.MidnightUtils
import info.nightscout.database.entities.Bolus
import info.nightscout.database.entities.Carbs
import info.nightscout.database.entities.ExtendedBolus

View file

@ -3,8 +3,6 @@
package info.nightscout.plugins.general.autotune
import android.view.View
import app.aaps.core.main.extensions.pureProfileFromJson
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.interfaces.autotune.Autotune
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.insulin.Insulin
@ -25,9 +23,11 @@ import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.MidnightTime
import app.aaps.core.interfaces.utils.T
import dagger.android.HasAndroidInjector
import app.aaps.core.main.extensions.pureProfileFromJson
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.ui.elements.WeekDay
import info.nightscout.core.utils.JsonHelper
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.database.entities.UserEntry
import info.nightscout.database.entities.ValueWithUnit
import info.nightscout.plugins.aps.R

View file

@ -1,8 +1,5 @@
package info.nightscout.plugins.general.autotune.data
import app.aaps.core.main.extensions.blockValueBySeconds
import app.aaps.core.main.extensions.pureProfileFromJson
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.insulin.Insulin
@ -21,8 +18,11 @@ import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.Round
import app.aaps.core.interfaces.utils.SafeParse
import app.aaps.core.interfaces.utils.T
import app.aaps.core.main.extensions.blockValueBySeconds
import app.aaps.core.main.extensions.pureProfileFromJson
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.utils.MidnightUtils
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.MidnightUtils
import info.nightscout.database.entities.data.Block
import org.json.JSONArray
import org.json.JSONException

View file

@ -1,13 +1,13 @@
package info.nightscout.plugins.general.autotune
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.profile.PureProfile
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.T
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.utils.JsonHelper
import app.aaps.shared.tests.TestBaseWithProfile
import com.google.common.truth.Truth.assertThat
import info.nightscout.core.utils.JsonHelper
import info.nightscout.database.entities.data.Block
import info.nightscout.database.entities.data.TargetBlock
import info.nightscout.plugins.general.autotune.data.ATProfile

View file

@ -1,7 +1,5 @@
package info.nightscout.plugins.general.autotune
import app.aaps.core.main.extensions.shiftBlock
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.iob.IobTotal
import app.aaps.core.interfaces.logging.AAPSLogger
@ -10,9 +8,11 @@ import app.aaps.core.interfaces.profile.PureProfile
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.T
import app.aaps.core.main.extensions.shiftBlock
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.utils.JsonHelper
import app.aaps.shared.tests.TestBaseWithProfile
import com.google.common.truth.Truth.assertThat
import info.nightscout.core.utils.JsonHelper
import info.nightscout.database.entities.Bolus
import info.nightscout.database.entities.Carbs
import info.nightscout.database.entities.GlucoseValue

View file

@ -22,13 +22,18 @@ import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.ItemTouchHelper
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import app.aaps.core.main.utils.ActionModeHelper
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.interfaces.extensions.toVisibility
import app.aaps.core.interfaces.logging.UserEntryLogger
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.rx.AapsSchedulers
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.main.utils.ActionModeHelper
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.ui.dialogs.OKDialog
import app.aaps.core.ui.dragHelpers.ItemTouchHelperAdapter
import app.aaps.core.ui.dragHelpers.OnStartDragListener
import app.aaps.core.ui.dragHelpers.SimpleItemTouchHelperCallback
import app.aaps.core.utils.HtmlHelper
import dagger.android.HasAndroidInjector
import dagger.android.support.DaggerFragment
import info.nightscout.automation.databinding.AutomationEventItemBinding
@ -37,11 +42,6 @@ import info.nightscout.automation.dialogs.EditEventDialog
import info.nightscout.automation.events.EventAutomationDataChanged
import info.nightscout.automation.events.EventAutomationUpdateGui
import info.nightscout.automation.triggers.TriggerConnector
import app.aaps.core.ui.dialogs.OKDialog
import app.aaps.core.ui.dragHelpers.ItemTouchHelperAdapter
import app.aaps.core.ui.dragHelpers.OnStartDragListener
import app.aaps.core.ui.dragHelpers.SimpleItemTouchHelperCallback
import info.nightscout.core.utils.HtmlHelper
import info.nightscout.database.entities.UserEntry.Action
import info.nightscout.database.entities.UserEntry.Sources
import io.reactivex.rxjava3.disposables.CompositeDisposable

View file

@ -8,13 +8,13 @@ import app.aaps.core.interfaces.pump.PumpEnactResult
import app.aaps.core.interfaces.queue.Callback
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.InputString
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.ui.TimerUtil
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
import javax.inject.Inject

View file

@ -2,7 +2,6 @@ package info.nightscout.automation.actions
import android.widget.LinearLayout
import androidx.annotation.DrawableRes
import app.aaps.core.main.extensions.fromConstant
import app.aaps.core.interfaces.iob.GlucoseStatusProvider
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.logging.UserEntryLogger
@ -11,13 +10,14 @@ import app.aaps.core.interfaces.queue.Callback
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.T
import app.aaps.core.main.extensions.fromConstant
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.automation.elements.InputCarePortalMenu
import info.nightscout.automation.elements.InputDuration
import info.nightscout.automation.elements.InputString
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.core.utils.JsonHelper
import info.nightscout.database.entities.TherapyEvent
import info.nightscout.database.entities.UserEntry
import info.nightscout.database.entities.ValueWithUnit

View file

@ -8,12 +8,12 @@ import app.aaps.core.interfaces.pump.PumpEnactResult
import app.aaps.core.interfaces.queue.Callback
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.events.EventRefreshOverview
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.InputDuration
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.core.utils.JsonHelper
import info.nightscout.database.entities.UserEntry
import info.nightscout.database.entities.UserEntry.Sources
import info.nightscout.database.entities.ValueWithUnit

View file

@ -2,18 +2,18 @@ package info.nightscout.automation.actions
import android.widget.LinearLayout
import androidx.annotation.DrawableRes
import app.aaps.core.main.events.EventNewNotification
import app.aaps.core.interfaces.notifications.NotificationUserMessage
import app.aaps.core.interfaces.pump.PumpEnactResult
import app.aaps.core.interfaces.queue.Callback
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.events.EventRefreshOverview
import app.aaps.core.main.events.EventNewNotification
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.InputString
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.core.utils.JsonHelper
import info.nightscout.database.impl.AppRepository
import info.nightscout.database.impl.transactions.InsertTherapyEventAnnouncementTransaction
import io.reactivex.rxjava3.disposables.CompositeDisposable

View file

@ -9,12 +9,12 @@ import app.aaps.core.interfaces.profile.ProfileFunction
import app.aaps.core.interfaces.pump.PumpEnactResult
import app.aaps.core.interfaces.queue.Callback
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.InputProfileName
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.core.utils.JsonHelper
import info.nightscout.database.entities.UserEntry
import info.nightscout.database.entities.UserEntry.Sources
import info.nightscout.database.entities.ValueWithUnit

View file

@ -7,6 +7,7 @@ import app.aaps.core.interfaces.logging.UserEntryLogger
import app.aaps.core.interfaces.profile.ProfileFunction
import app.aaps.core.interfaces.pump.PumpEnactResult
import app.aaps.core.interfaces.queue.Callback
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.Comparator
@ -15,7 +16,6 @@ import info.nightscout.automation.elements.InputPercent
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.triggers.TriggerProfilePercent
import info.nightscout.core.utils.JsonHelper
import info.nightscout.database.entities.UserEntry
import info.nightscout.database.entities.UserEntry.Sources
import info.nightscout.database.entities.ValueWithUnit

View file

@ -10,14 +10,14 @@ import app.aaps.core.interfaces.pump.PumpEnactResult
import app.aaps.core.interfaces.queue.Callback
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.ui.elements.WeekDay
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.automation.elements.InputDuration
import info.nightscout.automation.elements.InputProfileName
import info.nightscout.automation.elements.InputWeekDay
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import app.aaps.core.ui.elements.WeekDay
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
import javax.inject.Inject

View file

@ -4,12 +4,12 @@ import android.widget.LinearLayout
import app.aaps.core.interfaces.pump.PumpEnactResult
import app.aaps.core.interfaces.queue.Callback
import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.InputString
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
import javax.inject.Inject

View file

@ -2,7 +2,6 @@ package info.nightscout.automation.actions
import android.widget.LinearLayout
import androidx.annotation.DrawableRes
import app.aaps.core.main.extensions.friendlyDescription
import app.aaps.core.interfaces.configuration.Constants
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.logging.LTag
@ -13,6 +12,9 @@ import app.aaps.core.interfaces.profile.ProfileUtil
import app.aaps.core.interfaces.pump.PumpEnactResult
import app.aaps.core.interfaces.queue.Callback
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.main.extensions.friendlyDescription
import app.aaps.core.utils.JsonHelper
import app.aaps.core.utils.JsonHelper.safeGetDouble
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.ComparatorExists
@ -21,8 +23,6 @@ import info.nightscout.automation.elements.InputTempTarget
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.triggers.TriggerTempTarget
import info.nightscout.core.utils.JsonHelper
import info.nightscout.core.utils.JsonHelper.safeGetDouble
import info.nightscout.database.entities.TemporaryTarget
import info.nightscout.database.entities.UserEntry
import info.nightscout.database.entities.UserEntry.Sources

View file

@ -12,10 +12,10 @@ import androidx.fragment.app.FragmentManager
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.MidnightTime
import app.aaps.core.utils.MidnightUtils
import com.google.android.material.timepicker.MaterialTimePicker
import com.google.android.material.timepicker.TimeFormat
import info.nightscout.automation.R
import info.nightscout.core.utils.MidnightUtils
import java.util.Calendar
class InputTime(private val rh: ResourceHelper, private val dateUtil: DateUtil) : Element {

View file

@ -13,10 +13,10 @@ import androidx.fragment.app.FragmentManager
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.MidnightTime
import app.aaps.core.utils.MidnightUtils
import com.google.android.material.timepicker.MaterialTimePicker
import com.google.android.material.timepicker.TimeFormat
import info.nightscout.automation.R
import info.nightscout.core.utils.MidnightUtils
import java.util.Calendar
class InputTimeRange(private val rh: ResourceHelper, private val dateUtil: DateUtil) : Element {

View file

@ -2,6 +2,8 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper.safeGetDouble
import app.aaps.core.utils.JsonHelper.safeGetString
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -10,8 +12,6 @@ import info.nightscout.automation.elements.InputDouble
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper.safeGetDouble
import info.nightscout.core.utils.JsonHelper.safeGetString
import org.json.JSONObject
import java.text.DecimalFormat

View file

@ -9,6 +9,8 @@ import android.widget.LinearLayout
import androidx.core.app.ActivityCompat
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.rx.events.EventBTChange
import app.aaps.core.ui.toast.ToastUtils
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.AutomationPlugin
@ -17,8 +19,6 @@ import info.nightscout.automation.elements.ComparatorConnect
import info.nightscout.automation.elements.InputDropdownMenu
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import app.aaps.core.ui.toast.ToastUtils
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
import javax.inject.Inject

View file

@ -3,6 +3,7 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -11,7 +12,6 @@ import info.nightscout.automation.elements.InputBg
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
class TriggerBg(injector: HasAndroidInjector) : Trigger(injector) {

View file

@ -2,6 +2,8 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper
import app.aaps.core.utils.JsonHelper.safeGetString
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -10,8 +12,6 @@ import info.nightscout.automation.elements.InputDuration
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import info.nightscout.core.utils.JsonHelper.safeGetString
import info.nightscout.database.ValueWrapper
import info.nightscout.database.entities.Bolus
import org.json.JSONObject

View file

@ -2,6 +2,8 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper
import app.aaps.core.utils.JsonHelper.safeGetDouble
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -10,8 +12,6 @@ import info.nightscout.automation.elements.InputDouble
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import info.nightscout.core.utils.JsonHelper.safeGetDouble
import org.json.JSONObject
import java.text.DecimalFormat

View file

@ -9,12 +9,12 @@ import android.widget.TextView
import androidx.annotation.StringRes
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.ui.elements.VerticalTextView
import app.aaps.core.utils.JsonHelper.safeGetString
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.dialogs.ChooseOperationDialog
import app.aaps.core.ui.elements.VerticalTextView
import info.nightscout.core.utils.JsonHelper.safeGetString
import org.json.JSONArray
import org.json.JSONObject

View file

@ -3,6 +3,7 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -12,7 +13,6 @@ import info.nightscout.automation.elements.InputDelta.DeltaType
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
import java.text.DecimalFormat

View file

@ -3,6 +3,7 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import androidx.annotation.VisibleForTesting
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -11,7 +12,6 @@ import info.nightscout.automation.elements.InputDouble
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
import java.text.DecimalFormat

View file

@ -2,6 +2,7 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -10,7 +11,6 @@ import info.nightscout.automation.elements.InputInsulin
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
class TriggerIob(injector: HasAndroidInjector) : Trigger(injector) {

View file

@ -3,6 +3,7 @@ package info.nightscout.automation.triggers
import android.location.Location
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -13,7 +14,6 @@ import info.nightscout.automation.elements.InputString
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
import java.text.DecimalFormat

View file

@ -1,8 +1,9 @@
package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -11,7 +12,6 @@ import info.nightscout.automation.elements.InputPercent
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
class TriggerProfilePercent(injector: HasAndroidInjector) : Trigger(injector) {

View file

@ -2,6 +2,8 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper.safeGetInt
import app.aaps.core.utils.JsonHelper.safeGetString
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -10,8 +12,6 @@ import info.nightscout.automation.elements.InputDuration
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper.safeGetInt
import info.nightscout.core.utils.JsonHelper.safeGetString
import org.json.JSONObject
class TriggerPumpLastConnection(injector: HasAndroidInjector) : Trigger(injector) {

View file

@ -3,6 +3,9 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.utils.MidnightTime
import app.aaps.core.ui.elements.WeekDay
import app.aaps.core.utils.JsonHelper
import app.aaps.core.utils.MidnightUtils
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -10,9 +13,6 @@ import info.nightscout.automation.elements.InputTime
import info.nightscout.automation.elements.InputWeekDay
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import app.aaps.core.ui.elements.WeekDay
import info.nightscout.core.utils.JsonHelper
import info.nightscout.core.utils.MidnightUtils
import org.json.JSONObject
import java.util.Calendar
import java.util.Objects

View file

@ -2,13 +2,13 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.ComparatorExists
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import info.nightscout.database.ValueWrapper
import org.json.JSONObject

View file

@ -3,6 +3,7 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -11,7 +12,6 @@ import info.nightscout.automation.elements.InputBg
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import info.nightscout.database.ValueWrapper
import org.json.JSONObject

View file

@ -3,13 +3,13 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.utils.T
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.InputDateTime
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
class TriggerTime(injector: HasAndroidInjector) : Trigger(injector) {

View file

@ -3,14 +3,14 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.utils.MidnightTime
import app.aaps.core.utils.JsonHelper.safeGetInt
import app.aaps.core.utils.MidnightUtils
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
import info.nightscout.automation.elements.InputTimeRange
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper.safeGetInt
import info.nightscout.core.utils.MidnightUtils
import org.json.JSONObject
// Trigger for time range ( from 10:00AM till 13:00PM )

View file

@ -3,6 +3,7 @@ package info.nightscout.automation.triggers
import android.widget.LinearLayout
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.receivers.ReceiverStatusStore
import app.aaps.core.utils.JsonHelper
import com.google.common.base.Optional
import dagger.android.HasAndroidInjector
import info.nightscout.automation.R
@ -11,7 +12,6 @@ import info.nightscout.automation.elements.InputString
import info.nightscout.automation.elements.LabelWithElement
import info.nightscout.automation.elements.LayoutBuilder
import info.nightscout.automation.elements.StaticLabel
import info.nightscout.core.utils.JsonHelper
import org.json.JSONObject
import javax.inject.Inject

View file

@ -9,8 +9,6 @@ import androidx.core.text.toSpanned
import app.aaps.configuration.R
import app.aaps.configuration.databinding.MaintenanceFragmentBinding
import app.aaps.configuration.maintenance.activities.LogSettingActivity
import app.aaps.core.main.graph.OverviewData
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.interfaces.db.PersistenceLayer
import app.aaps.core.interfaces.extensions.runOnUiThread
import app.aaps.core.interfaces.extensions.toVisibility
@ -30,9 +28,11 @@ import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.events.EventPreferenceChange
import app.aaps.core.interfaces.sync.DataSyncSelectorXdrip
import app.aaps.core.interfaces.ui.UiInteraction
import dagger.android.support.DaggerFragment
import app.aaps.core.main.graph.OverviewData
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.ui.dialogs.OKDialog
import info.nightscout.core.utils.HtmlHelper
import app.aaps.core.utils.HtmlHelper
import dagger.android.support.DaggerFragment
import info.nightscout.database.entities.UserEntry.Action
import info.nightscout.database.entities.UserEntry.Sources
import io.reactivex.rxjava3.core.Completable

View file

@ -6,7 +6,7 @@ import androidx.activity.result.contract.ActivityResultContract
import androidx.fragment.app.FragmentActivity
import app.aaps.configuration.maintenance.activities.PrefImportListActivity
import app.aaps.core.interfaces.maintenance.PrefsFile
import info.nightscout.core.utils.extensions.safeGetParcelableExtra
import app.aaps.core.utils.extensions.safeGetParcelableExtra
class PrefsFileContract : ActivityResultContract<Void?, PrefsFile?>() {

View file

@ -9,14 +9,14 @@ import app.aaps.configuration.maintenance.data.PrefMetadataMap
import app.aaps.configuration.maintenance.data.Prefs
import app.aaps.configuration.maintenance.data.PrefsFormat
import app.aaps.configuration.maintenance.data.PrefsStatusImpl
import app.aaps.core.main.utils.CryptoUtil
import app.aaps.core.interfaces.maintenance.PrefMetadata
import app.aaps.core.interfaces.maintenance.PrefsMetadataKey
import app.aaps.core.interfaces.maintenance.PrefsStatus
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.storage.Storage
import info.nightscout.core.utils.hexStringToByteArray
import info.nightscout.core.utils.toHex
import app.aaps.core.main.utils.CryptoUtil
import app.aaps.core.utils.hexStringToByteArray
import app.aaps.core.utils.toHex
import org.json.JSONException
import org.json.JSONObject
import java.io.File

View file

@ -20,8 +20,6 @@ import app.aaps.configuration.setupwizard.elements.SWInfoText
import app.aaps.configuration.setupwizard.elements.SWPlugin
import app.aaps.configuration.setupwizard.elements.SWPreference
import app.aaps.configuration.setupwizard.elements.SWRadioButton
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.main.utils.CryptoUtil
import app.aaps.core.interfaces.androidPermissions.AndroidPermission
import app.aaps.core.interfaces.aps.Loop
import app.aaps.core.interfaces.configuration.Config
@ -46,8 +44,10 @@ import app.aaps.core.interfaces.rx.events.EventSWUpdate
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.ui.UiInteraction
import app.aaps.core.interfaces.utils.HardLimits
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.main.utils.CryptoUtil
import app.aaps.core.utils.isRunningTest
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.isRunningTest
import javax.inject.Inject
import javax.inject.Singleton

View file

@ -16,7 +16,6 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.LinearSmoothScroller
import androidx.recyclerview.widget.RecyclerView
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.UserEntryLogger
import app.aaps.core.interfaces.receivers.ReceiverStatusStore
@ -27,9 +26,10 @@ import app.aaps.core.interfaces.rx.events.EventNtpStatus
import app.aaps.core.interfaces.rx.events.EventSWUpdate
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import dagger.android.support.DaggerFragment
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.ui.dialogs.OKDialog
import info.nightscout.core.utils.HtmlHelper
import app.aaps.core.utils.HtmlHelper
import dagger.android.support.DaggerFragment
import info.nightscout.database.entities.UserEntry.Action
import info.nightscout.database.entities.UserEntry.Sources
import info.nightscout.database.entities.ValueWithUnit

View file

@ -24,13 +24,6 @@ import android.widget.RelativeLayout
import android.widget.TextView
import androidx.core.text.toSpanned
import androidx.recyclerview.widget.LinearLayoutManager
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.extensions.directionToIcon
import app.aaps.core.main.graph.OverviewData
import app.aaps.core.main.iob.displayText
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.main.wizard.QuickWizard
import app.aaps.core.interfaces.aps.Loop
import app.aaps.core.interfaces.aps.VariableSensitivityResult
import app.aaps.core.interfaces.automation.Automation
@ -83,14 +76,21 @@ import app.aaps.core.interfaces.ui.UiInteraction
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import app.aaps.core.interfaces.utils.TrendCalculator
import com.jjoe64.graphview.GraphView
import dagger.android.HasAndroidInjector
import dagger.android.support.DaggerFragment
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.extensions.directionToIcon
import app.aaps.core.main.graph.OverviewData
import app.aaps.core.main.iob.displayText
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.main.wizard.QuickWizard
import app.aaps.core.ui.UIRunnable
import app.aaps.core.ui.dialogs.OKDialog
import app.aaps.core.ui.elements.SingleClickButton
import app.aaps.core.ui.toast.ToastUtils
import info.nightscout.core.utils.JsonHelper
import app.aaps.core.utils.JsonHelper
import com.jjoe64.graphview.GraphView
import dagger.android.HasAndroidInjector
import dagger.android.support.DaggerFragment
import info.nightscout.database.entities.UserEntry.Action
import info.nightscout.database.entities.UserEntry.Sources
import info.nightscout.database.entities.interfaces.end

View file

@ -4,14 +4,14 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.interfaces.rx.AapsSchedulers
import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.smsCommunicator.Sms
import app.aaps.core.interfaces.smsCommunicator.SmsCommunicator
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.utils.HtmlHelper
import dagger.android.support.DaggerFragment
import info.nightscout.core.utils.HtmlHelper
import info.nightscout.plugins.databinding.SmscommunicatorFragmentBinding
import info.nightscout.plugins.general.smsCommunicator.events.EventSmsCommunicatorUpdateGui
import io.reactivex.rxjava3.disposables.CompositeDisposable

View file

@ -10,12 +10,6 @@ import androidx.preference.PreferenceFragmentCompat
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import app.aaps.annotations.OpenForTesting
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.events.EventNewNotification
import app.aaps.core.main.iob.generateCOBString
import app.aaps.core.main.iob.round
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.interfaces.aps.ApsMode
import app.aaps.core.interfaces.aps.Loop
import app.aaps.core.interfaces.configuration.Config
@ -52,8 +46,14 @@ import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import app.aaps.core.interfaces.utils.SafeParse
import app.aaps.core.interfaces.utils.T
import app.aaps.core.main.constraints.ConstraintObject
import app.aaps.core.main.events.EventNewNotification
import app.aaps.core.main.iob.generateCOBString
import app.aaps.core.main.iob.round
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.utils.receivers.DataWorkerStorage
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.receivers.DataWorkerStorage
import info.nightscout.core.validators.ValidatingEditTextPreference
import info.nightscout.database.entities.OfflineEvent
import info.nightscout.database.entities.TemporaryTarget

View file

@ -2,9 +2,6 @@ package info.nightscout.plugins.profile
import androidx.fragment.app.FragmentActivity
import app.aaps.annotations.OpenForTesting
import app.aaps.core.main.extensions.blockFromJsonArray
import app.aaps.core.main.extensions.pureProfileFromJson
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.configuration.Constants
import app.aaps.core.interfaces.db.GlucoseUnit
@ -30,10 +27,13 @@ import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.DecimalFormatter
import app.aaps.core.interfaces.utils.HardLimits
import dagger.android.HasAndroidInjector
import app.aaps.core.main.extensions.blockFromJsonArray
import app.aaps.core.main.extensions.pureProfileFromJson
import app.aaps.core.main.profile.ProfileSealed
import app.aaps.core.ui.dialogs.OKDialog
import app.aaps.core.ui.toast.ToastUtils
import info.nightscout.core.utils.JsonHelper
import app.aaps.core.utils.JsonHelper
import dagger.android.HasAndroidInjector
import info.nightscout.plugins.R
import org.json.JSONArray
import org.json.JSONException

View file

@ -13,9 +13,9 @@ import app.aaps.core.interfaces.profile.ProfileFunction
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.utils.MidnightUtils
import app.aaps.core.utils.Percentile
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.MidnightUtils
import info.nightscout.core.utils.Percentile
import info.nightscout.database.entities.TherapyEvent
import info.nightscout.database.impl.AppRepository
import info.nightscout.sensitivity.extensions.isPSEvent5minBack

View file

@ -16,9 +16,9 @@ import app.aaps.core.interfaces.profile.ProfileFunction
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.utils.MidnightUtils
import app.aaps.core.utils.Percentile
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.MidnightUtils
import info.nightscout.core.utils.Percentile
import info.nightscout.database.entities.TherapyEvent
import info.nightscout.database.impl.AppRepository
import info.nightscout.sensitivity.extensions.isPSEvent5minBack

View file

@ -14,8 +14,8 @@ import app.aaps.core.interfaces.profile.ProfileFunction
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.sharedPreferences.SP
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.utils.MidnightUtils
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.MidnightUtils
import info.nightscout.database.entities.TherapyEvent
import info.nightscout.database.impl.AppRepository
import info.nightscout.sensitivity.extensions.isPSEvent5minBack

View file

@ -3,7 +3,6 @@ package info.nightscout.source
import android.content.Context
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.configuration.Constants
import app.aaps.core.interfaces.logging.AAPSLogger
@ -14,8 +13,9 @@ import app.aaps.core.interfaces.plugin.PluginType
import app.aaps.core.interfaces.receivers.Intents
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.source.BgSource
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.utils.receivers.DataWorkerStorage
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.receivers.DataWorkerStorage
import info.nightscout.database.entities.GlucoseValue
import info.nightscout.database.impl.AppRepository
import info.nightscout.database.impl.transactions.CgmSourceTransaction

View file

@ -6,8 +6,6 @@ import android.content.pm.PackageManager
import androidx.core.content.ContextCompat
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import app.aaps.core.main.extensions.fromConstant
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
@ -22,9 +20,11 @@ import app.aaps.core.interfaces.source.BgSource
import app.aaps.core.interfaces.source.DexcomBoyda
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.interfaces.utils.T
import app.aaps.core.main.extensions.fromConstant
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.utils.receivers.DataWorkerStorage
import app.aaps.shared.impl.extensions.safeGetInstalledPackages
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.receivers.DataWorkerStorage
import info.nightscout.database.entities.GlucoseValue
import info.nightscout.database.entities.TherapyEvent
import info.nightscout.database.entities.UserEntry.Action

View file

@ -3,7 +3,6 @@ package info.nightscout.source
import android.content.Context
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.plugin.PluginBase
@ -12,8 +11,9 @@ import app.aaps.core.interfaces.plugin.PluginType
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.source.BgSource
import app.aaps.core.interfaces.utils.DateUtil
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.utils.receivers.DataWorkerStorage
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.receivers.DataWorkerStorage
import info.nightscout.database.entities.GlucoseValue
import info.nightscout.database.entities.TherapyEvent
import info.nightscout.database.impl.AppRepository

View file

@ -3,7 +3,6 @@ package info.nightscout.source
import android.content.Context
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.interfaces.configuration.Constants
import app.aaps.core.interfaces.db.GlucoseUnit
import app.aaps.core.interfaces.logging.AAPSLogger
@ -13,8 +12,9 @@ import app.aaps.core.interfaces.plugin.PluginDescription
import app.aaps.core.interfaces.plugin.PluginType
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.source.BgSource
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.utils.JsonHelper.safeGetString
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.JsonHelper.safeGetString
import info.nightscout.database.entities.GlucoseValue
import info.nightscout.database.impl.AppRepository
import info.nightscout.database.impl.transactions.CgmSourceTransaction

View file

@ -13,8 +13,8 @@ import app.aaps.core.interfaces.pump.VirtualPump
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.source.BgSource
import app.aaps.core.interfaces.utils.T
import app.aaps.core.utils.isRunningTest
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.isRunningTest
import info.nightscout.database.entities.GlucoseValue
import info.nightscout.database.impl.AppRepository
import info.nightscout.database.impl.transactions.CgmSourceTransaction

View file

@ -3,7 +3,6 @@ package info.nightscout.source
import android.content.Context
import androidx.work.WorkerParameters
import androidx.work.workDataOf
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.interfaces.logging.AAPSLogger
import app.aaps.core.interfaces.logging.LTag
import app.aaps.core.interfaces.plugin.PluginBase
@ -13,8 +12,9 @@ import app.aaps.core.interfaces.receivers.Intents
import app.aaps.core.interfaces.resources.ResourceHelper
import app.aaps.core.interfaces.source.BgSource
import app.aaps.core.interfaces.source.XDripSource
import app.aaps.core.main.utils.worker.LoggingWorker
import app.aaps.core.utils.receivers.DataWorkerStorage
import dagger.android.HasAndroidInjector
import info.nightscout.core.utils.receivers.DataWorkerStorage
import info.nightscout.database.entities.GlucoseValue
import info.nightscout.database.impl.AppRepository
import info.nightscout.database.impl.transactions.CgmSourceTransaction

View file

@ -1,7 +1,7 @@
package info.nightscout.plugins.sync.nsShared
import app.aaps.core.interfaces.nsclient.NSAlarm
import info.nightscout.core.utils.JsonHelper
import app.aaps.core.utils.JsonHelper
import org.json.JSONObject
class NSAlarmObject(private var data: JSONObject) : NSAlarm {

View file

@ -16,7 +16,6 @@ import androidx.core.view.MenuProvider
import androidx.lifecycle.Lifecycle
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.interfaces.configuration.Config
import app.aaps.core.interfaces.db.PersistenceLayer
import app.aaps.core.interfaces.logging.AAPSLogger
@ -31,9 +30,10 @@ import app.aaps.core.interfaces.rx.bus.RxBus
import app.aaps.core.interfaces.rx.events.EventNSClientNewLog
import app.aaps.core.interfaces.rx.events.EventNSClientRestart
import app.aaps.core.interfaces.sharedPreferences.SP
import dagger.android.support.DaggerFragment
import app.aaps.core.main.utils.fabric.FabricPrivacy
import app.aaps.core.ui.dialogs.OKDialog
import info.nightscout.core.utils.HtmlHelper
import app.aaps.core.utils.HtmlHelper
import dagger.android.support.DaggerFragment
import info.nightscout.database.entities.UserEntry
import info.nightscout.plugins.sync.R
import info.nightscout.plugins.sync.databinding.NsClientFragmentBinding

View file

@ -1,7 +1,7 @@
package info.nightscout.plugins.sync.nsShared
import app.aaps.core.interfaces.nsclient.NSSgv
import info.nightscout.core.utils.JsonHelper
import app.aaps.core.utils.JsonHelper
import org.json.JSONObject
/**

Some files were not shown because too many files have changed in this diff Show more