Skip to content

Commit

Permalink
Merge pull request #3056 from nightscout/prepare3.2.0.2
Browse files Browse the repository at this point in the history
3.2.0.2
  • Loading branch information
MilosKozak authored Nov 12, 2023
2 parents aeed6e2 + bb44c4d commit c31617f
Show file tree
Hide file tree
Showing 212 changed files with 1,471 additions and 1,110 deletions.
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
/local.properties
.DS_Store
*/jacoco.exec
*/output-metadata.json
/build
/captures
*.apk
Expand All @@ -19,6 +20,9 @@ app/.classpath
app/.settings/org.eclipse.buildship.core.prefs
wear/.classpath
wear/.settings/org.eclipse.buildship.core.prefs
app/nsclient/*
app/nsclient2/*
app/aapsclient/*
app/aapsclient2/*
app/pumpcontrol/*
wear/aapsclient/*
wear/aapsclient2/*
wear/pumpcontrol/*
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ class UiInteractionImpl @Inject constructor(
rxBus.send(EventNewNotification(Notification(id, System.currentTimeMillis(), text, level, validTo)))
}

override fun addNotificationWithAction(injector: HasAndroidInjector, nsAlarm: NSAlarm) {
override fun addNotificationWithAction(nsAlarm: NSAlarm) {
rxBus.send(EventNewNotification(NotificationWithAction(injector, nsAlarm)))
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/app/aaps/receivers/DataReceiver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ open class DataReceiver : DaggerBroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
super.onReceive(context, intent)
val bundle = intent.extras ?: return
aapsLogger.debug(LTag.DATABASE, "onReceive ${intent.action} ${BundleLogger.log(bundle)}")
aapsLogger.debug(LTag.CORE, "onReceive ${intent.action} ${BundleLogger.log(bundle)}")

when (intent.action) {
Intents.ACTION_NEW_BG_ESTIMATE ->
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/res/values-lt-rLT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
<string name="nav_about">Apie</string>
<string name="smscommunicator_missingphonestatepermission">Trūksta telefono būsenos leidimo</string>
<string name="ns_alarm_options">Aliarmų nustatymai</string>
<string name="ns_alarms">Sukurti pranešimus iš NS aliarmų</string>
<string name="ns_announcements">Sukurkite pranešimus iš NS perspėjimų</string>
<string name="ns_alarms">Kurti pranešimus iš NS aliarmų</string>
<string name="ns_announcements">Kurti pranešimus iš NS perspėjimų</string>
<string name="ns_alarm_stale_data_value_label">Seni duomenys, riba [min]</string>
<string name="ns_alarm_urgent_stale_data_value_label">Kritiškai seni duomenys, riba [min]</string>
<string name="sensitivity_warning">Įjungę Autosens funkciją nepamirškite įvedinėti visus valgomus angliavandenius. To nedarant, angliavandenių sukeliami glikemijos svyravimai bus klaidingai identifikuojami kaip jautrumo pasikeitimai!</string>
Expand Down Expand Up @@ -48,7 +48,7 @@
<string name="clear_filter">Valyti filtrą</string>
<string name="cannula">Kaniulė</string>
<string name="email_address">El. pašto adresas</string>
<string name="remove_bg_readings">Pašalinti KG duomenis</string>
<string name="remove_bg_readings">Pašalinti glikemijos duomenis</string>
<string name="identification_not_set">Kūrėjo režime tapatybė nenustatyta</string>
<string name="a11y_dialog">dialogas</string>
<!-- WEAR OS-->
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:8.1.2")
classpath("com.android.tools.build:gradle:8.1.3")
classpath("com.google.gms:google-services:4.4.0")
classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9")

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
object KtsBuildVersions {

const val gradle = "8.1.2"
const val gradle = "8.1.3"
const val kotlin = "1.9.0"
}

Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import org.gradle.api.JavaVersion

object Versions {

const val appVersion = "3.2.0.1"
const val appVersion = "3.2.0.2"
const val versionCode = 1500

const val ndkVersion = "21.1.6352462"
Expand All @@ -15,4 +15,4 @@ object Versions {

val javaVersion = JavaVersion.VERSION_11
const val jacoco = "0.8.11"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface PrefFileListProvider {
fun newExportFile(): File
fun newExportCsvFile(): File
fun newCwfFile(filename: String, withDate: Boolean = true): File
fun listPreferenceFiles(loadMetadata: Boolean = false): MutableList<PrefsFile>
fun listPreferenceFiles(): MutableList<PrefsFile>
fun listCustomWatchfaceFiles(): MutableList<CwfFile>
fun checkMetadata(metadata: Map<PrefsMetadataKey, PrefMetadata>): Map<PrefsMetadataKey, PrefMetadata>
fun formatExportedAgo(utcTime: String): String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ data class PrefsFile(
val name: String,
val file: File,
val baseDir: File,
val dirKind: PrefsImportDir,

// metadata here is used only for list display
val metadata: @RawValue Map<PrefsMetadataKey, PrefMetadata>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ open class Notification {
const val PUMP_TIMEZONE_UPDATE_FAILED = 85
const val BLUETOOTH_NOT_SUPPORTED = 86
const val PUMP_WARNING = 87
const val PUMP_SYNC_ERROR = 88
const val SMB_FALLBACK = 89

const val USER_MESSAGE = 1000

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package app.aaps.core.interfaces.nsclient

import android.text.Spanned
import app.aaps.core.interfaces.aps.APSResult
import dagger.android.HasAndroidInjector
import org.json.JSONObject

interface ProcessedDeviceStatusData {
Expand Down Expand Up @@ -61,7 +60,7 @@ interface ProcessedDeviceStatusData {
val extendedOpenApsStatus: Spanned
val openApsStatus: Spanned
val openApsTimestamp: Long
fun getAPSResult(injector: HasAndroidInjector): APSResult
fun getAPSResult(): APSResult
val uploaderStatus: String
val uploaderStatusSpanned: Spanned
val extendedUploaderStatus: Spanned
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class PumpDescription() {
var pumpType = PumpType.GENERIC_AAPS
var isBolusCapable = false
var bolusStep = 0.0
var isExtendedBolusCapable = false
var isExtendedBolusCapable = true
var extendedBolusStep = 0.0
var extendedBolusDurationStep = 0.0
var extendedBolusMaxDuration = 0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ class EventNetworkChange(
var ssid: String = "",
var roaming: Boolean = false,
var metered: Boolean = false
) : Event()
) : Event() {
val isAnyConnection : Boolean
get() = mobileConnected || wifiConnected
}
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@ enum class JsonKeys(val key: String) {
DYNPREF("dynPref"),
DYNPREFCOLOR("dynPrefColor"),
PREFKEY("prefKey"),
INVALIDTOPOFFSET("invalidTopOffset"),
INVALIDLEFTOFFSET("invalidLeftOffset"),
INVALIDROTATIONOFFSET("invalidRotationOffset"),
DEFAULT("default")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.annotation.RawRes
import androidx.annotation.StringRes
import androidx.fragment.app.FragmentManager
import app.aaps.core.interfaces.nsclient.NSAlarm
import dagger.android.HasAndroidInjector

/**
* Interface to use activities located in different modules
Expand Down Expand Up @@ -73,7 +72,7 @@ interface UiInteraction {
fun addNotificationValidFor(id: Int, text: String, level: Int, validMinutes: Int)
fun addNotificationWithSound(id: Int, text: String, level: Int, @RawRes soundId: Int?)
fun addNotificationValidTo(id: Int, date: Long, text: String, level: Int, validTo: Long)
fun addNotificationWithAction(injector: HasAndroidInjector, nsAlarm: NSAlarm)
fun addNotificationWithAction(nsAlarm: NSAlarm)
fun addNotificationWithAction(id: Int, text: String, level: Int, buttonText: Int, action: Runnable, @RawRes soundId: Int? = null, date: Long = System.currentTimeMillis())
fun showToastAndNotification(ctx: Context?, string: String?, @RawRes soundID: Int)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,64 +1,86 @@
package app.aaps.core.interfaces.utils

import android.util.LongSparseArray
import java.util.Calendar
import androidx.annotation.VisibleForTesting
import java.time.Instant
import java.time.LocalDateTime
import java.time.LocalTime
import java.time.ZoneId

object MidnightTime {

@VisibleForTesting
val times = LongSparseArray<Long>()

private var hits: Long = 0
private var misses: Long = 0
private const val THRESHOLD = 100000

fun calc(): Long {
val c = Calendar.getInstance()
c[Calendar.HOUR_OF_DAY] = 0
c[Calendar.MINUTE] = 0
c[Calendar.SECOND] = 0
c[Calendar.MILLISECOND] = 0
return c.timeInMillis
}
/**
* Epoch time of last midnight
*
* @return epoch millis
*/
fun calc(): Long =
LocalDateTime.now().atZone(ZoneId.systemDefault())
.with(LocalTime.of(0, 0, 0, 0))
.toInstant().toEpochMilli()

