Glunovo: catch SecurityException

This commit is contained in:
Milos Kozak 2022-08-01 16:40:52 +02:00
parent 1b3bb6ecdd
commit e920b6bc2d

View file

@ -89,6 +89,7 @@ class GlunovoPlugin @Inject constructor(
private fun handleNewData() { private fun handleNewData() {
if (!isEnabled()) return if (!isEnabled()) return
try {
context.contentResolver.query(contentUri, null, null, null, null)?.let { cr -> context.contentResolver.query(contentUri, null, null, null, null)?.let { cr ->
val glucoseValues = mutableListOf<CgmSourceTransaction.TransactionGlucoseValue>() val glucoseValues = mutableListOf<CgmSourceTransaction.TransactionGlucoseValue>()
val calibrations = mutableListOf<CgmSourceTransaction.Calibration>() val calibrations = mutableListOf<CgmSourceTransaction.Calibration>()
@ -164,6 +165,9 @@ class GlunovoPlugin @Inject constructor(
} }
} }
} }
} catch (e: SecurityException) {
aapsLogger.error(e.localizedMessage)
}
} }
override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean = override fun shouldUploadToNs(glucoseValue: GlucoseValue): Boolean =