Wear: log API level
This commit is contained in:
parent
3d9b08e5c2
commit
4eb05b01a8
4 changed files with 20 additions and 16 deletions
|
@ -28,7 +28,6 @@ import info.nightscout.androidaps.plugins.iob.iobCobCalculator.GlucoseStatusProv
|
||||||
import info.nightscout.androidaps.queue.Callback
|
import info.nightscout.androidaps.queue.Callback
|
||||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||||
import info.nightscout.androidaps.utils.*
|
import info.nightscout.androidaps.utils.*
|
||||||
import info.nightscout.androidaps.interfaces.ResourceHelper
|
|
||||||
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
||||||
import info.nightscout.androidaps.utils.wizard.BolusWizard
|
import info.nightscout.androidaps.utils.wizard.BolusWizard
|
||||||
import info.nightscout.androidaps.utils.wizard.QuickWizard
|
import info.nightscout.androidaps.utils.wizard.QuickWizard
|
||||||
|
@ -46,7 +45,6 @@ import java.util.concurrent.TimeUnit
|
||||||
import java.util.stream.Collectors
|
import java.util.stream.Collectors
|
||||||
import javax.inject.Inject
|
import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
import kotlin.collections.ArrayList
|
|
||||||
import kotlin.math.abs
|
import kotlin.math.abs
|
||||||
import kotlin.math.min
|
import kotlin.math.min
|
||||||
|
|
||||||
|
@ -89,6 +87,7 @@ class DataHandlerMobile @Inject constructor(
|
||||||
.observeOn(aapsSchedulers.io)
|
.observeOn(aapsSchedulers.io)
|
||||||
.subscribe({
|
.subscribe({
|
||||||
aapsLogger.debug(LTag.WEAR, "Pong received from ${it.sourceNodeId}")
|
aapsLogger.debug(LTag.WEAR, "Pong received from ${it.sourceNodeId}")
|
||||||
|
fabricPrivacy.logCustom("WearOS_${it.apiLevel}")
|
||||||
}, fabricPrivacy::logException)
|
}, fabricPrivacy::logException)
|
||||||
disposable += rxBus
|
disposable += rxBus
|
||||||
.toObservable(EventData.CancelBolus::class.java)
|
.toObservable(EventData.CancelBolus::class.java)
|
||||||
|
|
|
@ -20,6 +20,7 @@ import info.nightscout.androidaps.plugins.general.wear.events.EventWearUpdateGui
|
||||||
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
import info.nightscout.androidaps.receivers.ReceiverStatusStore
|
||||||
import info.nightscout.androidaps.utils.DefaultValueHelper
|
import info.nightscout.androidaps.utils.DefaultValueHelper
|
||||||
import info.nightscout.androidaps.interfaces.ResourceHelper
|
import info.nightscout.androidaps.interfaces.ResourceHelper
|
||||||
|
import info.nightscout.androidaps.utils.FabricPrivacy
|
||||||
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
import info.nightscout.androidaps.utils.rx.AapsSchedulers
|
||||||
import info.nightscout.androidaps.utils.wizard.QuickWizard
|
import info.nightscout.androidaps.utils.wizard.QuickWizard
|
||||||
import info.nightscout.shared.logging.AAPSLogger
|
import info.nightscout.shared.logging.AAPSLogger
|
||||||
|
@ -35,6 +36,7 @@ import javax.inject.Inject
|
||||||
class DataLayerListenerServiceMobile : WearableListenerService() {
|
class DataLayerListenerServiceMobile : WearableListenerService() {
|
||||||
|
|
||||||
@Inject lateinit var aapsLogger: AAPSLogger
|
@Inject lateinit var aapsLogger: AAPSLogger
|
||||||
|
@Inject lateinit var fabricPrivacy: FabricPrivacy
|
||||||
@Inject lateinit var profileFunction: ProfileFunction
|
@Inject lateinit var profileFunction: ProfileFunction
|
||||||
@Inject lateinit var iobCobCalculator: IobCobCalculator
|
@Inject lateinit var iobCobCalculator: IobCobCalculator
|
||||||
@Inject lateinit var rh: ResourceHelper
|
@Inject lateinit var rh: ResourceHelper
|
||||||
|
@ -125,6 +127,7 @@ class DataLayerListenerServiceMobile : WearableListenerService() {
|
||||||
private var transcriptionNodeId: String? = null
|
private var transcriptionNodeId: String? = null
|
||||||
|
|
||||||
private fun updateTranscriptionCapability() {
|
private fun updateTranscriptionCapability() {
|
||||||
|
try {
|
||||||
val capabilityInfo: CapabilityInfo = Tasks.await(
|
val capabilityInfo: CapabilityInfo = Tasks.await(
|
||||||
capabilityClient.getCapability(WEAR_CAPABILITY, CapabilityClient.FILTER_REACHABLE)
|
capabilityClient.getCapability(WEAR_CAPABILITY, CapabilityClient.FILTER_REACHABLE)
|
||||||
)
|
)
|
||||||
|
@ -136,6 +139,9 @@ class DataLayerListenerServiceMobile : WearableListenerService() {
|
||||||
aapsLogger.debug(LTag.WEAR, "Selected node: ${bestNode?.displayName} $transcriptionNodeId")
|
aapsLogger.debug(LTag.WEAR, "Selected node: ${bestNode?.displayName} $transcriptionNodeId")
|
||||||
rxBus.send(EventMobileToWear(EventData.ActionPing(System.currentTimeMillis())))
|
rxBus.send(EventMobileToWear(EventData.ActionPing(System.currentTimeMillis())))
|
||||||
rxBus.send(EventData.ActionResendData("WatchUpdaterService"))
|
rxBus.send(EventData.ActionResendData("WatchUpdaterService"))
|
||||||
|
} catch (e: Exception) {
|
||||||
|
fabricPrivacy.logCustom("WearOS_unsupported")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find a nearby node or pick one arbitrarily
|
// Find a nearby node or pick one arbitrarily
|
||||||
|
|
|
@ -19,7 +19,7 @@ sealed class EventData : Event() {
|
||||||
|
|
||||||
// Mobile <- Wear
|
// Mobile <- Wear
|
||||||
@Serializable
|
@Serializable
|
||||||
data class ActionPong(val timeStamp: Long) : EventData()
|
data class ActionPong(val timeStamp: Long, val apiLevel: Int) : EventData()
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class Error(val timeStamp: Long) : EventData() // ignored
|
data class Error(val timeStamp: Long) : EventData() // ignored
|
||||||
|
|
|
@ -57,7 +57,7 @@ class DataHandlerWear @Inject constructor(
|
||||||
.observeOn(aapsSchedulers.io)
|
.observeOn(aapsSchedulers.io)
|
||||||
.subscribe {
|
.subscribe {
|
||||||
aapsLogger.debug(LTag.WEAR, "Ping received from ${it.sourceNodeId}")
|
aapsLogger.debug(LTag.WEAR, "Ping received from ${it.sourceNodeId}")
|
||||||
rxBus.send(EventWearToMobile(EventData.ActionPong(System.currentTimeMillis())))
|
rxBus.send(EventWearToMobile(EventData.ActionPong(System.currentTimeMillis(), Build.VERSION.SDK_INT)))
|
||||||
}
|
}
|
||||||
disposable += rxBus
|
disposable += rxBus
|
||||||
.toObservable(EventData.ConfirmAction::class.java)
|
.toObservable(EventData.ConfirmAction::class.java)
|
||||||
|
@ -115,7 +115,6 @@ class DataHandlerWear @Inject constructor(
|
||||||
.subscribe {
|
.subscribe {
|
||||||
aapsLogger.debug(LTag.WEAR, "Bolus progress received from ${it.sourceNodeId}")
|
aapsLogger.debug(LTag.WEAR, "Bolus progress received from ${it.sourceNodeId}")
|
||||||
handleBolusProgress(it)
|
handleBolusProgress(it)
|
||||||
rxBus.send(EventWearToMobile(EventData.ActionPong(System.currentTimeMillis())))
|
|
||||||
}
|
}
|
||||||
disposable += rxBus
|
disposable += rxBus
|
||||||
.toObservable(EventData.Status::class.java)
|
.toObservable(EventData.Status::class.java)
|
||||||
|
|
Loading…
Reference in a new issue