reduce warnings amount
This commit is contained in:
parent
71ada7203a
commit
62cb1bb506
2 changed files with 5 additions and 2 deletions
|
@ -134,7 +134,10 @@ class ConfigBuilderPlugin @Inject constructor(
|
||||||
|
|
||||||
// Ask when switching to physical pump plugin
|
// Ask when switching to physical pump plugin
|
||||||
fun switchAllowed(changedPlugin: PluginBase, newState: Boolean, activity: FragmentActivity?, type: PluginType) {
|
fun switchAllowed(changedPlugin: PluginBase, newState: Boolean, activity: FragmentActivity?, type: PluginType) {
|
||||||
if (changedPlugin.getType() == PluginType.PUMP && changedPlugin.name != resourceHelper.gs(R.string.virtualpump)) confirmPumpPluginActivation(changedPlugin, newState, activity, type) else performPluginSwitch(changedPlugin, newState, type)
|
if (changedPlugin.getType() == PluginType.PUMP && changedPlugin.name != resourceHelper.gs(R.string.virtualpump))
|
||||||
|
confirmPumpPluginActivation(changedPlugin, newState, activity, type)
|
||||||
|
else if (changedPlugin.getType() == PluginType.PUMP) pumpSync.connectNewPump()
|
||||||
|
else performPluginSwitch(changedPlugin, newState, type)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun confirmPumpPluginActivation(changedPlugin: PluginBase, newState: Boolean, activity: FragmentActivity?, type: PluginType) {
|
private fun confirmPumpPluginActivation(changedPlugin: PluginBase, newState: Boolean, activity: FragmentActivity?, type: PluginType) {
|
||||||
|
|
|
@ -68,7 +68,7 @@ class PumpSyncImplementation @Inject constructor(
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type.description != storedType || serialNumber != storedSerial)
|
if ((type.description != storedType || serialNumber != storedSerial) && timestamp >= storedTimestamp)
|
||||||
rxBus.send(EventNewNotification(Notification(Notification.WRONG_PUMP_DATA, resourceHelper.gs(R.string.wrong_pump_data), Notification.URGENT)))
|
rxBus.send(EventNewNotification(Notification(Notification.WRONG_PUMP_DATA, resourceHelper.gs(R.string.wrong_pump_data), Notification.URGENT)))
|
||||||
aapsLogger.error(LTag.PUMP, "Ignoring pump history record Allowed: ${dateUtil.dateAndTimeAndSecondsString(storedTimestamp)} $storedType $storedSerial Received: $timestamp ${dateUtil.dateAndTimeAndSecondsString(timestamp)} ${type.description} $serialNumber")
|
aapsLogger.error(LTag.PUMP, "Ignoring pump history record Allowed: ${dateUtil.dateAndTimeAndSecondsString(storedTimestamp)} $storedType $storedSerial Received: $timestamp ${dateUtil.dateAndTimeAndSecondsString(timestamp)} ${type.description} $serialNumber")
|
||||||
return false
|
return false
|
||||||
|
|
Loading…
Reference in a new issue