This commit is contained in:
Milos Kozak 2022-06-07 08:04:37 +02:00
commit 8fd91a0713
48 changed files with 89 additions and 55 deletions

View file

@ -104,6 +104,8 @@ tasks.matching { it instanceof Test }.all {
} }
android { android {
namespace 'info.nightscout.androidaps'
ndkVersion "21.1.6352462" ndkVersion "21.1.6352462"
defaultConfig { defaultConfig {

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools">
package="info.nightscout.androidaps">
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />

View file

@ -79,6 +79,7 @@ class AutotuneFragment : DaggerFragment() {
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState) super.onViewCreated(view, savedInstanceState)
sp.putBoolean(R.string.key_autotune_tune_insulin_curve, false) // put to false tune insulin curve sp.putBoolean(R.string.key_autotune_tune_insulin_curve, false) // put to false tune insulin curve
sp.putBoolean(R.string.key_autotune_additional_log, false) // put to false additional log
autotunePlugin.lastRun = sp.getLong(R.string.key_autotune_last_run, 0) autotunePlugin.lastRun = sp.getLong(R.string.key_autotune_last_run, 0)
if (autotunePlugin.lastNbDays.isEmpty()) if (autotunePlugin.lastNbDays.isEmpty())
autotunePlugin.lastNbDays = sp.getInt(R.string.key_autotune_default_tune_days, 5).toString() autotunePlugin.lastNbDays = sp.getInt(R.string.key_autotune_default_tune_days, 5).toString()

View file

@ -161,7 +161,8 @@ class AutotunePlugin @Inject constructor(
updateProfile(tunedP) updateProfile(tunedP)
uel.log( uel.log(
UserEntry.Action.STORE_PROFILE, UserEntry.Action.STORE_PROFILE,
UserEntry.Sources.Autotune, UserEntry.Sources.Automation,
rh.gs(R.string.autotune),
ValueWithUnit.SimpleString(tunedP.profilename) ValueWithUnit.SimpleString(tunedP.profilename)
) )
updateButtonVisibility = View.GONE updateButtonVisibility = View.GONE
@ -178,8 +179,8 @@ class AutotunePlugin @Inject constructor(
log("Profile Switch succeed ${tunedP.profilename}") log("Profile Switch succeed ${tunedP.profilename}")
uel.log( uel.log(
UserEntry.Action.PROFILE_SWITCH, UserEntry.Action.PROFILE_SWITCH,
UserEntry.Sources.Autotune, UserEntry.Sources.Automation,
"Autotune AutoSwitch", rh.gs(R.string.autotune),
ValueWithUnit.SimpleString(tunedP.profilename)) ValueWithUnit.SimpleString(tunedP.profilename))
} }
rxBus.send(EventLocalProfileChanged()) rxBus.send(EventLocalProfileChanged())

View file

@ -36,11 +36,12 @@
android:key="@string/key_autotune_circadian_ic_isf" android:key="@string/key_autotune_circadian_ic_isf"
android:summary="@string/autotune_circadian_ic_isf_summary" android:summary="@string/autotune_circadian_ic_isf_summary"
android:title="@string/autotune_circadian_ic_isf_title" /> android:title="@string/autotune_circadian_ic_isf_title" />
<!-- Hide autotune_additional_log option
<SwitchPreference <SwitchPreference
android:defaultValue="false" android:defaultValue="false"
android:key="@string/key_autotune_additional_log" android:key="@string/key_autotune_additional_log"
android:summary="@string/autotune_additional_log_summary" android:summary="@string/autotune_additional_log_summary"
android:title="@string/autotune_additional_log_title" /> android:title="@string/autotune_additional_log_title" />
-->
</PreferenceCategory> </PreferenceCategory>
</androidx.preference.PreferenceScreen> </androidx.preference.PreferenceScreen>

View file

@ -8,6 +8,9 @@ apply from: "${project.rootDir}/core/android_dependencies.gradle"
apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android {
namespace 'info.nightscout.androidaps.automation'
}
dependencies { dependencies {

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.automation">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />

View file

@ -261,6 +261,7 @@ class AutomationPlugin @Inject constructor(
@Synchronized @Synchronized
fun add(event: AutomationEvent) { fun add(event: AutomationEvent) {
automationEvents.add(event) automationEvents.add(event)
event.position = automationEvents.size - 1
rxBus.send(EventAutomationDataChanged()) rxBus.send(EventAutomationDataChanged())
} }

View file

@ -28,7 +28,6 @@ class ActionRunAutotune(injector: HasAndroidInjector) : Action(injector) {
@Inject lateinit var profileFunction: ProfileFunction @Inject lateinit var profileFunction: ProfileFunction
@Inject lateinit var activePlugin: ActivePlugin @Inject lateinit var activePlugin: ActivePlugin
@Inject lateinit var sp: SP @Inject lateinit var sp: SP
@Inject lateinit var uel: UserEntryLogger
var defaultValue = 0 var defaultValue = 0
private var inputProfileName = InputProfileName(rh, activePlugin, "", true) private var inputProfileName = InputProfileName(rh, activePlugin, "", true)

View file

@ -3,7 +3,7 @@
buildscript { buildscript {
ext { ext {
kotlin_version = '1.6.21' kotlin_version = '1.6.21'
core_version = '1.7.0' core_version = '1.8.0'
rxjava_version = '3.1.5' rxjava_version = '3.1.5'
rxandroid_version = '3.0.0' rxandroid_version = '3.0.0'
rxkotlin_version = '3.0.1' rxkotlin_version = '3.0.1'
@ -16,7 +16,7 @@ buildscript {
ormLite_version = '4.46' ormLite_version = '4.46'
gson_version = '2.9.0' gson_version = '2.9.0'
nav_version = '2.4.2' nav_version = '2.4.2'
appcompat_version = '1.4.1' appcompat_version = '1.4.2'
material_version = '1.6.0' material_version = '1.6.0'
constraintlayout_version = '2.1.4' constraintlayout_version = '2.1.4'
preferencektx_version = '1.2.0' preferencektx_version = '1.2.0'

View file

@ -8,6 +8,9 @@ apply from: "${project.rootDir}/core/android_dependencies.gradle"
apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android {
namespace 'info.nightscout.androidaps.combo'
}
dependencies { dependencies {
implementation project(':core') implementation project(':core')

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.combo">
<application <application
android:supportsRtl="true"> android:supportsRtl="true">

View file

@ -15,3 +15,7 @@ dependencies {
implementation project(':shared') implementation project(':shared')
implementation project(':database') implementation project(':database')
} }
android {
namespace 'info.nightscout.androidaps.core'
}

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.core">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

View file

@ -10,6 +10,8 @@ apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android { android {
namespace 'info.nightscout.androidaps.dana'
defaultConfig { defaultConfig {
kapt { kapt {
arguments { arguments {

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.dana">
<application <application
android:supportsRtl="true"> android:supportsRtl="true">

View file

@ -8,6 +8,9 @@ apply from: "${project.rootDir}/core/android_dependencies.gradle"
apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android {
namespace 'info.nightscout.androidaps.danar'
}
dependencies { dependencies {
implementation project(':core') implementation project(':core')

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.danar" >
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />

View file

@ -11,6 +11,7 @@ apply from: "${project.rootDir}/core/jacoco_global.gradle"
android { android {
ndkVersion "21.1.6352462" ndkVersion "21.1.6352462"
namespace 'info.nightscout.androidaps.danars'
defaultConfig { defaultConfig {

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.danars">
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View file

@ -7,6 +7,8 @@ apply from: "${project.rootDir}/core/android_dependencies.gradle"
apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
android { android {
namespace 'info.nightscout.androidaps.database'
defaultConfig { defaultConfig {
kapt { kapt {
arguments { arguments {

View file

@ -1,2 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android" />
package="info.nightscout.androidaps.database" />

View file

@ -10,6 +10,8 @@ apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android { android {
namespace 'info.nightscout.androidaps.diaconn'
defaultConfig { defaultConfig {
kapt { kapt {
arguments { arguments {

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.diaconn">
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View file

@ -10,6 +10,8 @@ apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android { android {
namespace 'info.nightscout.androidaps.insight'
defaultConfig { defaultConfig {
kapt { kapt {
arguments { arguments {

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.insight">
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View file

@ -8,6 +8,9 @@ apply from: "${project.rootDir}/core/android_dependencies.gradle"
apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android {
namespace 'info.nightscout.androidaps.plugins.pump.medtronic'
}
dependencies { dependencies {
implementation project(':core') implementation project(':core')

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.plugins.pump.medtronic">
<application <application
android:supportsRtl="true"> android:supportsRtl="true">

View file

@ -9,6 +9,9 @@ apply from: "${project.rootDir}/core/android_dependencies.gradle"
apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android {
namespace 'info.nightscout.androidaps.plugins.pump.omnipod.common'
}
dependencies { dependencies {
implementation project(':core') implementation project(':core')

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest package="info.nightscout.androidaps.plugins.pump.omnipod.common" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android">
<application <application
android:supportsRtl="true"> android:supportsRtl="true">

View file

@ -17,6 +17,8 @@ detekt { // TODO move to `subprojects` section in global build.gradle
} }
android { android {
namespace 'info.nightscout.androidaps.plugins.pump.omnipod.dash'
defaultConfig { defaultConfig {
kapt { kapt {
arguments { arguments {

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.plugins.pump.omnipod.dash">
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View file

@ -10,6 +10,8 @@ apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android { android {
namespace 'info.nightscout.androidaps.plugins.pump.omnipod.eros'
defaultConfig { defaultConfig {
kapt { kapt {
arguments { arguments {

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.plugins.pump.omnipod.eros">
<application <application
android:supportsRtl="true"> android:supportsRtl="true">

View file

@ -8,6 +8,9 @@ apply from: "${project.rootDir}/core/android_dependencies.gradle"
apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android {
namespace 'info.nightscout.androidaps.plugin.general.openhumans'
}
dependencies { dependencies {

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.plugin.general.openhumans">
<application> <application>
<activity <activity

View file

@ -8,6 +8,9 @@ apply from: "${project.rootDir}/core/android_dependencies.gradle"
apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android {
namespace 'info.nightscout.androidaps.plugins.pump.common'
}
dependencies { dependencies {
implementation project(':core') implementation project(':core')

View file

@ -1,4 +1,4 @@
<manifest package="info.nightscout.androidaps.plugins.pump.common"> <manifest>
<application> <application>

View file

@ -8,6 +8,9 @@ apply from: "${project.rootDir}/core/android_dependencies.gradle"
apply from: "${project.rootDir}/core/android_module_dependencies.gradle" apply from: "${project.rootDir}/core/android_module_dependencies.gradle"
apply from: "${project.rootDir}/core/test_dependencies.gradle" apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android {
namespace 'info.nightscout.androidaps.plugins.pump.common.hw.rileylink'
}
dependencies { dependencies {
implementation project(':core') implementation project(':core')

View file

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.androidaps.plugins.pump.common.hw.rileylink">
<uses-permission android:name="android.permission.BLUETOOTH" /> <uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" /> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View file

@ -11,6 +11,8 @@ apply from: "${project.rootDir}/core/test_dependencies.gradle"
apply from: "${project.rootDir}/core/jacoco_global.gradle" apply from: "${project.rootDir}/core/jacoco_global.gradle"
android { android {
namespace 'info.nightscout.shared'
defaultConfig { defaultConfig {
minSdkVersion 23 // for wear minSdkVersion 23 // for wear
} }

View file

@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android">
package="info.nightscout.shared">
</manifest> </manifest>

View file

@ -76,6 +76,7 @@ android {
versionName version + "-nsclient" versionName version + "-nsclient"
} }
} }
namespace 'info.nightscout.androidaps'
} }
allprojects { allprojects {

View file

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools">
package="info.nightscout.androidaps">
<uses-feature android:name="android.hardware.type.watch" /> <uses-feature android:name="android.hardware.type.watch" />

View file

@ -200,6 +200,7 @@ class DataHandlerWear @Inject constructor(
.setContentIntent(cancelPendingIntent) .setContentIntent(cancelPendingIntent)
.setPriority(NotificationCompat.PRIORITY_MAX) .setPriority(NotificationCompat.PRIORITY_MAX)
.setVibrate(vibratePattern) .setVibrate(vibratePattern)
.setOnlyAlertOnce(true)
.addAction(R.drawable.ic_cancel, context.getString(R.string.cancel_bolus), cancelPendingIntent) .addAction(R.drawable.ic_cancel, context.getString(R.string.cancel_bolus), cancelPendingIntent)
val notificationManager = NotificationManagerCompat.from(context) val notificationManager = NotificationManagerCompat.from(context)
notificationManager.notify(DataLayerListenerServiceWear.BOLUS_PROGRESS_NOTIF_ID, notificationBuilder.build()) notificationManager.notify(DataLayerListenerServiceWear.BOLUS_PROGRESS_NOTIF_ID, notificationBuilder.build())
@ -214,18 +215,20 @@ class DataHandlerWear @Inject constructor(
longArrayOf(0, 50, 1000), longArrayOf(0, 50, 1000),
DataLayerListenerServiceWear.AAPS_NOTIFY_CHANNEL_ID_BOLUS_PROGRESS, DataLayerListenerServiceWear.AAPS_NOTIFY_CHANNEL_ID_BOLUS_PROGRESS,
context.getString(R.string.bolus_progress_channel_name), context.getString(R.string.bolus_progress_channel_name),
context.getString(R.string.bolus_progress_channel_description) context.getString(R.string.bolus_progress_channel_description),
NotificationManager.IMPORTANCE_HIGH
) )
createNotificationChannel( createNotificationChannel(
longArrayOf(0, 1, 1000), longArrayOf(0),
DataLayerListenerServiceWear.AAPS_NOTIFY_CHANNEL_ID_BOLUS_PROGRESS_SILENT, DataLayerListenerServiceWear.AAPS_NOTIFY_CHANNEL_ID_BOLUS_PROGRESS_SILENT,
context.getString(R.string.bolus_progress_silent_channel_name), context.getString(R.string.bolus_progress_silent_channel_name),
context.getString(R.string.bolus_progress_silent_channel_description) context.getString(R.string.bolus_progress_silent_channel_description),
NotificationManager.IMPORTANCE_LOW
) )
} }
@TargetApi(value = 26) private fun createNotificationChannel(vibratePattern: LongArray, channelID: String, name: CharSequence, description: String) { @TargetApi(value = 26) private fun createNotificationChannel(vibratePattern: LongArray, channelID: String, name: CharSequence, description: String, importance: Int) {
val channel = NotificationChannel(channelID, name, NotificationManager.IMPORTANCE_HIGH) val channel = NotificationChannel(channelID, name, importance)
channel.description = description channel.description = description
channel.enableVibration(true) channel.enableVibration(true)
channel.vibrationPattern = vibratePattern channel.vibrationPattern = vibratePattern

View file

@ -23,8 +23,8 @@ class FillMenuActivity : MenuListActivity() {
add(MenuItem(R.drawable.ic_canula, getString(R.string.action_free_amount))) add(MenuItem(R.drawable.ic_canula, getString(R.string.action_free_amount)))
} }
override fun doAction(action: String) { override fun doAction(position: String) {
when (action) { when (position) {
getString(R.string.action_preset_1) -> rxBus.send(EventWearToMobile(EventData.ActionFillPresetPreCheck(1))) getString(R.string.action_preset_1) -> rxBus.send(EventWearToMobile(EventData.ActionFillPresetPreCheck(1)))
getString(R.string.action_preset_2) -> rxBus.send(EventWearToMobile(EventData.ActionFillPresetPreCheck(2))) getString(R.string.action_preset_2) -> rxBus.send(EventWearToMobile(EventData.ActionFillPresetPreCheck(2)))
getString(R.string.action_preset_3) -> rxBus.send(EventWearToMobile(EventData.ActionFillPresetPreCheck(3))) getString(R.string.action_preset_3) -> rxBus.send(EventWearToMobile(EventData.ActionFillPresetPreCheck(3)))

View file

@ -40,8 +40,8 @@ class MainMenuActivity : MenuListActivity() {
} }
} }
override fun doAction(action: String) { override fun doAction(position: String) {
when (action) { when (position) {
getString(R.string.menu_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) }) getString(R.string.menu_settings) -> startActivity(Intent(this, WatchfaceConfigurationActivity::class.java).apply { addFlags(Intent.FLAG_ACTIVITY_NEW_TASK) })
getString(R.string.menu_resync) -> rxBus.send(EventWearToMobile(ActionResendData("Re-Sync"))) getString(R.string.menu_resync) -> rxBus.send(EventWearToMobile(ActionResendData("Re-Sync")))
getString(R.string.status_profile_switch) -> rxBus.send(EventWearToMobile(EventData.ActionProfileSwitchSendInitialData(System.currentTimeMillis()))) getString(R.string.status_profile_switch) -> rxBus.send(EventWearToMobile(EventData.ActionProfileSwitchSendInitialData(System.currentTimeMillis())))

View file

@ -22,8 +22,8 @@ class StatusMenuActivity : MenuListActivity() {
add(MenuItem(R.drawable.ic_tdd, getString(R.string.status_tdd))) add(MenuItem(R.drawable.ic_tdd, getString(R.string.status_tdd)))
} }
override fun doAction(action: String) { override fun doAction(position: String) {
when (action) { when (position) {
getString(R.string.status_pump) -> rxBus.send(EventWearToMobile(ActionPumpStatus(System.currentTimeMillis()))) getString(R.string.status_pump) -> rxBus.send(EventWearToMobile(ActionPumpStatus(System.currentTimeMillis())))
getString(R.string.status_loop) -> rxBus.send(EventWearToMobile(ActionLoopStatus(System.currentTimeMillis()))) getString(R.string.status_loop) -> rxBus.send(EventWearToMobile(ActionLoopStatus(System.currentTimeMillis())))
getString(R.string.status_tdd) -> rxBus.send(EventWearToMobile(ActionTddStatus(System.currentTimeMillis()))) getString(R.string.status_tdd) -> rxBus.send(EventWearToMobile(ActionTddStatus(System.currentTimeMillis())))