From a857309add1bc73bfb31c14c55107342ae5d124a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 19 Jul 2022 22:35:47 +0200 Subject: [PATCH 01/18] 3.1.0-dev-a --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 6a6c42c982..16ccd87365 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -105,7 +105,7 @@ android { defaultConfig { multiDexEnabled true versionCode 1500 - version "3.1.0" + version "3.1.0-dev-a" buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"' buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' From 2b47c804638fda519eab74fe93192c2d1542ab08 Mon Sep 17 00:00:00 2001 From: osodebailar Date: Wed, 20 Jul 2022 12:55:09 +0200 Subject: [PATCH 02/18] fix white theme crash --- core/src/main/res/values-night/styles.xml | 8 ++++++++ core/src/main/res/values/styles.xml | 8 ++++++++ .../main/res/layout/pump_history_activity.xml | 2 +- pump-common/src/main/res/values/styles.xml | 18 ------------------ 4 files changed, 17 insertions(+), 19 deletions(-) delete mode 100644 pump-common/src/main/res/values/styles.xml diff --git a/core/src/main/res/values-night/styles.xml b/core/src/main/res/values-night/styles.xml index 7e98c75fcd..3a9fe781b5 100644 --- a/core/src/main/res/values-night/styles.xml +++ b/core/src/main/res/values-night/styles.xml @@ -246,6 +246,14 @@ @color/white @color/white + + @style/CommonSpinnerItemStyle + + + + + + + diff --git a/pump-common/src/main/res/layout/pump_history_activity.xml b/pump-common/src/main/res/layout/pump_history_activity.xml index e5f3c4a1c7..0202071a6f 100755 --- a/pump-common/src/main/res/layout/pump_history_activity.xml +++ b/pump-common/src/main/res/layout/pump_history_activity.xml @@ -29,7 +29,7 @@ android:textAppearance="?android:attr/textAppearanceSmall" /> - - - - - - - - - From af50342db574f9d498397b5dd6e848507d2b9d09 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 20 Jul 2022 13:09:40 +0200 Subject: [PATCH 03/18] New translations strings.xml (Russian) --- pump-common/src/main/res/values-ru-rRU/strings.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pump-common/src/main/res/values-ru-rRU/strings.xml b/pump-common/src/main/res/values-ru-rRU/strings.xml index f6655e4645..af4479ba5b 100644 --- a/pump-common/src/main/res/values-ru-rRU/strings.xml +++ b/pump-common/src/main/res/values-ru-rRU/strings.xml @@ -40,7 +40,19 @@ Сегодня За прошедший час За прошедшие 3 часа + За прошедшие 6 часов + За прошедшие 12 часов + За прошедшие 2 дня + За прошедшие 4 дня + За прошедшую неделю + За прошлый месяц + Сканирование + Прервать + Выбрано + Сканирование + Сканирование завершено + Ошибка сканирования: %1$d From d14bc49dc0f706e75c636d4bcf9370143674da67 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 20 Jul 2022 14:30:35 +0200 Subject: [PATCH 04/18] fix warning --- .idea/dictionaries/project_dictionary.xml | 13 ++++++++++++- .../plugins/pump/medtronic/MedtronicPumpPlugin.kt | 1 + 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.idea/dictionaries/project_dictionary.xml b/.idea/dictionaries/project_dictionary.xml index 79a1572acb..2e08ebd897 100644 --- a/.idea/dictionaries/project_dictionary.xml +++ b/.idea/dictionaries/project_dictionary.xml @@ -3,9 +3,11 @@ aaps abcdef + accu acked actionstring aidex + alarmack allowednumbers androidaps autosens @@ -26,11 +28,15 @@ carbsreq careportal cellnovo + chek + clearalarm crashlytics danar danars dataset datasets + dbadd + dbupdate devicestatus devicestatuses devslope @@ -39,12 +45,14 @@ diaconn enteredby enteredinsulin + eopatch eveningoutpost eversense extendedbolus fileprovider firebase glimp + glunovo gson hmac iage @@ -79,12 +87,14 @@ pred profileswitch pumpbtcomm + pumpcontrol quickwizard readstatus realduration refresheventsfromnightscout rileylink roboelectric + rozman sgvs shortgramm sitechange @@ -108,7 +118,8 @@ tirs totp tunedays - uart + uart + urgentalarm wizzardpage xdrip xstream diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt index dd43c9bf3f..551a06f862 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicPumpPlugin.kt @@ -341,6 +341,7 @@ class MedtronicPumpPlugin @Inject constructor( val refreshTypesNeededToReschedule: MutableSet = mutableSetOf() for ((key, value) in statusRefresh) { if (value > 0 && System.currentTimeMillis() > value) { + @Suppress("WHEN_ENUM_CAN_BE_NULL_IN_JAVA") when (key) { MedtronicStatusRefreshType.PumpHistory -> { readPumpHistory() From 381708fe1115a8af999707d049432534a8f6e211 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 20 Jul 2022 16:48:38 +0200 Subject: [PATCH 05/18] hide disabled plugins --- .../aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt | 1 + .../androidaps/plugins/general/autotune/AutotunePlugin.kt | 1 + 2 files changed, 2 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt index f3978aacf1..ea2d85eeaa 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/aps/openAPSSMBDynamicISF/OpenAPSSMBDynamicISFPlugin.kt @@ -68,6 +68,7 @@ class OpenAPSSMBDynamicISFPlugin @Inject constructor( .shortName(R.string.dynisf_shortname) .preferencesId(R.xml.pref_openapssmbdynamicisf) .setDefault(false) + .showInList(buildHelper.isEngineeringMode() && buildHelper.isDev()) } override fun specialEnableCondition(): Boolean = buildHelper.isEngineeringMode() && buildHelper.isDev() diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotunePlugin.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotunePlugin.kt index 6a4f3d6a94..38c9781de6 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotunePlugin.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/autotune/AutotunePlugin.kt @@ -61,6 +61,7 @@ class AutotunePlugin @Inject constructor( .pluginName(R.string.autotune) .shortName(R.string.autotune_shortname) .preferencesId(R.xml.pref_autotune) + .showInList(buildHelper.isEngineeringMode() && buildHelper.isDev()) .description(R.string.autotune_description), aapsLogger, resourceHelper, injector ), Autotune { From 9e4864e93c7abd725abe35bf414a126c8eff6e5b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Wed, 20 Jul 2022 16:58:03 +0200 Subject: [PATCH 06/18] lints --- .../androidaps/plugins/pump/medtronic/util/MedtronicConst.kt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.kt b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.kt index e88d3de97f..8d86bce696 100644 --- a/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.kt +++ b/medtronic/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/util/MedtronicConst.kt @@ -18,20 +18,17 @@ object MedtronicConst { val BolusDelay = R.string.key_medtronic_bolus_delay val Encoding = R.string.key_medtronic_encoding val BatteryType = R.string.key_medtronic_battery_type - val BolusDebugEnabled = R.string.key_medtronic_bolus_debug } object Statistics { - const val StatsPrefix = "medtronic_" + private const val StatsPrefix = "medtronic_" const val FirstPumpStart = Prefix + "first_pump_use" const val LastGoodPumpCommunicationTime = Prefix + "lastGoodPumpCommunicationTime" - const val LastGoodPumpFrequency = Prefix + "LastGoodPumpFrequency" const val TBRsSet = StatsPrefix + "tbrs_set" const val StandardBoluses = StatsPrefix + "std_boluses_delivered" const val SMBBoluses = StatsPrefix + "smb_boluses_delivered" const val LastPumpHistoryEntry = StatsPrefix + "pump_history_entry" const val LastPrime = StatsPrefix + "last_sent_prime" const val LastRewind = StatsPrefix + "last_sent_rewind" - const val InternalTemporaryDatabase = StatsPrefix + "temporary_entries" } } \ No newline at end of file From c555dd693fb38ab4d208e34e4fce3bbe3e4495ed Mon Sep 17 00:00:00 2001 From: Sergey Zorchenko Date: Wed, 20 Jul 2022 18:20:30 +0300 Subject: [PATCH 07/18] fix popup menu in historybrowser --- .../androidaps/plugins/general/overview/OverviewMenus.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt index e388adb8bf..baa764d2bd 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/OverviewMenus.kt @@ -134,8 +134,8 @@ class OverviewMenus @Inject constructor( val item = popup.menu.add(Menu.NONE, m.ordinal + 100 * (g + 1), Menu.NONE, rh.gs(m.nameId)) val title = item.title val s = SpannableString(" $title ") - s.setSpan(ForegroundColorSpan(rh.gac(context, m.attrTextId)), 0, s.length, 0) - s.setSpan(BackgroundColorSpan(rh.gac(context, m.attrId)), 0, s.length, 0) + s.setSpan(ForegroundColorSpan(rh.gac(m.attrTextId)), 0, s.length, 0) + s.setSpan(BackgroundColorSpan(rh.gac(m.attrId)), 0, s.length, 0) item.title = s item.isCheckable = true item.isChecked = settingsCopy[g][m.ordinal] From e4d36c9fca5996dde17d64dd8cc077b7e5b02818 Mon Sep 17 00:00:00 2001 From: miyeongkim Date: Thu, 21 Jul 2022 16:05:47 +0900 Subject: [PATCH 08/18] add SerialNumInquirePacket.kt fix time difference error ble waitmilis time change --- .../androidaps/diaconn/DiaconnG8Pump.kt | 4 +- .../diaconn/di/DiaconnG8PacketModule.kt | 2 + .../packet/AppConfirmSettingResponsePacket.kt | 4 + .../DiaconnG8ResponseMessageHashTable.kt | 3 +- .../diaconn/packet/SerialNumInquirePacket.kt | 29 +++++++ .../packet/SerialNumInquireResponsePacket.kt | 69 ++++++++++++++++ .../packet/TimeInquireResponsePacket.kt | 16 ++-- .../diaconn/service/BLECommonService.kt | 7 +- .../diaconn/service/DiaconnG8Service.kt | 82 +++++++++---------- .../src/main/res/values-ko-rKR/strings.xml | 2 + diaconn/src/main/res/values/strings.xml | 2 +- 11 files changed, 167 insertions(+), 53 deletions(-) create mode 100644 diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquirePacket.kt create mode 100644 diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquireResponsePacket.kt diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt index fcb383fa8c..897723f2ec 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/DiaconnG8Pump.kt @@ -19,7 +19,9 @@ class DiaconnG8Pump @Inject constructor( private val aapsLogger: AAPSLogger, private val dateUtil: DateUtil ) { - + //var bleResultInfo: Pair = Pair(null, false) + var bolusConfirmMessage: Byte = 0 + var isReadyToBolus: Boolean = false var maxBolusePerDay: Double = 0.0 var pumpIncarnationNum: Int = 65536 var isPumpVersionGe2_63: Boolean = false // is pumpVersion higher then 2.63 diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/di/DiaconnG8PacketModule.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/di/DiaconnG8PacketModule.kt index 86a27374ce..49ec0d9f30 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/di/DiaconnG8PacketModule.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/di/DiaconnG8PacketModule.kt @@ -77,6 +77,8 @@ abstract class DiaconnG8PacketModule { @ContributesAndroidInjector abstract fun contributesLanguageInquireResponsePacket(): LanguageInquireResponsePacket @ContributesAndroidInjector abstract fun contributesBigAPSMainInfoInquirePacket(): BigAPSMainInfoInquirePacket @ContributesAndroidInjector abstract fun contributesBigAPSMainInfoInquireResponsePacket(): BigAPSMainInfoInquireResponsePacket + @ContributesAndroidInjector abstract fun contributesSerialNumInquirePacket(): SerialNumInquirePacket + @ContributesAndroidInjector abstract fun contributesSerialNumInquireResponsePacket(): SerialNumInquireResponsePacket } diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppConfirmSettingResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppConfirmSettingResponsePacket.kt index d45f174bf3..9f41cfde1b 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppConfirmSettingResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/AppConfirmSettingResponsePacket.kt @@ -35,6 +35,10 @@ class AppConfirmSettingResponsePacket( failed = true return } + // The bolus progress diallog opens only when the confirm result is successfull + if(diaconnG8Pump.bolusConfirmMessage == 0x07.toByte()) { + diaconnG8Pump.isReadyToBolus = true + } } override fun getFriendlyName(): String { diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DiaconnG8ResponseMessageHashTable.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DiaconnG8ResponseMessageHashTable.kt index 7248d73530..e401d465a8 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DiaconnG8ResponseMessageHashTable.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/DiaconnG8ResponseMessageHashTable.kt @@ -25,7 +25,6 @@ class DiaconnG8ResponseMessageHashTable @Inject constructor(val injector: HasAnd put(SneckLimitInquireResponsePacket(injector)) put(BasalLimitInquireResponsePacket(injector)) put(TempBasalInquireResponsePacket(injector)) - put(TimeInquirePacket(injector)) put(TimeInquireResponsePacket(injector)) put(TimeReportPacket(injector)) put(LogStatusInquireResponsePacket(injector)) @@ -34,6 +33,8 @@ class DiaconnG8ResponseMessageHashTable @Inject constructor(val injector: HasAnd put(SoundInquireResponsePacket(injector)) put(DisplayTimeInquireResponsePacket(injector)) put(LanguageInquireResponsePacket(injector)) + put(SerialNumInquireResponsePacket(injector)) + // Report Packet put(BasalPauseReportPacket(injector)) diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquirePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquirePacket.kt new file mode 100644 index 0000000000..0284c35029 --- /dev/null +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquirePacket.kt @@ -0,0 +1,29 @@ +package info.nightscout.androidaps.diaconn.packet + +import dagger.android.HasAndroidInjector +import info.nightscout.androidaps.diaconn.DiaconnG8Pump +import info.nightscout.shared.logging.LTag +import javax.inject.Inject + +/** + + * SerialNumInquirePacket + */ +class SerialNumInquirePacket( + injector: HasAndroidInjector +) : DiaconnG8Packet(injector ) { + @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + init { + msgType = 0x6E + aapsLogger.debug(LTag.PUMPCOMM, "SeialNumInquirePacket init") + } + + override fun encode(msgSeq:Int): ByteArray { + val buffer = prefixEncode(msgType, msgSeq, MSG_CON_END) + return suffixEncode(buffer) + } + + override fun getFriendlyName(): String { + return "PUMP_SERIAL_NUM_INQUIRE" + } +} \ No newline at end of file diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquireResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquireResponsePacket.kt new file mode 100644 index 0000000000..76306e54fa --- /dev/null +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/SerialNumInquireResponsePacket.kt @@ -0,0 +1,69 @@ +package info.nightscout.androidaps.diaconn.packet + +import dagger.android.HasAndroidInjector +import info.nightscout.androidaps.diaconn.DiaconnG8Pump +import info.nightscout.androidaps.diaconn.R +import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.shared.logging.LTag +import info.nightscout.shared.sharedPreferences.SP +import javax.inject.Inject + +/** + * SerialNumInquireResponsePacket + */ +class SerialNumInquireResponsePacket(injector: HasAndroidInjector) : DiaconnG8Packet(injector ) { + + @Inject lateinit var diaconnG8Pump: DiaconnG8Pump + @Inject lateinit var sp: SP + @Inject lateinit var rh: ResourceHelper + + + init { + msgType = 0xAE.toByte() + aapsLogger.debug(LTag.PUMPCOMM, "SerialNumInquireResponsePacket init") + } + + override fun handleMessage(data: ByteArray?) { + val result = defect(data) + if (result != 0) { + aapsLogger.debug(LTag.PUMPCOMM, "SerialNumInquireResponsePacket Got some Error") + failed = true + return + } else failed = false + + val bufferData = prefixDecode(data) + val result2 = getByteToInt(bufferData) + if(!isSuccInquireResponseResult(result2)) { + failed = true + return + } + + diaconnG8Pump.country = getByteToInt(bufferData).toChar().toString().toInt() // ASCII + diaconnG8Pump.productType = getByteToInt(bufferData).toChar().toString().toInt() // ASCII + diaconnG8Pump.makeYear = getByteToInt(bufferData) + diaconnG8Pump.makeMonth = getByteToInt(bufferData) + diaconnG8Pump.makeDay = getByteToInt(bufferData) + diaconnG8Pump.lotNo = getByteToInt(bufferData)// LOT NO + diaconnG8Pump.serialNo = getShortToInt(bufferData) + diaconnG8Pump.majorVersion = getByteToInt(bufferData) + diaconnG8Pump.minorVersion = getByteToInt(bufferData) + + + aapsLogger.debug(LTag.PUMPCOMM, "Result --> ${diaconnG8Pump.result}") + aapsLogger.debug(LTag.PUMPCOMM, "country --> ${diaconnG8Pump.country}") + aapsLogger.debug(LTag.PUMPCOMM, "productType --> ${diaconnG8Pump.productType}") + aapsLogger.debug(LTag.PUMPCOMM, "makeYear --> ${diaconnG8Pump.makeYear}") + aapsLogger.debug(LTag.PUMPCOMM, "makeMonth --> ${diaconnG8Pump.makeMonth}") + aapsLogger.debug(LTag.PUMPCOMM, "makeDay --> ${diaconnG8Pump.makeDay}") + aapsLogger.debug(LTag.PUMPCOMM, "lotNo --> ${diaconnG8Pump.lotNo}") + aapsLogger.debug(LTag.PUMPCOMM, "serialNo --> ${diaconnG8Pump.serialNo}") + aapsLogger.debug(LTag.PUMPCOMM, "majorVersion --> ${diaconnG8Pump.majorVersion}") + aapsLogger.debug(LTag.PUMPCOMM, "minorVersion --> ${diaconnG8Pump.minorVersion}") + + sp.putString(rh.gs(R.string.pumpversion), diaconnG8Pump.majorVersion.toString() + "." + diaconnG8Pump.minorVersion.toString()) + } + + override fun getFriendlyName(): String { + return "PUMP_SERIAL_NUM_INQUIRE_RESPONSE" + } +} \ No newline at end of file diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TimeInquireResponsePacket.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TimeInquireResponsePacket.kt index 6b7882196c..a2f88429b5 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TimeInquireResponsePacket.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/packet/TimeInquireResponsePacket.kt @@ -15,24 +15,30 @@ class TimeInquireResponsePacket( @Inject lateinit var diaconnG8Pump: DiaconnG8Pump init { - msgType = 0x50.toByte() + msgType = 0x8F.toByte() aapsLogger.debug(LTag.PUMPCOMM, "TimeInquireResponsePacket init") } override fun handleMessage(data: ByteArray?) { - val result = defect(data) - if (result != 0) { + val defectCheck = defect(data) + if (defectCheck != 0) { aapsLogger.debug(LTag.PUMPCOMM, "TimeInquireResponsePacket Got some Error") failed = true return } else failed = false val bufferData = prefixDecode(data) - val result2 = getByteToInt(bufferData) - if(!isSuccInquireResponseResult(result2)) { + val result = getByteToInt(bufferData) + if(!isSuccInquireResponseResult(result)) { failed = true return } + diaconnG8Pump.year = getByteToInt(bufferData) + 2000 // 년 (18~99) + diaconnG8Pump.month = getByteToInt(bufferData) // 월 (1~12) + diaconnG8Pump.day = getByteToInt(bufferData) // 일 (1~31) + diaconnG8Pump.hour = getByteToInt(bufferData) // 시 (0~23) + diaconnG8Pump.minute = getByteToInt(bufferData) // 분 (0~59) + diaconnG8Pump.second = getByteToInt(bufferData) // 초 (0~59) } override fun getFriendlyName(): String { diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt index 9c9d48a0fa..a86e3ded15 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt @@ -133,6 +133,9 @@ class BLECommonService @Inject internal constructor( aapsLogger.debug(LTag.PUMPBTCOMM, "onServicesDiscovered") if (status == BluetoothGatt.GATT_SUCCESS) { findCharacteristic() + SystemClock.sleep(1600) + isConnected = true + isConnecting = false } } @@ -206,6 +209,7 @@ class BLECommonService @Inject internal constructor( uartIndicate = gattCharacteristic //setCharacteristicNotification(uartIndicate, true) bluetoothGatt?.setCharacteristicNotification(uartIndicate, true) + // nRF Connect 참고하여 추가함 val descriptor: BluetoothGattDescriptor = uartIndicate!!.getDescriptor(UUID.fromString(CHARACTERISTIC_CONFIG_UUID)) descriptor.value = BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE @@ -223,8 +227,6 @@ class BLECommonService @Inject internal constructor( aapsLogger.debug(LTag.PUMPBTCOMM, "onConnectionStateChange newState : $newState") if (newState == BluetoothProfile.STATE_CONNECTED) { gatt.discoverServices() - isConnected = true - isConnecting = false rxBus.send(EventPumpStatusChanged(EventPumpStatusChanged.Status.CONNECTED)) } else if (newState == BluetoothProfile.STATE_DISCONNECTED) { close() @@ -268,6 +270,7 @@ class BLECommonService @Inject internal constructor( // process common packet response private fun processResponseMessage(data: ByteArray) { isConnected = true + isConnecting = false //요청정보 val originalMessageSeq = processedMessage?.getSeq(processedMessageByte) diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt index 85e84d4b29..a2c0e2e4de 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/DiaconnG8Service.kt @@ -136,13 +136,14 @@ class DiaconnG8Service : DaggerService() { } private fun sendMessage(message: DiaconnG8Packet) { - bleCommonService.sendMessage(message, 2000) + bleCommonService.sendMessage(message, 5000) } fun readPumpStatus() { try { val pump = activePlugin.activePump rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingpumpsettings))) + sendMessage(SerialNumInquirePacket(injector)) val pumpFirmwareVersion = sp.getString(rh.gs(R.string.pumpversion), "") @@ -170,6 +171,7 @@ class DiaconnG8Service : DaggerService() { // 시간 설정 rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingpumptime))) + sendMessage(TimeInquirePacket(injector)) var timeDiff = (diaconnG8Pump.getPumpTime() - System.currentTimeMillis()) / 1000L if (diaconnG8Pump.getPumpTime() == 0L) { // initial handshake was not successful @@ -239,14 +241,12 @@ class DiaconnG8Service : DaggerService() { } fun loadHistory(): PumpEnactResult { - if (!diaconnG8Plugin.isInitialized()) { val result = PumpEnactResult(injector).success(false) result.comment = "pump not initialized" return result } sendMessage(LogStatusInquirePacket(injector)) - // pump version check if (diaconnG8Pump.isPumpVersionGe2_63) { sendMessage(IncarnationInquirePacket(injector)) @@ -257,7 +257,7 @@ class DiaconnG8Service : DaggerService() { var apsWrappingCount = -1 // get saved last loginfo val diaconnHistoryRecord = diaconnHistoryRecordDao.getLastRecord(diaconnG8Pump.pumpUid) - aapsLogger.error(LTag.PUMPCOMM, "diaconnHistoryRecord :: $diaconnHistoryRecord") + aapsLogger.debug(LTag.PUMPCOMM, "diaconnHistoryRecord :: $diaconnHistoryRecord") if(diaconnHistoryRecord != null) { apsLastLogNum = diaconnHistoryRecord.lognum @@ -306,7 +306,6 @@ class DiaconnG8Service : DaggerService() { result.success(true) diaconnG8Pump.lastConnection = System.currentTimeMillis() } - // upload pump log to Diaconn Cloud if (sp.getBoolean(R.string.key_diaconn_g8_cloudsend, true)) { SystemClock.sleep(1000) @@ -399,13 +398,6 @@ class DiaconnG8Service : DaggerService() { fun bolus(insulin: Double, carbs: Int, carbTime: Long, t: EventOverviewBolusProgress.Treatment): Boolean { if (!isConnected) return false if (BolusProgressDialog.stopPressed) return false - - // Only Carbs - if (carbs > 0 && insulin == 0.0) { - pumpSync.syncCarbsWithTimestamp(carbTime, carbs.toDouble(), null, PumpType.DIACONN_G8, diaconnG8Pump.serialNo.toString()) - return true - } - rxBus.send(EventPumpStatusChanged(rh.gs(R.string.startingbolus))) // bolus speed setting @@ -435,7 +427,7 @@ class DiaconnG8Service : DaggerService() { val bolusStart = System.currentTimeMillis() if (insulin > 0) { if (!diaconnG8Pump.bolusStopped) { - sendMessage(start) + sendMessage(start, 100) // otp process if (!processConfirm(start.msgType)) return false } else { @@ -460,26 +452,29 @@ class DiaconnG8Service : DaggerService() { } val bolusDurationInMSec = (insulin * speed * 1000).toLong() - val expectedEnd = bolusStart + bolusDurationInMSec + 7500L + val expectedEnd = bolusStart + bolusDurationInMSec + 3500L val totalwaitTime = (expectedEnd - System.currentTimeMillis()) / 1000 - while (!diaconnG8Pump.bolusDone) { - val waitTime = (expectedEnd - System.currentTimeMillis()) / 1000 - bolusingEvent.status = rh.gs(R.string.waitingforestimatedbolusend, if (waitTime < 0) 0 else waitTime) - var progressPecent = 0 - if (totalwaitTime > waitTime) { - progressPecent = ((totalwaitTime - waitTime) * 100 / totalwaitTime).toInt() + if(diaconnG8Pump.isReadyToBolus) { + while (!diaconnG8Pump.bolusDone) { + val waitTime = (expectedEnd - System.currentTimeMillis()) / 1000 + bolusingEvent.status = String.format(rh.gs(R.string.waitingforestimatedbolusend), if (waitTime < 0) 0 else waitTime) + var progressPecent = 0 + if (totalwaitTime > waitTime) { + progressPecent = ((totalwaitTime - waitTime) * 100 / totalwaitTime).toInt() + } + bolusingEvent.percent = min(progressPecent, 100) + rxBus.send(bolusingEvent) + SystemClock.sleep(200) } - bolusingEvent.percent = min(progressPecent, 100) - rxBus.send(bolusingEvent) - SystemClock.sleep(200) } + diaconnG8Pump.isReadyToBolus = false // do not call loadHistory() directly, reconnection may be needed commandQueue.loadEvents(object : Callback() { override fun run() { // reread bolus status rxBus.send(EventPumpStatusChanged(rh.gs(R.string.gettingbolusstatus))) - sendMessage(InjectionSnackInquirePacket(injector), 1000) // last bolus + sendMessage(InjectionSnackInquirePacket(injector), 2000) // last bolus // 볼러스 결과 보고패킷에서 처리함. bolusingEvent.percent = 100 rxBus.send(EventPumpStatusChanged(rh.gs(R.string.disconnecting))) @@ -492,7 +487,7 @@ class DiaconnG8Service : DaggerService() { val stop = InjectionCancelSettingPacket(injector, 0x07.toByte()) diaconnG8Pump.bolusStopForced = true if (isConnected) { - sendMessage(stop) + sendMessage(stop, 100) // otp process if (!processConfirm(stop.msgType)) return while (!diaconnG8Pump.bolusStopped) { @@ -513,7 +508,7 @@ class DiaconnG8Service : DaggerService() { rxBus.send(EventPumpStatusChanged(rh.gs(R.string.stoppingtempbasal))) val msgPacket = TempBasalSettingPacket(injector, 2, diaconnG8Pump.tbTime, diaconnG8Pump.tbInjectRateRatio) // tempbasal stop - sendMessage(msgPacket) + sendMessage(msgPacket, 100) // otp process if (!processConfirm(msgPacket.msgType)) return false diaconnG8Pump.tempBasalStart = dateUtil.now() @@ -521,7 +516,7 @@ class DiaconnG8Service : DaggerService() { rxBus.send(EventPumpStatusChanged(rh.gs(R.string.settingtempbasal))) val tbInjectRate = ((absoluteRate * 100) + 1000).toInt() val msgTBR = TempBasalSettingPacket(injector, 1, ((durationInHours * 60) / 15).toInt(), tbInjectRate) - sendMessage(msgTBR) + sendMessage(msgTBR, 100) // otp process if (!processConfirm(msgTBR.msgType)) return false // pump tempbasal status inquire @@ -545,7 +540,7 @@ class DiaconnG8Service : DaggerService() { rxBus.send(EventPumpStatusChanged(rh.gs(R.string.stoppingtempbasal))) val msgPacket = TempBasalSettingPacket(injector, 2, diaconnG8Pump.tbTime, diaconnG8Pump.tbInjectRateRatio) // tempbasal stop - sendMessage(msgPacket) + sendMessage(msgPacket, 100) // otp process if (!processConfirm(msgPacket.msgType)) return false SystemClock.sleep(500) @@ -553,7 +548,7 @@ class DiaconnG8Service : DaggerService() { rxBus.send(EventPumpStatusChanged(rh.gs(R.string.settingtempbasal))) val tbInjectRate = absoluteRate * 100 + 1000 val msgTBR = TempBasalSettingPacket(injector, 1, 2, tbInjectRate.toInt()) - sendMessage(msgTBR) + sendMessage(msgTBR, 100) // otp process if (!processConfirm(msgTBR.msgType)) return false sendMessage(TempBasalInquirePacket(injector)) @@ -577,7 +572,7 @@ class DiaconnG8Service : DaggerService() { diaconnG8Pump.tbInjectRateRatio ) // tempbasal stop - sendMessage(msgPacket) + sendMessage(msgPacket, 500) // otp process if (!processConfirm(msgPacket.msgType)) return false SystemClock.sleep(500) @@ -593,7 +588,7 @@ class DiaconnG8Service : DaggerService() { fun extendedBolus(insulin: Double, durationInMinutes: Int): Boolean { if (!isConnected) return false rxBus.send(EventPumpStatusChanged(rh.gs(R.string.settingextendedbolus))) - aapsLogger.error(LTag.PUMPCOMM, "insulin: $insulin durationInMinutes: $durationInMinutes") + aapsLogger.debug(LTag.PUMPCOMM, "insulin: $insulin durationInMinutes: $durationInMinutes") val msgExtended = InjectionExtendedBolusSettingPacket(injector, (insulin * 100).toInt(), durationInMinutes, dateUtil.now()) sendMessage(msgExtended) @@ -672,6 +667,7 @@ class DiaconnG8Service : DaggerService() { (basalList[23] * 100).toInt() ) // setting basal pattern 1,2,3,4 + sendMessage(SerialNumInquirePacket(injector), 2000) sendMessage(requestReqPacket1, 500) sendMessage(requestReqPacket2, 500) sendMessage(requestReqPacket3, 500) @@ -694,22 +690,22 @@ class DiaconnG8Service : DaggerService() { private fun processConfirm(msgType: Byte): Boolean { // pump confirm + var loopCnt = 0 + // waiting 2 seconds for otp + while(loopCnt < 20) { + if (diaconnG8Pump.otpNumber == 0) { + SystemClock.sleep(100) + aapsLogger.error(LTag.PUMPCOMM, "OTP waiting 100ms $loopCnt / 20") + } + loopCnt++ + } + // after 2 second if (diaconnG8Pump.otpNumber == 0) { aapsLogger.error(LTag.PUMPCOMM, "otp is not received yet") - - // Comments are made as dialogs are exposed twice each in the event of an error. - // Thread { - // val i = Intent(context, ErrorHelperActivity::class.java) - // i.putExtra("soundid", R.raw.boluserror) - // i.putExtra("status", rh.gs(R.string.diaconn_g8_errotpreceivedyet)) - // i.putExtra("title", rh.gs(R.string.pumperror)) - // i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) - // context.startActivity(i) - // }.start() - return false } - sendMessage(AppConfirmSettingPacket(injector, msgType, diaconnG8Pump.otpNumber)) + diaconnG8Pump.bolusConfirmMessage = msgType + sendMessage(AppConfirmSettingPacket(injector, msgType, diaconnG8Pump.otpNumber), 2000) diaconnG8Pump.otpNumber = 0 return true } diff --git a/diaconn/src/main/res/values-ko-rKR/strings.xml b/diaconn/src/main/res/values-ko-rKR/strings.xml index 29cb87c694..f17e4a3c77 100644 --- a/diaconn/src/main/res/values-ko-rKR/strings.xml +++ b/diaconn/src/main/res/values-ko-rKR/strings.xml @@ -89,6 +89,8 @@ 바늘 교체 로그 동기화 시 케어포털 \"위치 교체\" 정보 자동 업로드 로그 동기화 시 케어포털 \"베터리 교체\" 정보 자동 업로드 + 펌프 로그정보를 \"디아콘 클라우드\"로 자동 업로드 + 디아콘 클라우드 전송 베터리 교체 로그 동기화 진행 중 인슐린 부족 경고 diff --git a/diaconn/src/main/res/values/strings.xml b/diaconn/src/main/res/values/strings.xml index f74b46b0af..ea014d7ef3 100644 --- a/diaconn/src/main/res/values/strings.xml +++ b/diaconn/src/main/res/values/strings.xml @@ -169,5 +169,5 @@ Tempbasal stop is rejected when tempbasal is not running Send pump logs to the Diaconn Cloud. Diaconn Cloud Sync - diaconn_g8_appuid + diaconn_g8_appuid From a2209d8bfc0cd30c610de38ebc815420ab7d5520 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 21 Jul 2022 12:57:44 +0200 Subject: [PATCH 09/18] New translations strings.xml (Russian) (#1928) --- .../src/main/res/values-ru-rRU/strings.xml | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/pump-common/src/main/res/values-ru-rRU/strings.xml b/pump-common/src/main/res/values-ru-rRU/strings.xml index af4479ba5b..37c54b6fa4 100644 --- a/pump-common/src/main/res/values-ru-rRU/strings.xml +++ b/pump-common/src/main/res/values-ru-rRU/strings.xml @@ -53,7 +53,46 @@ Сканирование Сканирование завершено Ошибка сканирования: %1$d + Не было + Удалить + Bluetooth выключен + Адаптер Bluetooth не найден + Сконфигурированная помпа не найдена + Помпа недоступна + Не удалось подключиться к устройству BLE + Ошибка шифрования + Найдена несопряженная помпа + Базальные профили/настройки шаблонов не активированы в помпе. Включите их на помпе. + Базальный профиль на помпе неверен (должен быть %s). + Неверный тип временной скорости базала TBR на помпе (должен быть %s). + На помпе задан неверный макс болюс (должен быть %1$.2f). + На помпе задан неверный макс базал (должен быть %1$.2f). + Тип: + + %1$d день + %1$d дня + %1$d дней + %1$d дн + + + %1$d час + %1$d часа + %1$d часов + %1$d ч + + + %1$d час назад + %1$d часа назад + %1$d часов назад + %1$d ч назад + + + %1$d день назад + %1$d дня назад + %1$d дней назад + %1$d дн назад + From 6d3f0014c21e2b1d1e5685ad37b71dd76f39479d Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 21 Jul 2022 16:58:54 +0200 Subject: [PATCH 10/18] prevent NPE --- .../plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java index f4c1bb19c7..f1c8882213 100644 --- a/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java +++ b/omnipod-eros/src/main/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/OmnipodErosPumpPlugin.java @@ -46,6 +46,7 @@ import info.nightscout.androidaps.interfaces.Pump; import info.nightscout.androidaps.interfaces.PumpDescription; import info.nightscout.androidaps.interfaces.PumpPluginBase; import info.nightscout.androidaps.interfaces.PumpSync; +import info.nightscout.androidaps.plugins.pump.omnipod.eros.driver.definition.schedule.BasalSchedule; import info.nightscout.shared.logging.AAPSLogger; import info.nightscout.shared.logging.LTag; import info.nightscout.androidaps.plugins.bus.RxBus; @@ -628,8 +629,9 @@ public class OmnipodErosPumpPlugin extends PumpPluginBase implements Pump, Riley if (!podStateManager.isPodRunning()) { return 0.0d; } - - return podStateManager.getBasalSchedule().rateAt(TimeUtil.toDuration(DateTime.now())); + BasalSchedule schedule = podStateManager.getBasalSchedule(); + if (schedule != null) return schedule.rateAt(TimeUtil.toDuration(DateTime.now())); + else return 0; } @Override From 6c4796fd219e76d9f8cdfcde41608e243560805a Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 21 Jul 2022 19:19:31 +0200 Subject: [PATCH 11/18] more permission checks --- app/src/main/res/values/strings.xml | 1 - .../automation/triggers/TriggerBTDevice.kt | 11 +++- core/src/main/AndroidManifest.xml | 2 + .../plugins/pump/common/ble/BlePreCheck.kt | 7 ++- .../utils/ui/BluetoothDevicePreference.kt | 32 ++++++++++++ core/src/main/res/values/strings.xml | 1 + .../danar/BluetoothDevicePreference.kt | 22 -------- .../AbstractDanaRExecutionService.java | 50 +++++++++++-------- danar/src/main/res/xml/pref_danar.xml | 2 +- danar/src/main/res/xml/pref_danarkorean.xml | 2 +- danar/src/main/res/xml/pref_danarv2.xml | 2 +- danars/src/main/AndroidManifest.xml | 2 + .../danars/activities/BLEScanActivity.kt | 48 ++++++++++++------ .../androidaps/danars/services/BLEComm.kt | 27 ++++++++-- .../activities/DiaconnG8BLEScanActivity.kt | 36 +++++++++---- .../diaconn/service/BLECommonService.kt | 23 +++++++-- .../InsightConnectionService.java | 20 +++++--- .../pump/common/ui/PumpBLEConfigActivity.kt | 12 ++--- .../dialog/RileyLinkBLEConfigActivity.kt | 19 ++++--- 19 files changed, 216 insertions(+), 103 deletions(-) create mode 100644 core/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt delete mode 100644 danar/src/main/java/info/nightscout/androidaps/danar/BluetoothDevicePreference.kt diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 7bc428a968..148a476141 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -789,7 +789,6 @@ Application needs system window permission for notifications Application needs location permission for BT scan and WiFi identification Application needs storage permission to be able store log files and export settings - Application needs bluetooth permission Request Open navigation Close navigation diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt index bb0c3848f1..02133d03d2 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt @@ -1,8 +1,11 @@ package info.nightscout.androidaps.plugins.general.automation.triggers +import android.Manifest import android.bluetooth.BluetoothManager import android.content.Context +import android.content.pm.PackageManager import android.widget.LinearLayout +import androidx.core.app.ActivityCompat import com.google.common.base.Optional import dagger.android.HasAndroidInjector import info.nightscout.androidaps.automation.R @@ -13,9 +16,9 @@ import info.nightscout.androidaps.plugins.general.automation.elements.InputDropd import info.nightscout.androidaps.plugins.general.automation.elements.LayoutBuilder import info.nightscout.androidaps.plugins.general.automation.elements.StaticLabel import info.nightscout.androidaps.utils.JsonHelper +import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.shared.logging.LTag import org.json.JSONObject -import java.util.* import javax.inject.Inject class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) { @@ -74,7 +77,11 @@ class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) { // Get the list of paired BT devices to use in dropdown menu private fun devicesPaired(): ArrayList { val s = ArrayList() - (context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager?)?.adapter?.bondedDevices?.forEach { s.add(it.name) } + if (ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) { + (context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager?)?.adapter?.bondedDevices?.forEach { s.add(it.name) } + } else { + ToastUtils.errorToast(context, context.getString(R.string.needconnectpermission)) + } return s } diff --git a/core/src/main/AndroidManifest.xml b/core/src/main/AndroidManifest.xml index 0f37944ddb..083c7f30cf 100644 --- a/core/src/main/AndroidManifest.xml +++ b/core/src/main/AndroidManifest.xml @@ -8,6 +8,8 @@ + + = Build.VERSION_CODES.S) { - if (ContextCompat.checkSelfPermission(context, "android.permission.BLUETOOTH_CONNECT") != PackageManager.PERMISSION_GRANTED || - ContextCompat.checkSelfPermission(context, "android.permission.BLUETOOTH_SCAN") != PackageManager.PERMISSION_GRANTED + if (ContextCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED || + ContextCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_SCAN) != PackageManager.PERMISSION_GRANTED ) { - //ActivityCompat.requestPermissions(activity, arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT), PERMISSION_REQUEST_BLUETOOTH) - ActivityCompat.requestPermissions(activity, arrayOf("android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH_CONNECT"), PERMISSION_REQUEST_BLUETOOTH) + ActivityCompat.requestPermissions(activity, arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT), PERMISSION_REQUEST_BLUETOOTH) return false } } diff --git a/core/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt b/core/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt new file mode 100644 index 0000000000..007d8ad412 --- /dev/null +++ b/core/src/main/java/info/nightscout/androidaps/utils/ui/BluetoothDevicePreference.kt @@ -0,0 +1,32 @@ +package info.nightscout.androidaps.utils.ui + +import android.Manifest +import kotlin.jvm.JvmOverloads +import android.bluetooth.BluetoothManager +import android.content.Context +import android.content.pm.PackageManager +import android.util.AttributeSet +import androidx.core.app.ActivityCompat +import androidx.preference.ListPreference +import info.nightscout.androidaps.core.R +import info.nightscout.androidaps.utils.ToastUtils +import java.util.* + +class BluetoothDevicePreference @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : ListPreference(context, attrs) { + + init { + if (ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) { + val devices = Vector() + (context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager?)?.adapter?.let { bta -> + for (dev in bta.bondedDevices) + dev.name?.let { name -> devices.add(name) } + } + entries = devices.toTypedArray() + entryValues = devices.toTypedArray() + } else { + entries = emptyArray() + entryValues = emptyArray() + ToastUtils.errorToast(context, context.getString(R.string.needconnectpermission)) + } + } +} \ No newline at end of file diff --git a/core/src/main/res/values/strings.xml b/core/src/main/res/values/strings.xml index 3f5832b0cd..256d1c8b8b 100644 --- a/core/src/main/res/values/strings.xml +++ b/core/src/main/res/values/strings.xml @@ -601,6 +601,7 @@ Autotune runned and profile automatically switched Error during last Autotune run Another run of Autotune is detected, run cancelled + Application needs bluetooth permission %1$d day diff --git a/danar/src/main/java/info/nightscout/androidaps/danar/BluetoothDevicePreference.kt b/danar/src/main/java/info/nightscout/androidaps/danar/BluetoothDevicePreference.kt deleted file mode 100644 index 41b090bc72..0000000000 --- a/danar/src/main/java/info/nightscout/androidaps/danar/BluetoothDevicePreference.kt +++ /dev/null @@ -1,22 +0,0 @@ -package info.nightscout.androidaps.danar - -import kotlin.jvm.JvmOverloads -import android.bluetooth.BluetoothAdapter -import android.bluetooth.BluetoothDevice -import android.bluetooth.BluetoothManager -import android.content.Context -import android.util.AttributeSet -import androidx.preference.ListPreference -import java.util.* - -class BluetoothDevicePreference @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : ListPreference(context, attrs) { - init { - val entries = Vector() - (context.getSystemService(Context.BLUETOOTH_SERVICE) as BluetoothManager?)?.adapter?.let { bta -> - for (dev in bta.bondedDevices) - dev.name?.let { name -> entries.add(name) } - } - setEntries(entries.toTypedArray()) - entryValues = entries.toTypedArray() - } -} \ No newline at end of file diff --git a/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java b/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java index 2e0b01350c..2f7afdafe8 100644 --- a/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java +++ b/danar/src/main/java/info/nightscout/androidaps/danar/services/AbstractDanaRExecutionService.java @@ -1,14 +1,18 @@ package info.nightscout.androidaps.danar.services; +import android.Manifest; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothSocket; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; import android.os.IBinder; import android.os.SystemClock; +import androidx.core.app.ActivityCompat; + import java.io.IOException; import java.util.Set; import java.util.UUID; @@ -41,8 +45,7 @@ import info.nightscout.androidaps.events.EventPumpStatusChanged; import info.nightscout.androidaps.interfaces.ActivePlugin; import info.nightscout.androidaps.interfaces.Profile; import info.nightscout.androidaps.interfaces.PumpSync; -import info.nightscout.shared.logging.AAPSLogger; -import info.nightscout.shared.logging.LTag; +import info.nightscout.androidaps.interfaces.ResourceHelper; import info.nightscout.androidaps.plugins.bus.RxBus; import info.nightscout.androidaps.plugins.general.overview.events.EventNewNotification; import info.nightscout.androidaps.plugins.general.overview.events.EventOverviewBolusProgress; @@ -50,8 +53,9 @@ import info.nightscout.androidaps.plugins.general.overview.notifications.Notific import info.nightscout.androidaps.utils.DateUtil; import info.nightscout.androidaps.utils.FabricPrivacy; import info.nightscout.androidaps.utils.ToastUtils; -import info.nightscout.androidaps.interfaces.ResourceHelper; import info.nightscout.androidaps.utils.rx.AapsSchedulers; +import info.nightscout.shared.logging.AAPSLogger; +import info.nightscout.shared.logging.LTag; import info.nightscout.shared.sharedPreferences.SP; import io.reactivex.rxjava3.disposables.CompositeDisposable; @@ -191,30 +195,32 @@ public abstract class AbstractDanaRExecutionService extends DaggerService { protected void getBTSocketForSelectedPump() { mDevName = sp.getString(R.string.key_danar_bt_name, ""); - BluetoothAdapter bluetoothAdapter = ((BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter(); + if (ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) { + BluetoothAdapter bluetoothAdapter = ((BluetoothManager) context.getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter(); - if (bluetoothAdapter != null) { - Set bondedDevices = bluetoothAdapter.getBondedDevices(); + if (bluetoothAdapter != null) { + Set bondedDevices = bluetoothAdapter.getBondedDevices(); - if (bondedDevices != null) - for (BluetoothDevice device : bondedDevices) { - if (mDevName.equals(device.getName())) { - mBTDevice = device; - try { - mRfcommSocket = mBTDevice.createRfcommSocketToServiceRecord(SPP_UUID); - } catch (IOException e) { - aapsLogger.error("Error creating socket: ", e); + if (bondedDevices != null) + for (BluetoothDevice device : bondedDevices) { + if (mDevName.equals(device.getName())) { + mBTDevice = device; + try { + mRfcommSocket = mBTDevice.createRfcommSocketToServiceRecord(SPP_UUID); + } catch (IOException e) { + aapsLogger.error("Error creating socket: ", e); + } + break; } - break; } - } + } else { + ToastUtils.INSTANCE.showToastInUiThread(context.getApplicationContext(), rh.gs(R.string.nobtadapter)); + } + if (mBTDevice == null) { + ToastUtils.INSTANCE.showToastInUiThread(context.getApplicationContext(), rh.gs(R.string.devicenotfound)); + } } else { - ToastUtils.INSTANCE.showToastInUiThread(context.getApplicationContext(), - rh.gs(R.string.nobtadapter)); - } - if (mBTDevice == null) { - ToastUtils.INSTANCE.showToastInUiThread(context.getApplicationContext(), - rh.gs(R.string.devicenotfound)); + ToastUtils.INSTANCE.errorToast(context, context.getString(R.string.needconnectpermission)); } } diff --git a/danar/src/main/res/xml/pref_danar.xml b/danar/src/main/res/xml/pref_danar.xml index c7d45b8f12..98b1f51b37 100644 --- a/danar/src/main/res/xml/pref_danar.xml +++ b/danar/src/main/res/xml/pref_danar.xml @@ -8,7 +8,7 @@ android:title="@string/danar_pump_settings" app:initialExpandedChildrenCount="0"> - diff --git a/danar/src/main/res/xml/pref_danarkorean.xml b/danar/src/main/res/xml/pref_danarkorean.xml index 96479baf58..5b3372e2ed 100644 --- a/danar/src/main/res/xml/pref_danarkorean.xml +++ b/danar/src/main/res/xml/pref_danarkorean.xml @@ -8,7 +8,7 @@ android:title="@string/danar_pump_settings" app:initialExpandedChildrenCount="0"> - diff --git a/danar/src/main/res/xml/pref_danarv2.xml b/danar/src/main/res/xml/pref_danarv2.xml index f18ed77e4a..f16c06afb6 100644 --- a/danar/src/main/res/xml/pref_danarv2.xml +++ b/danar/src/main/res/xml/pref_danarv2.xml @@ -8,7 +8,7 @@ android:title="@string/danar_pump_settings" app:initialExpandedChildrenCount="0"> - diff --git a/danars/src/main/AndroidManifest.xml b/danars/src/main/AndroidManifest.xml index c3ef8bc727..108cb94048 100644 --- a/danars/src/main/AndroidManifest.xml +++ b/danars/src/main/AndroidManifest.xml @@ -5,6 +5,8 @@ + + - if (!bluetoothAdapter.isEnabled) bluetoothAdapter.enable() - bluetoothLeScanner = bluetoothAdapter.bluetoothLeScanner - startScan() + if (ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_SCAN) == PackageManager.PERMISSION_GRANTED) { + bluetoothAdapter?.let { bluetoothAdapter -> + if (!bluetoothAdapter.isEnabled) bluetoothAdapter.enable() + bluetoothLeScanner = bluetoothAdapter.bluetoothLeScanner + startScan() + } + } else { + ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) } } override fun onPause() { super.onPause() - stopScan() + if (ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_SCAN) == PackageManager.PERMISSION_GRANTED) { + stopScan() + } } + @SuppressLint("MissingPermission") private fun startScan() = try { val filters: MutableList = ArrayList() @@ -86,16 +96,21 @@ class DiaconnG8BLEScanActivity : NoSplashAppCompatActivity() { .build() bluetoothLeScanner?.startScan(filters, settings, mBleScanCallback) - } catch (e: IllegalStateException) { + } catch (ignored: IllegalStateException) { } // ignore BT not on + @SuppressLint("MissingPermission") private fun stopScan() = try { bluetoothLeScanner?.stopScan(mBleScanCallback) - } catch (e: IllegalStateException) { + } catch (ignored: IllegalStateException) { } // ignore BT not on private fun addBleDevice(device: BluetoothDevice?) { + if (ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) { + ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + return + } if (device == null || device.name == null || device.name == "") { return } @@ -145,6 +160,7 @@ class DiaconnG8BLEScanActivity : NoSplashAppCompatActivity() { v.setOnClickListener(this@ViewHolder) } + @SuppressLint("MissingPermission") override fun onClick(v: View) { sp.putString(R.string.key_diaconn_g8_address, item.device.address) sp.putString(R.string.key_diaconn_g8_name, name.text.toString()) @@ -153,6 +169,7 @@ class DiaconnG8BLEScanActivity : NoSplashAppCompatActivity() { finish() } + @SuppressLint("MissingPermission") fun setData(data: BluetoothDeviceItem) { var tTitle = data.device.name if (tTitle == null || tTitle == "") { @@ -168,6 +185,7 @@ class DiaconnG8BLEScanActivity : NoSplashAppCompatActivity() { // inner class BluetoothDeviceItem internal constructor(val device: BluetoothDevice) { + override fun equals(other: Any?): Boolean { if (other !is BluetoothDeviceItem) { return false diff --git a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt index a86e3ded15..727044c418 100644 --- a/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt +++ b/diaconn/src/main/java/info/nightscout/androidaps/diaconn/service/BLECommonService.kt @@ -1,9 +1,12 @@ package info.nightscout.androidaps.diaconn.service +import android.Manifest +import android.annotation.SuppressLint import android.bluetooth.* import android.content.Context -import android.content.Intent +import android.content.pm.PackageManager import android.os.SystemClock +import androidx.core.app.ActivityCompat import dagger.android.HasAndroidInjector import info.nightscout.androidaps.activities.ErrorHelperActivity import info.nightscout.androidaps.diaconn.DiaconnG8Pump @@ -12,10 +15,11 @@ import info.nightscout.androidaps.diaconn.packet.* import info.nightscout.androidaps.events.EventPumpStatusChanged import info.nightscout.androidaps.extensions.notify import info.nightscout.androidaps.extensions.waitMillis +import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.plugins.bus.RxBus +import info.nightscout.androidaps.utils.ToastUtils import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag -import info.nightscout.androidaps.plugins.bus.RxBus -import info.nightscout.androidaps.interfaces.ResourceHelper import java.util.* import java.util.concurrent.ScheduledFuture import javax.inject.Inject @@ -66,6 +70,11 @@ class BLECommonService @Inject internal constructor( @Synchronized fun connect(from: String, address: String?): Boolean { + if (ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) { + ToastUtils.errorToast(context, context.getString(info.nightscout.androidaps.core.R.string.needconnectpermission)) + aapsLogger.error(LTag.PUMPBTCOMM, "missing permission: $from") + return false + } aapsLogger.debug(LTag.PUMPBTCOMM, "Initializing Bluetooth ") if (bluetoothAdapter == null) { aapsLogger.error("Unable to obtain a BluetoothAdapter.") @@ -98,6 +107,10 @@ class BLECommonService @Inject internal constructor( @Synchronized fun disconnect(from: String) { + if (ActivityCompat.checkSelfPermission(context, Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED) { + aapsLogger.error(LTag.PUMPBTCOMM, "missing permission: $from") + return + } aapsLogger.debug(LTag.PUMPBTCOMM, "disconnect from: $from") // cancel previous scheduled disconnection to prevent closing upcoming connection @@ -117,6 +130,7 @@ class BLECommonService @Inject internal constructor( SystemClock.sleep(2000) } + @SuppressLint("MissingPermission") @Synchronized fun close() { aapsLogger.debug(LTag.PUMPBTCOMM, "BluetoothAdapter close") @@ -159,6 +173,7 @@ class BLECommonService @Inject internal constructor( } } + @SuppressLint("MissingPermission") @Synchronized private fun writeCharacteristicNoResponse(characteristic: BluetoothGattCharacteristic, data: ByteArray) { Thread(Runnable { @@ -197,6 +212,7 @@ class BLECommonService @Inject internal constructor( return bluetoothGatt?.services } + @SuppressLint("MissingPermission") @Synchronized private fun findCharacteristic() { val gattServices = getSupportedGattServices() ?: return @@ -222,6 +238,7 @@ class BLECommonService @Inject internal constructor( } } + @SuppressLint("MissingPermission") @Synchronized private fun onConnectionStateChangeSynchronized(gatt: BluetoothGatt, newState: Int) { aapsLogger.debug(LTag.PUMPBTCOMM, "onConnectionStateChange newState : $newState") diff --git a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java index 114dbdbe62..88c3f6bb4c 100644 --- a/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java +++ b/insight/src/main/java/info/nightscout/androidaps/plugins/pump/insight/connection_service/InsightConnectionService.java @@ -1,16 +1,19 @@ package info.nightscout.androidaps.plugins.pump.insight.connection_service; +import android.Manifest; import android.bluetooth.BluetoothAdapter; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothManager; import android.bluetooth.BluetoothSocket; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; import android.os.Binder; import android.os.IBinder; import android.os.PowerManager; import androidx.annotation.Nullable; +import androidx.core.app.ActivityCompat; import org.spongycastle.crypto.InvalidCipherTextException; @@ -23,8 +26,6 @@ import javax.inject.Inject; import dagger.android.DaggerService; import info.nightscout.androidaps.insight.R; -import info.nightscout.shared.logging.AAPSLogger; -import info.nightscout.shared.logging.LTag; import info.nightscout.androidaps.plugins.pump.insight.app_layer.AppLayerMessage; import info.nightscout.androidaps.plugins.pump.insight.app_layer.ReadParameterBlockMessage; import info.nightscout.androidaps.plugins.pump.insight.app_layer.configuration.CloseConfigurationWriteSessionMessage; @@ -87,6 +88,8 @@ import info.nightscout.androidaps.plugins.pump.insight.utils.PairingDataStorage; import info.nightscout.androidaps.plugins.pump.insight.utils.crypto.Cryptograph; import info.nightscout.androidaps.plugins.pump.insight.utils.crypto.DerivedKeys; import info.nightscout.androidaps.plugins.pump.insight.utils.crypto.KeyPair; +import info.nightscout.shared.logging.AAPSLogger; +import info.nightscout.shared.logging.LTag; import info.nightscout.shared.sharedPreferences.SP; public class InsightConnectionService extends DaggerService implements ConnectionEstablisher.Callback, InputStreamReader.Callback, OutputStreamWriter.Callback { @@ -108,7 +111,7 @@ public class InsightConnectionService extends DaggerService implements Connectio private DelayedActionThread disconnectTimer; private DelayedActionThread recoveryTimer; private DelayedActionThread timeoutTimer; - private BluetoothAdapter bluetoothAdapter; + @Nullable private BluetoothAdapter bluetoothAdapter; private BluetoothDevice bluetoothDevice; private BluetoothSocket bluetoothSocket; private ConnectionEstablisher connectionEstablisher; @@ -258,10 +261,12 @@ public class InsightConnectionService extends DaggerService implements Connectio @Override public synchronized void onCreate() { super.onCreate(); - bluetoothAdapter = ((BluetoothManager)getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter(); - pairingDataStorage = new PairingDataStorage(this); - state = pairingDataStorage.isPaired() ? InsightState.DISCONNECTED : InsightState.NOT_PAIRED; - wakeLock = ((PowerManager) getSystemService(POWER_SERVICE)).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidAPS:InsightConnectionService"); + if (ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED) { + bluetoothAdapter = ((BluetoothManager) getApplicationContext().getSystemService(Context.BLUETOOTH_SERVICE)).getAdapter(); + pairingDataStorage = new PairingDataStorage(this); + state = pairingDataStorage.isPaired() ? InsightState.DISCONNECTED : InsightState.NOT_PAIRED; + wakeLock = ((PowerManager) getSystemService(POWER_SERVICE)).newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "AndroidAPS:InsightConnectionService"); + } } private void setState(InsightState state) { @@ -426,6 +431,7 @@ public class InsightConnectionService extends DaggerService implements Connectio } private synchronized void connect() { + if (bluetoothAdapter == null) return; if (bluetoothDevice == null) bluetoothDevice = bluetoothAdapter.getRemoteDevice(pairingDataStorage.getMacAddress()); setState(InsightState.CONNECTING); diff --git a/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpBLEConfigActivity.kt b/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpBLEConfigActivity.kt index 6333af2cc2..db19107d75 100755 --- a/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpBLEConfigActivity.kt +++ b/pump-common/src/main/java/info/nightscout/androidaps/plugins/pump/common/ui/PumpBLEConfigActivity.kt @@ -133,7 +133,7 @@ class PumpBLEConfigActivity : DaggerAppCompatActivity() { aapsLogger.debug(TAG, "Device can be detected near, so trying to remove bond if possible.") bleSelector.removeDevice(bluetoothDevice!!) } else { - val remoteDevice = bluetoothAdapter!!.getRemoteDevice(deviceAddress) + val remoteDevice = bluetoothAdapter?.getRemoteDevice(deviceAddress) if (remoteDevice != null) { bleSelector.removeDevice(remoteDevice) } @@ -184,7 +184,7 @@ class PumpBLEConfigActivity : DaggerAppCompatActivity() { } private fun prepareForScanning() { - bleScanner = bluetoothAdapter!!.bluetoothLeScanner + bleScanner = bluetoothAdapter?.bluetoothLeScanner settings = bleSelector.getScanSettings() filters = bleSelector.getScanFilters() } @@ -243,7 +243,7 @@ class PumpBLEConfigActivity : DaggerAppCompatActivity() { binding.pumpBleConfigButtonScanStop.visibility = View.VISIBLE } scanning = true - bleScanner!!.startScan(filters, settings, bleScanCallback) + bleScanner?.startScan(filters, settings, bleScanCallback) aapsLogger.debug(LTag.PUMPBTCOMM, "startLeDeviceScan: Scanning Start") bleSelector.onStartLeDeviceScan(this@PumpBLEConfigActivity) } @@ -251,7 +251,7 @@ class PumpBLEConfigActivity : DaggerAppCompatActivity() { private fun stopLeDeviceScan(manualStop: Boolean) { if (scanning) { scanning = false - bleScanner!!.stopScan(bleScanCallback) + bleScanner?.stopScan(bleScanCallback) aapsLogger.debug(LTag.PUMPBTCOMM, "stopLeDeviceScan: Scanning Stop") bleSelector.onStopLeDeviceScan(this@PumpBLEConfigActivity) handler.removeCallbacks(stopScanAfterTimeoutRunnable) @@ -320,8 +320,8 @@ class PumpBLEConfigActivity : DaggerAppCompatActivity() { if (currentlySelectedAddress == device.address) { deviceName += " (" + resources.getString(R.string.ble_config_scan_selected) + ")" } - holder.deviceName!!.text = deviceName - holder.deviceAddress!!.text = device.address + holder.deviceName?.text = deviceName + holder.deviceAddress?.text = device.address return v!! } } diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt index 61be9e9b16..e02dbaff7b 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/dialog/RileyLinkBLEConfigActivity.kt @@ -1,5 +1,6 @@ package info.nightscout.androidaps.plugins.pump.common.dialog +import android.Manifest import android.annotation.SuppressLint import android.bluetooth.BluetoothAdapter import android.bluetooth.BluetoothDevice @@ -10,6 +11,7 @@ import android.bluetooth.le.ScanFilter import android.bluetooth.le.ScanResult import android.bluetooth.le.ScanSettings import android.content.Context +import android.content.pm.PackageManager import android.os.Bundle import android.os.Handler import android.os.HandlerThread @@ -22,8 +24,10 @@ import android.widget.AdapterView.OnItemClickListener import android.widget.BaseAdapter import android.widget.TextView import android.widget.Toast +import androidx.core.app.ActivityCompat import dagger.android.support.DaggerAppCompatActivity import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.pump.common.ble.BlePreCheck import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.R import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkConst @@ -32,7 +36,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.data.Gatt import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.databinding.RileyLinkBleConfigActivityBinding import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkPumpDevice import info.nightscout.androidaps.utils.alertDialogs.OKDialog -import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP @@ -225,16 +228,20 @@ class RileyLinkBLEConfigActivity : DaggerAppCompatActivity() { binding.rileyLinkBleConfigButtonScanStop.visibility = View.VISIBLE } scanning = true - bleScanner?.startScan(filters, settings, bleScanCallback) - aapsLogger.debug(LTag.PUMPBTCOMM, "startLeDeviceScan: Scanning Start") - Toast.makeText(this@RileyLinkBLEConfigActivity, R.string.riley_link_ble_config_scan_scanning, Toast.LENGTH_SHORT).show() + if (ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_SCAN) == PackageManager.PERMISSION_GRANTED) { + bleScanner?.startScan(filters, settings, bleScanCallback) + aapsLogger.debug(LTag.PUMPBTCOMM, "startLeDeviceScan: Scanning Start") + Toast.makeText(this@RileyLinkBLEConfigActivity, R.string.riley_link_ble_config_scan_scanning, Toast.LENGTH_SHORT).show() + } } private fun stopLeDeviceScan() { if (scanning) { scanning = false if (bluetoothAdapter?.isEnabled == true && bluetoothAdapter?.state == BluetoothAdapter.STATE_ON) - bleScanner?.stopScan(bleScanCallback) + if (ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_SCAN) == PackageManager.PERMISSION_GRANTED) { + bleScanner?.stopScan(bleScanCallback) + } aapsLogger.debug(LTag.PUMPBTCOMM, "stopLeDeviceScan: Scanning Stop") Toast.makeText(this, R.string.riley_link_ble_config_scan_finished, Toast.LENGTH_SHORT).show() handler.removeCallbacks(stopScanAfterTimeoutRunnable) @@ -268,7 +275,7 @@ class RileyLinkBLEConfigActivity : DaggerAppCompatActivity() { override fun getItem(i: Int): Any = leDevices[i] override fun getItemId(i: Int): Long = i.toLong() - @SuppressLint("InflateParams") + @SuppressLint("InflateParams", "MissingPermission") override fun getView(i: Int, v: View?, viewGroup: ViewGroup): View { var view = v val viewHolder: ViewHolder From d36f8192875f31d293fc1a6a533ce412870f006b Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 21 Jul 2022 22:47:28 +0200 Subject: [PATCH 12/18] fix concurrent modification --- .../plugins/general/automation/triggers/TriggerBTDevice.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt index 02133d03d2..0a96be811b 100644 --- a/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt +++ b/automation/src/main/java/info/nightscout/androidaps/plugins/general/automation/triggers/TriggerBTDevice.kt @@ -86,7 +86,7 @@ class TriggerBTDevice(injector: HasAndroidInjector) : Trigger(injector) { } private fun eventExists(): Boolean { - automationPlugin.btConnects.forEach { + ArrayList(automationPlugin.btConnects).forEach { if (btDevice.value == it.deviceName) { if (comparator.value == ComparatorConnect.Compare.ON_CONNECT && it.state == EventBTChange.Change.CONNECT) return true if (comparator.value == ComparatorConnect.Compare.ON_DISCONNECT && it.state == EventBTChange.Change.DISCONNECT) return true From ea8e3e4ace6b0b9f07f1f503d4a31ff9e412d843 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 21 Jul 2022 23:10:36 +0200 Subject: [PATCH 13/18] cleanup --- .../info/nightscout/androidaps/utils/AndroidPermission.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.kt b/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.kt index 6262e552bc..2be9e2eef9 100644 --- a/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.kt +++ b/app/src/main/java/info/nightscout/androidaps/utils/AndroidPermission.kt @@ -2,7 +2,6 @@ package info.nightscout.androidaps.utils import android.Manifest import android.annotation.SuppressLint -import android.annotation.TargetApi import android.bluetooth.BluetoothAdapter import android.content.ActivityNotFoundException import android.content.Context @@ -95,13 +94,14 @@ class AndroidPermission @Inject constructor( } } + @SuppressLint("MissingPermission") @Synchronized fun notifyForBtConnectPermission(activity: FragmentActivity) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { // Manifest.permission.BLUETOOTH_CONNECT - if (permissionNotGranted(activity, "android.permission.BLUETOOTH_CONNECT") || permissionNotGranted(activity, "android.permission.BLUETOOTH_SCAN")) { + if (permissionNotGranted(activity, Manifest.permission.BLUETOOTH_CONNECT) || permissionNotGranted(activity, Manifest.permission.BLUETOOTH_SCAN)) { val notification = NotificationWithAction(injector, Notification.PERMISSION_BT, rh.gs(R.string.needconnectpermission), Notification.URGENT) - notification.action(R.string.request) { askForPermission(activity, arrayOf("android.permission.BLUETOOTH_SCAN", "android.permission.BLUETOOTH_CONNECT")) } + notification.action(R.string.request) { askForPermission(activity, arrayOf(Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_CONNECT)) } rxBus.send(EventNewNotification(notification)) } else { activity.startActivity(Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE)) From 67374301ffee5cc015dd2a02c2bb2ebff6986ba8 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 21 Jul 2022 23:34:39 +0200 Subject: [PATCH 14/18] MDT: fix fragment state color --- .../hw/rileylink/service/RileyLinkService.kt | 17 +++++++---------- .../rileylink/service/RileyLinkServiceData.kt | 5 +++-- .../service/tasks/InitializePumpManagerTask.kt | 8 ++++---- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt index d7efd6ca73..9e5e10cd79 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkService.kt @@ -7,6 +7,7 @@ import android.content.Intent import dagger.android.DaggerService import dagger.android.HasAndroidInjector import info.nightscout.androidaps.interfaces.ActivePlugin +import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.androidaps.plugins.bus.RxBus import info.nightscout.androidaps.plugins.pump.common.defs.PumpDeviceState import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.RileyLinkCommunicationManager @@ -17,8 +18,6 @@ import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.RileyLink import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.ble.defs.RileyLinkEncodingType import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkError import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkServiceState -import info.nightscout.androidaps.plugins.pump.common.hw.rileylink.defs.RileyLinkTargetDevice -import info.nightscout.androidaps.interfaces.ResourceHelper import info.nightscout.shared.logging.AAPSLogger import info.nightscout.shared.logging.LTag import info.nightscout.shared.sharedPreferences.SP @@ -85,8 +84,6 @@ abstract class RileyLinkService : DaggerService() { } abstract val deviceCommunicationManager: RileyLinkCommunicationManager<*> - val rileyLinkServiceState: RileyLinkServiceState? - get() = rileyLinkServiceData.rileyLinkServiceState // Here is where the wake-lock begins: // We've received a service startCommand, we grab the lock. @@ -94,7 +91,7 @@ abstract class RileyLinkService : DaggerService() { fun bluetoothInit(): Boolean { aapsLogger.debug(LTag.PUMPBTCOMM, "bluetoothInit: attempting to get an adapter") - rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.BluetoothInitializing + rileyLinkServiceData.setServiceState(RileyLinkServiceState.BluetoothInitializing) if (bluetoothAdapter == null) { aapsLogger.error("Unable to obtain a BluetoothAdapter.") rileyLinkServiceData.setServiceState(RileyLinkServiceState.BluetoothError, RileyLinkError.NoBluetoothAdapter) @@ -103,7 +100,7 @@ abstract class RileyLinkService : DaggerService() { aapsLogger.error("Bluetooth is not enabled.") rileyLinkServiceData.setServiceState(RileyLinkServiceState.BluetoothError, RileyLinkError.BluetoothDisabled) } else { - rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.BluetoothReady + rileyLinkServiceData.setServiceState(RileyLinkServiceState.BluetoothReady) return true } } @@ -112,7 +109,7 @@ abstract class RileyLinkService : DaggerService() { // returns true if our Rileylink configuration changed fun reconfigureRileyLink(deviceAddress: String): Boolean { - rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.RileyLinkInitializing + rileyLinkServiceData.setServiceState(RileyLinkServiceState.RileyLinkInitializing) return if (rileyLinkBLE.isConnected) { if (deviceAddress == rileyLinkServiceData.rileyLinkAddress) { aapsLogger.info(LTag.PUMPBTCOMM, "No change to RL address. Not reconnecting.") @@ -141,7 +138,7 @@ abstract class RileyLinkService : DaggerService() { // FIXME: This needs to be run in a session so that is incorruptible, has a separate thread, etc. fun doTuneUpDevice() { - rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.TuneUpDevice + rileyLinkServiceData.setServiceState(RileyLinkServiceState.TuneUpDevice) setPumpDeviceState(PumpDeviceState.Sleeping) val lastGoodFrequency = rileyLinkServiceData.lastGoodFrequency ?: sp.getDouble(RileyLinkConst.Prefs.LastGoodDeviceFrequency, 0.0) val newFrequency = deviceCommunicationManager.tuneForDevice() @@ -157,7 +154,7 @@ abstract class RileyLinkService : DaggerService() { rileyLinkServiceData.setServiceState(RileyLinkServiceState.PumpConnectorError, RileyLinkError.TuneUpOfDeviceFailed) } else { deviceCommunicationManager.clearNotConnectedCount() - rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.PumpConnectorReady + rileyLinkServiceData.setServiceState(RileyLinkServiceState.PumpConnectorReady) } } @@ -168,7 +165,7 @@ abstract class RileyLinkService : DaggerService() { rileyLinkServiceData.rileyLinkAddress = null rileyLinkServiceData.rileyLinkName = null } - rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.BluetoothReady + rileyLinkServiceData.setServiceState(RileyLinkServiceState.BluetoothReady) } fun changeRileyLinkEncoding(encodingType: RileyLinkEncodingType?) { diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.kt b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.kt index 047467fd7f..39dcf629bb 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.kt +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/RileyLinkServiceData.kt @@ -27,6 +27,7 @@ class RileyLinkServiceData @Inject constructor() { var tuneUpDone = false var rileyLinkError: RileyLinkError? = null var rileyLinkServiceState: RileyLinkServiceState = RileyLinkServiceState.NotStarted + private set var lastServiceStateChange = 0L private set @@ -62,11 +63,11 @@ class RileyLinkServiceData @Inject constructor() { } @Synchronized - fun setServiceState(newState: RileyLinkServiceState, errorCode: RileyLinkError) { + fun setServiceState(newState: RileyLinkServiceState, errorCode: RileyLinkError? = null) { rileyLinkServiceState = newState lastServiceStateChange = System.currentTimeMillis() rileyLinkError = errorCode - aapsLogger.info(LTag.PUMP, String.format(Locale.ENGLISH, "RileyLink State Changed: $newState - Error State: ${errorCode.name}")) + aapsLogger.info(LTag.PUMP, String.format(Locale.ENGLISH, "RileyLink State Changed: $newState - Error State: ${errorCode?.name}")) rileyLinkUtil.rileyLinkHistory.add(RLHistoryItem(rileyLinkServiceState, errorCode, targetDevice)) rxBus.send(EventRileyLinkDeviceStatusChange(targetDevice!!, newState, errorCode)) } diff --git a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt index 935aff66bc..cc7f946d74 100644 --- a/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt +++ b/rileylink/src/main/java/info/nightscout/androidaps/plugins/pump/common/hw/rileylink/service/tasks/InitializePumpManagerTask.kt @@ -39,10 +39,10 @@ class InitializePumpManagerTask(injector: HasAndroidInjector, private val contex val rileyLinkCommunicationManager = pumpDevice?.rileyLinkService?.deviceCommunicationManager if (activePlugin.activePump.manufacturer() === ManufacturerType.Medtronic) { if (lastGoodFrequency > 0.0 && rileyLinkCommunicationManager?.isValidFrequency(lastGoodFrequency) == true) { - rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.RileyLinkReady + rileyLinkServiceData.setServiceState(RileyLinkServiceState.RileyLinkReady) aapsLogger.info(LTag.PUMPBTCOMM, "Setting radio frequency to $lastGoodFrequency MHz") rileyLinkCommunicationManager.setRadioFrequencyForPump(lastGoodFrequency) - if (rileyLinkCommunicationManager.tryToConnectToDevice()) rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.PumpConnectorReady + if (rileyLinkCommunicationManager.tryToConnectToDevice()) rileyLinkServiceData.setServiceState(RileyLinkServiceState.PumpConnectorReady) else { rileyLinkServiceData.setServiceState(RileyLinkServiceState.PumpConnectorError, RileyLinkError.NoContactWithDevice) rileyLinkUtil.sendBroadcastMessage(RileyLinkConst.IPC.MSG_PUMP_tunePump, context) @@ -54,11 +54,11 @@ class InitializePumpManagerTask(injector: HasAndroidInjector, private val contex lastGoodFrequency = (lastGoodFrequency * 1000.0).roundToLong() / 1000.0 rileyLinkServiceData.lastGoodFrequency = lastGoodFrequency } - rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.RileyLinkReady + rileyLinkServiceData.setServiceState(RileyLinkServiceState.RileyLinkReady) rileyLinkServiceData.rileyLinkTargetFrequency = RileyLinkTargetFrequency.Omnipod // TODO shouldn't be needed aapsLogger.info(LTag.PUMPBTCOMM, "Setting radio frequency to $lastGoodFrequency MHz") rileyLinkCommunicationManager?.setRadioFrequencyForPump(lastGoodFrequency) - rileyLinkServiceData.rileyLinkServiceState = RileyLinkServiceState.PumpConnectorReady + rileyLinkServiceData.setServiceState(RileyLinkServiceState.PumpConnectorReady) } } } \ No newline at end of file From c5e55eaf8593f48b4ba1d31336dbcf34ff44ec45 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 22 Jul 2022 08:10:42 +0000 Subject: [PATCH 15/18] chore(deps): bump dagger_version from 2.42 to 2.43 Bumps `dagger_version` from 2.42 to 2.43. Updates `dagger-compiler` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) Updates `dagger-android-processor` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) Updates `dagger` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) Updates `dagger-android` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) Updates `dagger-android-support` from 2.42 to 2.43 - [Release notes](https://github.com/google/dagger/releases) - [Changelog](https://github.com/google/dagger/blob/master/CHANGELOG.md) - [Commits](https://github.com/google/dagger/compare/dagger-2.42...dagger-2.43) --- updated-dependencies: - dependency-name: com.google.dagger:dagger-compiler dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.dagger:dagger-android-processor dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.dagger:dagger dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.dagger:dagger-android dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.google.dagger:dagger-android-support dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 6db40abeaf..e5d3cb5adf 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { rxkotlin_version = '3.0.1' room_version = '2.4.2' lifecycle_version = '2.5.0' - dagger_version = '2.42' + dagger_version = '2.43' coroutines_version = '1.6.4' activity_version = '1.4.0' fragmentktx_version = '1.4.1' From 3d1c7770ab23baee23420da6db8e7a3ad0cfba6f Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 22 Jul 2022 11:33:28 +0200 Subject: [PATCH 16/18] New Crowdin updates (#1940) * Update source file strings.xml * New translations strings.xml (Korean) * Update source file strings.xml * New translations strings.xml (Romanian) * New translations strings.xml (French) * New translations strings.xml (Spanish) * New translations strings.xml (Czech) * New translations strings.xml (Danish) * New translations strings.xml (German) * New translations strings.xml (Hebrew) * New translations strings.xml (Italian) * New translations strings.xml (Lithuanian) * New translations strings.xml (Dutch) * New translations strings.xml (Norwegian) * New translations strings.xml (Polish) * New translations strings.xml (Portuguese) * New translations strings.xml (Russian) * New translations strings.xml (Slovak) * New translations strings.xml (Swedish) * New translations strings.xml (Turkish) * New translations strings.xml (Chinese Simplified) * Update source file strings.xml * Update source file strings.xml * New translations strings.xml (Lithuanian) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Romanian) * New translations strings.xml (Spanish) * New translations strings.xml (German) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Norwegian) * New translations strings.xml (Danish) * New translations strings.xml (Chinese Simplified) * New translations strings.xml (Turkish) * New translations strings.xml (Romanian) * New translations strings.xml (Lithuanian) * New translations strings.xml (Afrikaans) * New translations strings.xml (Bulgarian) * New translations strings.xml (Catalan) * New translations strings.xml (Danish) * New translations strings.xml (Hebrew) * New translations strings.xml (Italian) * New translations strings.xml (Lithuanian) * New translations strings.xml (Polish) * New translations strings.xml (Portuguese) * New translations strings.xml (German) * New translations strings.xml (Russian) * New translations strings.xml (Slovak) * New translations strings.xml (Swedish) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Greek) * New translations strings.xml (Irish) * New translations strings.xml (Portuguese) * New translations strings.xml (Hungarian) * New translations strings.xml (Korean) * New translations strings.xml (Lithuanian) * New translations strings.xml (Polish) * New translations strings.xml (Slovak) * New translations strings.xml (Swedish) * New translations strings.xml (Portuguese, Brazilian) * New translations strings.xml (Czech) * New translations strings.xml (Polish) * New translations strings.xml (Hebrew) --- app/src/main/res/values-cs-rCZ/strings.xml | 1 - app/src/main/res/values-da-rDK/strings.xml | 1 - app/src/main/res/values-de-rDE/strings.xml | 1 - app/src/main/res/values-es-rES/strings.xml | 1 - app/src/main/res/values-fr-rFR/strings.xml | 1 - app/src/main/res/values-it-rIT/strings.xml | 1 - app/src/main/res/values-iw-rIL/strings.xml | 1 - app/src/main/res/values-lt-rLT/strings.xml | 2 +- app/src/main/res/values-nl-rNL/strings.xml | 1 - app/src/main/res/values-no-rNO/strings.xml | 1 - app/src/main/res/values-pl-rPL/strings.xml | 7 +- app/src/main/res/values-pt-rPT/strings.xml | 1 - app/src/main/res/values-ro-rRO/strings.xml | 1 - app/src/main/res/values-ru-rRU/strings.xml | 1 - app/src/main/res/values-sk-rSK/strings.xml | 1 - app/src/main/res/values-sv-rSE/strings.xml | 1 - app/src/main/res/values-tr-rTR/strings.xml | 1 - app/src/main/res/values-zh-rCN/strings.xml | 2 +- .../src/main/res/values-lt-rLT/strings.xml | 1 + core/src/main/res/values-bg-rBG/strings.xml | 1 + core/src/main/res/values-ca-rES/strings.xml | 1 + core/src/main/res/values-cs-rCZ/strings.xml | 1 + core/src/main/res/values-da-rDK/strings.xml | 1 + core/src/main/res/values-de-rDE/strings.xml | 1 + core/src/main/res/values-es-rES/strings.xml | 1 + core/src/main/res/values-it-rIT/strings.xml | 1 + core/src/main/res/values-iw-rIL/strings.xml | 1 + core/src/main/res/values-lt-rLT/strings.xml | 1 + core/src/main/res/values-no-rNO/strings.xml | 1 + core/src/main/res/values-pl-rPL/strings.xml | 1 + core/src/main/res/values-pt-rBR/strings.xml | 1 + core/src/main/res/values-pt-rPT/strings.xml | 1 + core/src/main/res/values-ro-rRO/strings.xml | 1 + core/src/main/res/values-ru-rRU/strings.xml | 1 + core/src/main/res/values-sk-rSK/strings.xml | 1 + core/src/main/res/values-sv-rSE/strings.xml | 1 + core/src/main/res/values-tr-rTR/strings.xml | 1 + core/src/main/res/values-zh-rCN/strings.xml | 1 + .../src/main/res/values-ko-rKR/strings.xml | 2 - .../src/main/res/values-af-rZA/strings.xml | 1 + .../src/main/res/values-bg-rBG/strings.xml | 28 ++++++++ .../src/main/res/values-ca-rES/strings.xml | 26 ++++++++ .../src/main/res/values-da-rDK/strings.xml | 8 +++ .../src/main/res/values-de-rDE/strings.xml | 28 ++++++++ .../src/main/res/values-el-rGR/strings.xml | 1 + .../src/main/res/values-ga-rIE/strings.xml | 7 ++ .../src/main/res/values-hu-rHU/strings.xml | 8 +++ .../src/main/res/values-iw-rIL/strings.xml | 66 +++++++++++++++++++ .../src/main/res/values-ko-rKR/strings.xml | 7 ++ .../src/main/res/values-lt-rLT/strings.xml | 32 +++++++++ .../src/main/res/values-pl-rPL/strings.xml | 13 ++++ .../src/main/res/values-pt-rBR/strings.xml | 1 + .../src/main/res/values-pt-rPT/strings.xml | 28 ++++++++ .../src/main/res/values-ro-rRO/strings.xml | 30 +++++++++ .../src/main/res/values-sk-rSK/strings.xml | 12 ++++ .../src/main/res/values-sv-rSE/strings.xml | 28 ++++++++ 56 files changed, 352 insertions(+), 20 deletions(-) diff --git a/app/src/main/res/values-cs-rCZ/strings.xml b/app/src/main/res/values-cs-rCZ/strings.xml index 5a9ff0129f..0d8a78f482 100644 --- a/app/src/main/res/values-cs-rCZ/strings.xml +++ b/app/src/main/res/values-cs-rCZ/strings.xml @@ -645,7 +645,6 @@ Pro oznámení vyžaduje aplikace oprávnění systémového okna Aplikace potřebuje oprávnění k přístupu k poloze kvůli skenování BT a WiFi identifikaci Aby bylo možné nahrávat logy a exportovat nastavení, je nutné pro aplikaci povolit oprávnění přístupu k úložišti - Aplikace potřebuje oprávnění bluetooth Požadavek Otevřít menu Zavřít menu diff --git a/app/src/main/res/values-da-rDK/strings.xml b/app/src/main/res/values-da-rDK/strings.xml index 0f64e595f1..b21dfe69b3 100644 --- a/app/src/main/res/values-da-rDK/strings.xml +++ b/app/src/main/res/values-da-rDK/strings.xml @@ -636,7 +636,6 @@ Applikationen mangler system vindues tilladelse til notifikationer Applikationen mangler lokations tilladelse til BT scanning og WIFI identifikation Applikationen mangler lagerstyrings tilladelse for at gemme logfiler og exporteringsindstillinger - Applikationen kræver tilladelse til bluetooth Anmod Åbn navigation Luk navigation diff --git a/app/src/main/res/values-de-rDE/strings.xml b/app/src/main/res/values-de-rDE/strings.xml index 0ccb861169..43c2f5b311 100644 --- a/app/src/main/res/values-de-rDE/strings.xml +++ b/app/src/main/res/values-de-rDE/strings.xml @@ -633,7 +633,6 @@ Die App benötigt die Systemberechtigung für App-Benachrichtigungen Die App benötigt die Berechtigung für den Standort, um Bluetooth und WLAN nutzen zu können Die App benötigt Zugriffsrechte für den Speicher um Log-Dateien zu sichern und die Einstellungen zu exportieren. - App benötigt Bluetooth-Berechtigung Anfordern Menü öffnen Menü schließen diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index d8e5d59e56..7f18165931 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -645,7 +645,6 @@ La aplicación necesita permisos del sistema para poder mostrarse sobre otras aplicaciones, para las notificaciones La aplicación necesita permiso de ubicación para poder buscar dispositivos Bluetooth y redes WiFi La aplicación necesita permiso de almacenamiento para poder almacenar archivos de registro y valores de exportación - La aplicación necesita permiso de bluetooth Solicitar Abrir navegación Cerrar navegación diff --git a/app/src/main/res/values-fr-rFR/strings.xml b/app/src/main/res/values-fr-rFR/strings.xml index 5988390a0d..fd5d099938 100644 --- a/app/src/main/res/values-fr-rFR/strings.xml +++ b/app/src/main/res/values-fr-rFR/strings.xml @@ -646,7 +646,6 @@ L\'ENSEMBLE DES RISQUES LIÉS À LA QUALITÉ ET À LA PERFORMANCE DU PROGRAMME S L\'application a besoin de l\'autorisation d\'accès à la fenêtre système pour les notifications L\'application a besoin de l\'autorisation de localisation pour l\'analyse BT et l\'identification WiFi L\'application a besoin d\'une autorisation de stockage pour pouvoir stocker les fichiers journaux et les paramètres d\'exportation - L\'application a besoin de l\'autorisation Bluetooth Demande Ouvrir navigation Fermer navigation diff --git a/app/src/main/res/values-it-rIT/strings.xml b/app/src/main/res/values-it-rIT/strings.xml index 699936420f..191d76f1b6 100644 --- a/app/src/main/res/values-it-rIT/strings.xml +++ b/app/src/main/res/values-it-rIT/strings.xml @@ -645,7 +645,6 @@ L\'applicazione richiede l\'autorizzazione \"finestra di sistema\" per le notifiche L\'applicazione richiede l\'accesso alla posizione per la scansione bluetooth e l\'identificazione WiFi L\'applicazione richiede l\'accesso alla memoria per memorizzare i file di log ed esportare le impostazioni - L\'applicazione richiede l\'autorizzazione bluetooth Richiesta Apri navigazione Chiudi navigazione diff --git a/app/src/main/res/values-iw-rIL/strings.xml b/app/src/main/res/values-iw-rIL/strings.xml index a51a33dfee..536056923b 100644 --- a/app/src/main/res/values-iw-rIL/strings.xml +++ b/app/src/main/res/values-iw-rIL/strings.xml @@ -645,7 +645,6 @@ האפליקציה צריכה הרשאת מערכת של חלונות לצורך התראות דרושה הרשאת מיקום עבור סריקת בלוטות\' וזיהוי WiFi דרושה הרשאת אחסון כדי שתוכלו לאחסן קובצי יומן והגדרות יצוא. - האפליקציה צריכה הרשאה לבלוטות\' בקשה פתח ניווט סגור ניווט diff --git a/app/src/main/res/values-lt-rLT/strings.xml b/app/src/main/res/values-lt-rLT/strings.xml index 211286d69f..dcf41407e5 100644 --- a/app/src/main/res/values-lt-rLT/strings.xml +++ b/app/src/main/res/values-lt-rLT/strings.xml @@ -631,7 +631,6 @@ Norint gauti pranešimus, programai reikalingas sisteminio lango leidimas Programai reikia vietos nustatymo leidimo, kad būtų galima naudoti Bluetooth ir WiFi Aplikacijai reikia leidimo prieigai prie saugyklos, kad galėtų išsaugoti žurnalo įrašus ir eksportavimo nustatymus - Programai reikalinga Bluetooth prieigos teisė Užklausa Atidaryti meniu Uždaryti meniu @@ -894,6 +893,7 @@ Negalimas + Rūšiuoti Prisijungti diff --git a/app/src/main/res/values-nl-rNL/strings.xml b/app/src/main/res/values-nl-rNL/strings.xml index b1beae35b7..d9a282aaf0 100644 --- a/app/src/main/res/values-nl-rNL/strings.xml +++ b/app/src/main/res/values-nl-rNL/strings.xml @@ -645,7 +645,6 @@ Toepassing vereist systeemvenstermachtiging voor meldingen App heeft locatie toestemming nodig voor Bluetooth scan en WiFi identificatie Applicatie heeft toestemming nodig om log bestanden op te slaan en instellingen te exporteren - Applicatie heeft Bluetooth toestemming nodig Verzoek Open navigatie Sluit navigatie diff --git a/app/src/main/res/values-no-rNO/strings.xml b/app/src/main/res/values-no-rNO/strings.xml index 21dbe2cb6a..b485585ece 100644 --- a/app/src/main/res/values-no-rNO/strings.xml +++ b/app/src/main/res/values-no-rNO/strings.xml @@ -645,7 +645,6 @@ App trenger tillatelse til å bruke Varslinger for å vise meldinger App trenger tilgang til Posisjon for å søke etter Bluetooth og Wifi enheter App trenger tilgang til Lagring for lagre logg filer og eksportere innstillinger - Appen trenger bluetooth tillatelse Forespørsel Åpne meny Lukk meny diff --git a/app/src/main/res/values-pl-rPL/strings.xml b/app/src/main/res/values-pl-rPL/strings.xml index 716f005083..f91047c74f 100644 --- a/app/src/main/res/values-pl-rPL/strings.xml +++ b/app/src/main/res/values-pl-rPL/strings.xml @@ -244,6 +244,7 @@ Oprogramowanie Wear (Smartwatch) Prześlij ponownie wszystkie dane Otwórz ustawienia dla Wear + Dawka bazowa Wartość bazy poniżej minimum. Nie ustawiono profilu! BG: Ostatnia BG: @@ -631,7 +632,6 @@ Aplikacja wymaga uprawnienia systemowego okna dla powiadomień Aplikacja wymaga dostępu do lokalizacji dla zarządzania bluetoothem i identyfikacją Wi-Fi Aplikacja wymaga zgody na zapis do pamięci, aby móc przechować pliki logów i eksportować ustawienia - Aplikacja wymaga uprawnienia Bluetooth Żądanie Otwórz menu Zamknij menu @@ -667,6 +667,7 @@ Leczenie (insulina: %1$.2f, węglowodany: %2$d, czas:%3$s) nie mogą być dodane. Sprawdź i dodaj ręcznie rekord w razie potrzeby. eWęgle: %1$d g (%2$d h), Opóźnienie: %3$d m Brak dostępnych danych autosens + Log files Ustawienia logów Przywróć ustawienia domyślne Usterka NSClient. Spróbuj zrestartować NS i NSClient. @@ -748,6 +749,8 @@ Nazwa profilu zawiera kropki.\nTo nie jest obsługiwane przez NS.\nProfil nie zostanie przesyłany do NS. Dolna wartość zakresu docelowego (tylko do wyświetlania) Górna wartość zakresu docelowego (tylko do wyświetlania) + Czas + Waga ID: Wyślij Najczęściej używany profil: @@ -797,6 +800,7 @@ Na każdym telefonie śledzącym zainstalować aplikację uwierzytelniania obsługującą tokeny TOTP RFC 6238 Popularne darmowe aplikacje:\n • Authy\n • Google Authenticator\n • LastPass Authenticator\n • FreeOTP Authenticator Resetowanie uwierzytelniania powoduje, że wszystkie już ustawione uwierzytelnienia stają się niepoprawne (przestają działać). Trzeba będzie je jeszcze raz skonfigurować! Prognozy poziomu + Zabiegi Krzywa odchylenie Autoryzacja nie powiodła się Cała insulina @@ -896,6 +900,7 @@ Usuń wybrane pozycje Czy na pewno chcesz usunąć %1$d pozycji + Brak wpisów Wybrany %1$d Sortuj Zaloguj się diff --git a/app/src/main/res/values-pt-rPT/strings.xml b/app/src/main/res/values-pt-rPT/strings.xml index 1049c0380e..b435fbeb69 100644 --- a/app/src/main/res/values-pt-rPT/strings.xml +++ b/app/src/main/res/values-pt-rPT/strings.xml @@ -631,7 +631,6 @@ Aplicação precisa de permissão de janela do sistema para notificações Aplicação necessita de permissão de localização para pesquisa Bluetooth e identificação Wi-Fi A aplicação precisa da permissão de armazenamento para poder armazenar ficheiros de registo e exportar definições - Aplicação precisa de permissão Bluetooth Pedido Abrir a navegação Fechar a navegação diff --git a/app/src/main/res/values-ro-rRO/strings.xml b/app/src/main/res/values-ro-rRO/strings.xml index 2d55df640a..44c5283a22 100644 --- a/app/src/main/res/values-ro-rRO/strings.xml +++ b/app/src/main/res/values-ro-rRO/strings.xml @@ -631,7 +631,6 @@ Aplicația are nevoie de permisiune la fereastra sistemului pentru a afișa notificări Aplicația are nevoie sa acceseze locația pentru scanare Bluetooth și identificare WiFi Aplicația are nevoie de permisiunea de a accesa unitatea de stocare pentru a scrie fișierele registru și pentru a exporta setările - Aplicația are nevoie de permisiune Bluetooth Cerință Afișare navigație Închidere navigație diff --git a/app/src/main/res/values-ru-rRU/strings.xml b/app/src/main/res/values-ru-rRU/strings.xml index fa3d099a67..76c70619d1 100644 --- a/app/src/main/res/values-ru-rRU/strings.xml +++ b/app/src/main/res/values-ru-rRU/strings.xml @@ -645,7 +645,6 @@ Приложению требуется разрешение системного окна для уведомлений Приложению требуется разрешение на доступ к местоположению для сканирования BT и идентификации WiFi Приложение требует разрешения на доступ к записи в память, чтобы хранить файлы журналов и настройки экспорта - Приложению требуется разрешение Bluetooth Запрос Показать панель навигации Cкрыть панель навигации diff --git a/app/src/main/res/values-sk-rSK/strings.xml b/app/src/main/res/values-sk-rSK/strings.xml index c77651b5d5..5173d5ea18 100644 --- a/app/src/main/res/values-sk-rSK/strings.xml +++ b/app/src/main/res/values-sk-rSK/strings.xml @@ -645,7 +645,6 @@ Aplikácia vyžaduje pre oznámenia systémové oprávnenie Aplikácia vyžaduje oprávnenie polohy, pre vyhľadávanie BT a identifikáciu WiFi Aby bolo možné nahrávať logy a exportovať nastavenia, je nutné pre aplikáciu povoliť oprávnenie prístupu k úložisku - Aplikácia vyžaduje povolenie bluetooth Požiadavka Otvoriť Menu Zavrieť Menu diff --git a/app/src/main/res/values-sv-rSE/strings.xml b/app/src/main/res/values-sv-rSE/strings.xml index a85a2e4cb2..3a6718d5c3 100644 --- a/app/src/main/res/values-sv-rSE/strings.xml +++ b/app/src/main/res/values-sv-rSE/strings.xml @@ -636,7 +636,6 @@ Eversense-appen. Applikationen behöver förhöjd behörighet för aviseringar Appen behöver platsåtkomst för bluetooth- och WiFi-identifiering Applikationen behöver lagringsbehörighet för att kunna lagra loggfiler och exportinställningar - Applikationen behöver bluetooth-behörighet Begäran Öppna menyn Stäng menyn diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index 12b3ce5b18..ee47a75e18 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -646,7 +646,6 @@ Aktif Karbonhidratın ne kadar hızlı sindirildiğine ve KŞ\'nin beklenenden d Uygulama, bildirimler için sistem iznine ihtiyaç duyuyor Uygulamanın BT taraması ve WiFi tanımlaması için konum iznine ihtiyacı var Uygulamanın, günlük dosyalarını saklayabilmesi ve ayarları dışa aktarabilmesi için depolama iznine ihtiyacı var - Uygulama bluetooth iznine ihtiyac duyuyor İstek Navigasyonu aç Navigasyonu kapat diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 642148ddb4..47018ea425 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -432,6 +432,7 @@ 启用本地广播。 OpenAPS SMB 动态ISF(胰岛素敏感系数) + 动态ISF的调整因子。设置100%以上用于更积极的校正,100%以下则不那么积极校正。 启用 UAM 启用微型大剂量 使用微型大剂量代替使用临时基础率,更快的干预 @@ -636,7 +637,6 @@ 应用程序需要悬浮窗权限用于发送通知。 应用程序需要定位权限,才能进行蓝牙扫描及WIFI识别。 应用程序需要文件存储权限,才能存储日志文件及导出设置。 - 应用程序需要蓝牙权限。 请求 打开导航栏 关闭导航栏 diff --git a/automation/src/main/res/values-lt-rLT/strings.xml b/automation/src/main/res/values-lt-rLT/strings.xml index acd9f4fba0..c4d36915e2 100644 --- a/automation/src/main/res/values-lt-rLT/strings.xml +++ b/automation/src/main/res/values-lt-rLT/strings.xml @@ -112,4 +112,5 @@ Automatizuotas įvykis Pertvarkyti Vartotojo veiksmas + Rūšiuoti diff --git a/core/src/main/res/values-bg-rBG/strings.xml b/core/src/main/res/values-bg-rBG/strings.xml index 183980600d..e6b584986c 100644 --- a/core/src/main/res/values-bg-rBG/strings.xml +++ b/core/src/main/res/values-bg-rBG/strings.xml @@ -289,6 +289,7 @@ SMS Базал + Апликацията изисква разрешение за bluetooth %1$d дeн %1$d дни diff --git a/core/src/main/res/values-ca-rES/strings.xml b/core/src/main/res/values-ca-rES/strings.xml index 1eb5f978ea..6cd9b7b34c 100644 --- a/core/src/main/res/values-ca-rES/strings.xml +++ b/core/src/main/res/values-ca-rES/strings.xml @@ -70,4 +70,5 @@ Basal + L\'aplicació necessita el permís del bluethoot diff --git a/core/src/main/res/values-cs-rCZ/strings.xml b/core/src/main/res/values-cs-rCZ/strings.xml index b0570bbe77..81d72c8309 100644 --- a/core/src/main/res/values-cs-rCZ/strings.xml +++ b/core/src/main/res/values-cs-rCZ/strings.xml @@ -489,6 +489,7 @@ Autotune spuštěno, a profil automaticky přepnut Chyba při posledním spuštění Autotune Byla zjištěna jiná běžící úloha Autotune, spuštění zrušeno + Aplikace potřebuje oprávnění bluetooth %1$d den %1$d dnů diff --git a/core/src/main/res/values-da-rDK/strings.xml b/core/src/main/res/values-da-rDK/strings.xml index d446162c2f..013f43fc61 100644 --- a/core/src/main/res/values-da-rDK/strings.xml +++ b/core/src/main/res/values-da-rDK/strings.xml @@ -482,6 +482,7 @@ Autotune kørt uden profilskift Autotune kørt, profilen er automatisk skiftet Fejl under sidste Autotune kørsel + Applikationen kræver tilladelse til bluetooth %1$d dag %1$d dage diff --git a/core/src/main/res/values-de-rDE/strings.xml b/core/src/main/res/values-de-rDE/strings.xml index 5b12029067..400da03d56 100644 --- a/core/src/main/res/values-de-rDE/strings.xml +++ b/core/src/main/res/values-de-rDE/strings.xml @@ -433,6 +433,7 @@ %1$d ausgewählt Sortieren + App benötigt Bluetooth-Berechtigung %1$d Tag %1$d Tage diff --git a/core/src/main/res/values-es-rES/strings.xml b/core/src/main/res/values-es-rES/strings.xml index 24f6b404b5..502b29f99b 100644 --- a/core/src/main/res/values-es-rES/strings.xml +++ b/core/src/main/res/values-es-rES/strings.xml @@ -489,6 +489,7 @@ Autotune ejecutado y perfil cambiado automáticamente Error durante la última ejecución de Autotune Se ha detectado otra ejecución de Autotune, ejecución cancelada + La aplicación necesita permiso de bluetooth %1$d día %1$d días diff --git a/core/src/main/res/values-it-rIT/strings.xml b/core/src/main/res/values-it-rIT/strings.xml index fa7260b877..752b4f9264 100644 --- a/core/src/main/res/values-it-rIT/strings.xml +++ b/core/src/main/res/values-it-rIT/strings.xml @@ -489,6 +489,7 @@ Autotune eseguito e profilo cambiato automaticamente Errore durante l\'ultima esecuzione di Autotune È stata rilevata un\'altra esecuzione di Autotune, esecuzione annullata + L\'applicazione richiede l\'autorizzazione bluetooth %1$d giorno %1$d giorni diff --git a/core/src/main/res/values-iw-rIL/strings.xml b/core/src/main/res/values-iw-rIL/strings.xml index 20cb735c6e..c837a798e3 100644 --- a/core/src/main/res/values-iw-rIL/strings.xml +++ b/core/src/main/res/values-iw-rIL/strings.xml @@ -489,6 +489,7 @@ כוונון אוטומטי הופעל והפרופיל הוחלף אוטומטית שגיאה במהלך הכיוונון האוטומטי האחרון נמצאה הפעלה נוספת של הכוונון האוטומטי ברקע, ההפעלה מבוטלת + האפליקציה צריכה הרשאה לבלוטות\' %1$d יום %1$d ימים diff --git a/core/src/main/res/values-lt-rLT/strings.xml b/core/src/main/res/values-lt-rLT/strings.xml index c834cbf768..7a1c1ae6e6 100644 --- a/core/src/main/res/values-lt-rLT/strings.xml +++ b/core/src/main/res/values-lt-rLT/strings.xml @@ -422,6 +422,7 @@ Insight Mygtukas Naujinti Valandinė bazė + Programai reikalinga Bluetooth prieigos teisė %1$d d. %1$d d. diff --git a/core/src/main/res/values-no-rNO/strings.xml b/core/src/main/res/values-no-rNO/strings.xml index b25407ac6a..9e40af43c0 100644 --- a/core/src/main/res/values-no-rNO/strings.xml +++ b/core/src/main/res/values-no-rNO/strings.xml @@ -489,6 +489,7 @@ Autotune utført og profil automatisk skiftet ut Feil oppdaget under siste Autotune kjøring Autotune kjører allerede. Kjøring avbrutt + Appen trenger bluetooth tillatelse %1$d dag %1$d dager diff --git a/core/src/main/res/values-pl-rPL/strings.xml b/core/src/main/res/values-pl-rPL/strings.xml index eba2bf6385..9c1bd98569 100644 --- a/core/src/main/res/values-pl-rPL/strings.xml +++ b/core/src/main/res/values-pl-rPL/strings.xml @@ -424,6 +424,7 @@ Wybrany %1$d Sortuj + Aplikacja wymaga uprawnienia Bluetooth %1$d dzień %1$d dni diff --git a/core/src/main/res/values-pt-rBR/strings.xml b/core/src/main/res/values-pt-rBR/strings.xml index fa70256576..d9a500837e 100644 --- a/core/src/main/res/values-pt-rBR/strings.xml +++ b/core/src/main/res/values-pt-rBR/strings.xml @@ -229,6 +229,7 @@ Habilitar apenas se você usar pico livre. Esta opção irá ajustar a duração do pico e da DAI Número padrão de dias de dados a serem processados por Autotune (até 30) Erro nos dados de entrada, tente executar novamente autotune ou reduza o número de dias + O aplicativo precisa de permissão bluetooth %1$d dia %1$d dias diff --git a/core/src/main/res/values-pt-rPT/strings.xml b/core/src/main/res/values-pt-rPT/strings.xml index 29c658270c..d4773c312c 100644 --- a/core/src/main/res/values-pt-rPT/strings.xml +++ b/core/src/main/res/values-pt-rPT/strings.xml @@ -341,6 +341,7 @@ Basal + Aplicação precisa de permissão Bluetooth %1$d dia %1$d dias diff --git a/core/src/main/res/values-ro-rRO/strings.xml b/core/src/main/res/values-ro-rRO/strings.xml index dc4b4b01f3..61976e3db9 100644 --- a/core/src/main/res/values-ro-rRO/strings.xml +++ b/core/src/main/res/values-ro-rRO/strings.xml @@ -424,6 +424,7 @@ Rate bazale Sortează + Aplicația are nevoie de permisiune Bluetooth %1$d zi %1$d zile diff --git a/core/src/main/res/values-ru-rRU/strings.xml b/core/src/main/res/values-ru-rRU/strings.xml index 473b44ee80..4fe3c93e3a 100644 --- a/core/src/main/res/values-ru-rRU/strings.xml +++ b/core/src/main/res/values-ru-rRU/strings.xml @@ -489,6 +489,7 @@ Autotune выполнен и профиль переключён автоматически Ошибка во время последнего выполнения Autotune Обнаружен другой запуск Autotune, выполнение отменено + Приложению требуется разрешение Bluetooth %1$d день %1$d дня diff --git a/core/src/main/res/values-sk-rSK/strings.xml b/core/src/main/res/values-sk-rSK/strings.xml index 1de2cd04aa..2d02b16fcb 100644 --- a/core/src/main/res/values-sk-rSK/strings.xml +++ b/core/src/main/res/values-sk-rSK/strings.xml @@ -489,6 +489,7 @@ Autotune spustený a profil automaticky prepnutý Chyba pri poslednom spustení Autotune Bola zistená iná spustená úloha Autotune, spustenie zrušené + Aplikácia vyžaduje povolenie bluetooth %1$d deň %1$d dní diff --git a/core/src/main/res/values-sv-rSE/strings.xml b/core/src/main/res/values-sv-rSE/strings.xml index 86d9f25d0c..06ace5156d 100644 --- a/core/src/main/res/values-sv-rSE/strings.xml +++ b/core/src/main/res/values-sv-rSE/strings.xml @@ -430,6 +430,7 @@ öka %1$s med %2$s Basal + Applikationen behöver bluetooth-behörighet %1$d dag %1$d dagar diff --git a/core/src/main/res/values-tr-rTR/strings.xml b/core/src/main/res/values-tr-rTR/strings.xml index 4ecfd908e0..1aec44dfd1 100644 --- a/core/src/main/res/values-tr-rTR/strings.xml +++ b/core/src/main/res/values-tr-rTR/strings.xml @@ -489,6 +489,7 @@ OtoAyar çalıştırıldı ve profil otomatik olarak değiştirildi Son OtoAyar çalışması sırasında hata oluştu Başka bir OtoAyar çalıştırması tespit edildi, çalıştırma iptal edildi + Uygulama bluetooth iznine ihtiyac duyuyor %1$d gün %1$d gün diff --git a/core/src/main/res/values-zh-rCN/strings.xml b/core/src/main/res/values-zh-rCN/strings.xml index d64d0e7d41..6d270b5a14 100644 --- a/core/src/main/res/values-zh-rCN/strings.xml +++ b/core/src/main/res/values-zh-rCN/strings.xml @@ -442,6 +442,7 @@ 文件 用户 + 应用程序需要蓝牙权限。 %1$d 天 diff --git a/diaconn/src/main/res/values-ko-rKR/strings.xml b/diaconn/src/main/res/values-ko-rKR/strings.xml index f17e4a3c77..29cb87c694 100644 --- a/diaconn/src/main/res/values-ko-rKR/strings.xml +++ b/diaconn/src/main/res/values-ko-rKR/strings.xml @@ -89,8 +89,6 @@ 바늘 교체 로그 동기화 시 케어포털 \"위치 교체\" 정보 자동 업로드 로그 동기화 시 케어포털 \"베터리 교체\" 정보 자동 업로드 - 펌프 로그정보를 \"디아콘 클라우드\"로 자동 업로드 - 디아콘 클라우드 전송 베터리 교체 로그 동기화 진행 중 인슐린 부족 경고 diff --git a/pump-common/src/main/res/values-af-rZA/strings.xml b/pump-common/src/main/res/values-af-rZA/strings.xml index 33c77af761..555b0265bf 100644 --- a/pump-common/src/main/res/values-af-rZA/strings.xml +++ b/pump-common/src/main/res/values-af-rZA/strings.xml @@ -1,6 +1,7 @@ + Operasie nog nie ondersteun deur pomp. diff --git a/pump-common/src/main/res/values-bg-rBG/strings.xml b/pump-common/src/main/res/values-bg-rBG/strings.xml index 33c77af761..6d8edea0a3 100644 --- a/pump-common/src/main/res/values-bg-rBG/strings.xml +++ b/pump-common/src/main/res/values-bg-rBG/strings.xml @@ -1,11 +1,39 @@ + Помпата не поддържа тази операция. + Операцията не се поддържа от помпата (ВСЕ ОЩЕ). + ОК + Събуждане + Грешка в комуникацията + Изтече времето за връзка + Помпата е недостъпна + Грешна конфигурация + Активна + Спинка си + Базали + Конфигурации + Известия + Статистика + Неизвестни + Всички + Болуси + Пълнене + Аларми + Кръвна захар + + %1$d ден + %1$d дни + + + %1$d часа + %1$d часа + diff --git a/pump-common/src/main/res/values-ca-rES/strings.xml b/pump-common/src/main/res/values-ca-rES/strings.xml index 33c77af761..9c30e430ff 100644 --- a/pump-common/src/main/res/values-ca-rES/strings.xml +++ b/pump-common/src/main/res/values-ca-rES/strings.xml @@ -1,11 +1,37 @@ + Operació no compatible amb la bomba i/o controlador. + Operació no compatible ENCARA amb la bomba. + Iniciant + Error de comunicació + Temps d\'espera excedit en la comunicació + Bomba no accessible + Configuració no vàlida + Activa + En suspens + Basals + Configuracions + Avisos + Estadístiques + Desconeguts + Tots + Bolus + Encebaments + Alarmes + + %1$d dia + %1$d dies + + + %1$d hora + %1$d hores + diff --git a/pump-common/src/main/res/values-da-rDK/strings.xml b/pump-common/src/main/res/values-da-rDK/strings.xml index 33c77af761..cdd499a65b 100644 --- a/pump-common/src/main/res/values-da-rDK/strings.xml +++ b/pump-common/src/main/res/values-da-rDK/strings.xml @@ -8,4 +8,12 @@ + + %1$d dag + %1$d dage + + + %1$d time + %1$d timer + diff --git a/pump-common/src/main/res/values-de-rDE/strings.xml b/pump-common/src/main/res/values-de-rDE/strings.xml index 33c77af761..7c01b0163d 100644 --- a/pump-common/src/main/res/values-de-rDE/strings.xml +++ b/pump-common/src/main/res/values-de-rDE/strings.xml @@ -1,11 +1,39 @@ + Aktion von Pumpe und/oder Treiber nicht unterstützt. + Operation NOCH NICHT von Pumpe unterstützt. + OK + Aufwecken + Fehler bei der Kommunikation + Zeitüberschreitung bei Kommunikation + Pumpe nicht erreichbar + Ungültige Einstellung + Aktiv + Schlafen + Basal + Konfigurationen + Benachrichtigungen + Statistiken + Unbekannte + Alle + Boli + Füllen + Alarme + Glukose + + %1$d Tag + %1$d Tage + + + %1$d Stunde + %1$d Stunden + diff --git a/pump-common/src/main/res/values-el-rGR/strings.xml b/pump-common/src/main/res/values-el-rGR/strings.xml index 33c77af761..11a7c88fb4 100644 --- a/pump-common/src/main/res/values-el-rGR/strings.xml +++ b/pump-common/src/main/res/values-el-rGR/strings.xml @@ -1,6 +1,7 @@ + Η λειτουργία δεν υποστηρίζεται ΑΚΟΜΑ από την αντλία. diff --git a/pump-common/src/main/res/values-ga-rIE/strings.xml b/pump-common/src/main/res/values-ga-rIE/strings.xml index 33c77af761..6bf78d23ab 100644 --- a/pump-common/src/main/res/values-ga-rIE/strings.xml +++ b/pump-common/src/main/res/values-ga-rIE/strings.xml @@ -1,8 +1,15 @@ + Ceart go leor + Gníomhach + Bunaidhi + Ar fad + Bólasi + Aláraim + Glúcóis diff --git a/pump-common/src/main/res/values-hu-rHU/strings.xml b/pump-common/src/main/res/values-hu-rHU/strings.xml index 33c77af761..9453621bea 100644 --- a/pump-common/src/main/res/values-hu-rHU/strings.xml +++ b/pump-common/src/main/res/values-hu-rHU/strings.xml @@ -8,4 +8,12 @@ + + %1$d nap + %1$d nap + + + %1$d óra + %1$d óra + diff --git a/pump-common/src/main/res/values-iw-rIL/strings.xml b/pump-common/src/main/res/values-iw-rIL/strings.xml index da2dfd704a..5142e46ea1 100644 --- a/pump-common/src/main/res/values-iw-rIL/strings.xml +++ b/pump-common/src/main/res/values-iw-rIL/strings.xml @@ -4,6 +4,7 @@ הפעולה לא נתמכת ע\"י המשאבה ו\\או מנהל ההתקן. הפעולה עוד לא נתמכת על ידי המשאבה. אישור + המספר הסידורי של המשאבה מעולם לא נוצר קשר מתעורר @@ -13,6 +14,13 @@ תצורה לא חוקית פעיל שינה + לא מאותחל + מאותחל + מצפין תקשורת + מוכן + עסוק + מושהה + מבצע פקודה בזאלים תצורות @@ -24,9 +32,67 @@ תיחול התראות גלוקוז + בסיס + אחר + כל האירועים + אירועים(ללא סטטיסטיקה) + היום + בשעה האחרונה + ב-3 השעות האחרונות + ב-6 השעות האחרונות + ב-12 השעות האחרונות + ביומיים אחרונים + ב-4 הימים האחרונים + בשבוע שעבר + בחודש שעבר + סריקה + עצור + נבחר + סורק + הסריקה הושלמה + שגיאת סריקה: %1$d + אף פעם + הסרה + בלוטות\' כבוי + אין מתאם בלוטות\' + לא נמצאה משאבה מוגדרת + המשאבה אינה זמינה + נכשל החיבור למכשיר בלוטות\' + ההצפנה נכשלה + נמצאה משאבה שאינה מצומדת + הגדרת פרופילי הבזאלי\\תבניות אינה מאופשרת במשאבה. הפעילו אותן בגוף המשאבה. + הפרופיל הבזאלי שהוגדר במשאבה שגוי (חייב להיות %s). + סוג הבזאלי הזמני שהוגדר במשאבה שגוי (חייב להיות %s). + מינון הבולוס המרבי המוגדר במשאבה אינו נכון (חייב להיות %1$.2f). + המינון הבזאלי המרבי המוגדר במשאבה אינו נכון (חייב להיות %1$.2f). + סוג: + + יום %1$d + יומיים + %1$d ימים + %1$d ימים + + + שעה + שעתיים + %1$d שעות + %1$d שעות + + + לפני שעה + לפני שעתיים + לפני %1$d שעות + לפני %1$d שעות + + + לפני יום אחד + לפני יומיים + לפני %1$d ימים + לפני %1$d ימים + diff --git a/pump-common/src/main/res/values-ko-rKR/strings.xml b/pump-common/src/main/res/values-ko-rKR/strings.xml index 33c77af761..e247034563 100644 --- a/pump-common/src/main/res/values-ko-rKR/strings.xml +++ b/pump-common/src/main/res/values-ko-rKR/strings.xml @@ -1,6 +1,7 @@ + 펌프에서 지원되지 않는 작동. @@ -8,4 +9,10 @@ + + %1$d 일 + + + %1$d 시간 + diff --git a/pump-common/src/main/res/values-lt-rLT/strings.xml b/pump-common/src/main/res/values-lt-rLT/strings.xml index 33c77af761..84e1d1c00b 100644 --- a/pump-common/src/main/res/values-lt-rLT/strings.xml +++ b/pump-common/src/main/res/values-lt-rLT/strings.xml @@ -1,11 +1,43 @@ + Pompa ir/ar jos valdiklis nepalaiko operacijos. + Pompa dar nepalaiko operacijos. + Gerai + Pažadinimas + Ryšio klaida + Ryšiui skirtas laikas baigėsi + Pompa nepasiekiama + Neteisinga konfigūracija + Aktyvi + Užmigusi + Bazė + Nustatymai + Pranešimai + Statistika + Nežinoma + Visi + Bolusai + Užpildyti sistemą + Aliarmai + Gliukozė + + %1$d d. + %1$d d. + %1$d d. + %1$d d. + + + %1$d val. + %1$d val. + %1$d val. + %1$d val. + diff --git a/pump-common/src/main/res/values-pl-rPL/strings.xml b/pump-common/src/main/res/values-pl-rPL/strings.xml index 33c77af761..b306d45c6e 100644 --- a/pump-common/src/main/res/values-pl-rPL/strings.xml +++ b/pump-common/src/main/res/values-pl-rPL/strings.xml @@ -3,9 +3,22 @@ + Napełnianie + + %1$d dzień + %1$d dni + %1$d dni + %1$d dni + + + %1$d godzina + %1$d godziny + %1$d godzin + %1$d godzin + diff --git a/pump-common/src/main/res/values-pt-rBR/strings.xml b/pump-common/src/main/res/values-pt-rBR/strings.xml index 33c77af761..770dc80acb 100644 --- a/pump-common/src/main/res/values-pt-rBR/strings.xml +++ b/pump-common/src/main/res/values-pt-rBR/strings.xml @@ -1,6 +1,7 @@ + Operação não suportada ainda pela Bomba. diff --git a/pump-common/src/main/res/values-pt-rPT/strings.xml b/pump-common/src/main/res/values-pt-rPT/strings.xml index 33c77af761..77bc7ca340 100644 --- a/pump-common/src/main/res/values-pt-rPT/strings.xml +++ b/pump-common/src/main/res/values-pt-rPT/strings.xml @@ -1,11 +1,39 @@ + Operação não suportada pela Bomba e/ou Controlador. + Operação não suportada ainda pela Bomba. + OK + A acordar + Erro com comunicação + Tempo limite para comunicação + Bomba inacessível + Configuração inválida + Activo + A dormir + Basais + Configurações + Notificações + Estatísticas + Desconhecido + Tudo + Bólus + Purgar + Alarmes + Glucose + + %1$d dia + %1$d dias + + + %1$d hora + %1$d horas + diff --git a/pump-common/src/main/res/values-ro-rRO/strings.xml b/pump-common/src/main/res/values-ro-rRO/strings.xml index 33c77af761..5ef0652d1d 100644 --- a/pump-common/src/main/res/values-ro-rRO/strings.xml +++ b/pump-common/src/main/res/values-ro-rRO/strings.xml @@ -1,11 +1,41 @@ + Operațiunea nu este suportată de către pompă și/sau driver. + Operațiunea nu este ÎNCĂ suportată de către pompă. + OK + Se pornește + Eroare de comunicație + Comunicația nu a reușit la timp + Pompă indisponibilă + Configurație invalidă + Activă + În repaus + Bazale + Configurații + Notificări + Statistici + Necunoscute + Toate + Bolusuri + Amorsare + Alarme + Glicemie + + %1$d zi + %1$d zile + %1$d zile + + + %1$d oră + %1$d ore + %1$d ore + diff --git a/pump-common/src/main/res/values-sk-rSK/strings.xml b/pump-common/src/main/res/values-sk-rSK/strings.xml index 2c707642f5..f0498d6f86 100644 --- a/pump-common/src/main/res/values-sk-rSK/strings.xml +++ b/pump-common/src/main/res/values-sk-rSK/strings.xml @@ -29,4 +29,16 @@ + + %1$d deň + %1$d dní + %1$d dní + %1$d dní + + + %1$d hodina + %1$d hodín + %1$d hodín + %1$d hodín + diff --git a/pump-common/src/main/res/values-sv-rSE/strings.xml b/pump-common/src/main/res/values-sv-rSE/strings.xml index 33c77af761..22fbdda8af 100644 --- a/pump-common/src/main/res/values-sv-rSE/strings.xml +++ b/pump-common/src/main/res/values-sv-rSE/strings.xml @@ -1,11 +1,39 @@ + Operation stöds inte av pumpen/pumpdrivrutinen. + Operationen stöds inte av pumpen ännu. + OK + Väcker + Kommunikationsfel + Kommunikationstimeout + Pumpen kan inte nås + Felaktig konfiguration + Aktiv + Sover + Basaldoser + Konfigurationer + Notiser + Statistik + Okända + Alla + Bolusar + Förfyllningar + Larm + Glukos + + %1$d dag + %1$d dagar + + + %1$d tim + %1$d tim + From 5db4493478a00848b705e773f2222db5ba559173 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 22 Jul 2022 11:35:52 +0200 Subject: [PATCH 17/18] bump 3.1.0.1 --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 16ccd87365..29a789c416 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -105,7 +105,7 @@ android { defaultConfig { multiDexEnabled true versionCode 1500 - version "3.1.0-dev-a" + version "3.1.0.1" buildConfigField "String", "VERSION", '"' + version + '"' buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"' buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' From b5ac9f3b9409bed2fe1a1bef78017b948e9b5f40 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Fri, 22 Jul 2022 11:50:02 +0200 Subject: [PATCH 18/18] revert gradle --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index e5d3cb5adf..5aafa2b9ae 100644 --- a/build.gradle +++ b/build.gradle @@ -9,7 +9,7 @@ buildscript { rxkotlin_version = '3.0.1' room_version = '2.4.2' lifecycle_version = '2.5.0' - dagger_version = '2.43' + dagger_version = '2.42' coroutines_version = '1.6.4' activity_version = '1.4.0' fragmentktx_version = '1.4.1' @@ -49,7 +49,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:7.2.1' - classpath 'com.google.gms:google-services:4.3.10' + classpath 'com.google.gms:google-services:4.3.13' classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.1' // NOTE: Do not place your application dependencies here; they belong