fun calcPlusMinutes(minutes: Int): Long {
val h = minutes / 60
/**
* Today's time with 'minutes' from midnight
*
* @param minutes minutes to add
* @return epoch millis of today with hh:mm:00
*/
fun calcMidnightPlusMinutes(minutes: Int): Long {
val h = (minutes / 60) % 24
val m = minutes % 60
val c = Calendar.getInstance()
c[Calendar.HOUR_OF_DAY] = h
c[Calendar.MINUTE] = m
c[Calendar.SECOND] = 0
c[Calendar.MILLISECOND] = 0
return c.timeInMillis
return LocalDateTime.now().atZone(ZoneId.systemDefault())
.with(LocalTime.of(h, m, 0, 0))
.toInstant().toEpochMilli()
}

/**
* Epoch time of last midnight before 'time'
*
* @param time time of the day
* @return epoch millis
*/
fun calc(time: Long): Long {
var m: Long?
synchronized(times) {
m = times[time]
if (m != null) {
++hits
return m!!
}
val c = Calendar.getInstance()
c.timeInMillis = time
c[Calendar.HOUR_OF_DAY] = 0
c[Calendar.MINUTE] = 0
c[Calendar.SECOND] = 0
c[Calendar.MILLISECOND] = 0
m = c.timeInMillis
times.append(time, m)
++misses
val m = times[time] ?: Instant.ofEpochMilli(time).atZone(ZoneId.systemDefault())
.with(LocalTime.of(0, 0, 0, 0))
.toInstant().toEpochMilli()
if (times.size() > THRESHOLD) resetCache()
return m
}
return m!!
}

/**
* Epoch time of last midnight 'days' back
*
* @param daysBack how many days back
* @return epoch millis of midnight
*/
fun calcDaysBack(daysBack: Long): Long =
LocalDateTime.now().atZone(ZoneId.systemDefault())
.with(LocalTime.of(0, 0, 0, 0))
.minusDays(daysBack)
.toInstant().toEpochMilli()

/**
* Epoch time of last midnight 'days' back from time
*
* @param time start time
* @param daysBack how many days back
* @return epoch millis of midnight
*/
fun calcDaysBack(time: Long, daysBack: Long): Long =
Instant.ofEpochMilli(time).atZone(ZoneId.systemDefault())
.with(LocalTime.of(0, 0, 0, 0))
.minusDays(daysBack)
.toInstant().toEpochMilli()

@VisibleForTesting
fun resetCache() {
hits = 0
misses = 0
times.clear()
}

fun log(): String =
"Hits: " + hits + " misses: " + misses + " stored: " + times.size()
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package app.aaps.core.interfaces.utils

import app.aaps.core.interfaces.aps.AutosensDataStore
import app.aaps.core.interfaces.iob.InMemoryGlucoseValue
import app.aaps.database.entities.GlucoseValue

/**
Expand All @@ -10,22 +9,6 @@ import app.aaps.database.entities.GlucoseValue
*/
interface TrendCalculator {

/**
* Provide or calculate trend
*
* @param glucoseValue BG
* @return TrendArrow
*/
fun getTrendArrow(glucoseValue: GlucoseValue?): GlucoseValue.TrendArrow

/**
* Provide or calculate trend
*
* @param glucoseValue BG
* @return TrendArrow
*/
fun getTrendArrow(glucoseValue: InMemoryGlucoseValue?): GlucoseValue.TrendArrow

/**
* Provide or calculate trend from newest bucketed data
*
Expand All @@ -34,14 +17,6 @@ interface TrendCalculator {
*/
fun getTrendArrow(autosensDataStore: AutosensDataStore): GlucoseValue.TrendArrow?

/**
* Provide or calculate trend
*
* @param glucoseValue BG
* @return string description of TrendArrow
*/
fun getTrendDescription(glucoseValue: GlucoseValue?): String

/**
* Provide or calculate trend from newest bucketed data
*
Expand Down
3 changes: 3 additions & 0 deletions core/interfaces/src/main/res/values-it-rIT/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
<string name="pref_show_bgi">Mostra BGI</string>
<string name="pref_show_direction_arrow">Mostra frecce direzionali</string>
<string name="pref_show_ago">Mostra Indietro</string>
<string name="pref_show_week_number">Mostra numeri della settimana</string>
<string name="pref_show_date">Mostra la data</string>
<string name="default_custom_watchface_comment">Watchface predefinita, puoi fare click sul tasto ESPORTA WATCHFACE per generare un template</string>
<string name="wear_default_watchface">Watchface predefinita</string>
<string name="cwf_comment_background">Immagine sfondo</string>
Expand All @@ -83,6 +85,7 @@
<string name="cwf_comment_timePeriod">AM o PM</string>
<string name="cwf_comment_day_name">Nome del giorno della settimana</string>
<string name="cwf_comment_day">Giorno (DD)</string>
<string name="cwf_comment_week_number">Numero settimana (ww)</string>
<string name="cwf_comment_month">Nome del mese (breve)</string>
<string name="cwf_comment_loop">Stato loop e indietro</string>
<string name="cwf_comment_direction">Freccia direzionale</string>
Expand Down
Loading

0 comments on commit c31617f

Please sign in to comment.