stop using DefaultRandom: it does not have enough entropy
This commit is contained in:
parent
58a40778d9
commit
2c94ff01c5
2 changed files with 4 additions and 5 deletions
|
@ -66,7 +66,6 @@ import javax.inject.Inject
|
||||||
import javax.inject.Singleton
|
import javax.inject.Singleton
|
||||||
import kotlin.concurrent.thread
|
import kotlin.concurrent.thread
|
||||||
import kotlin.math.ceil
|
import kotlin.math.ceil
|
||||||
import kotlin.random.Random
|
|
||||||
|
|
||||||
@Singleton
|
@Singleton
|
||||||
class OmnipodDashPumpPlugin @Inject constructor(
|
class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
|
@ -142,7 +141,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
duration = T.mins(PodConstants.MAX_POD_LIFETIME.toMinutes()).msecs(),
|
duration = T.mins(PodConstants.MAX_POD_LIFETIME.toMinutes()).msecs(),
|
||||||
isAbsolute = true,
|
isAbsolute = true,
|
||||||
type = PumpSync.TemporaryBasalType.PUMP_SUSPEND,
|
type = PumpSync.TemporaryBasalType.PUMP_SUSPEND,
|
||||||
pumpId = Random.Default.nextLong(), // we don't use this, just make sure it's unique
|
pumpId = System.currentTimeMillis(), // we don't use this, just make sure it's unique
|
||||||
pumpType = PumpType.OMNIPOD_DASH,
|
pumpType = PumpType.OMNIPOD_DASH,
|
||||||
pumpSerial = Constants.PUMP_SERIAL_FOR_FAKE_TBR // switching the serialNumber here would need a
|
pumpSerial = Constants.PUMP_SERIAL_FOR_FAKE_TBR // switching the serialNumber here would need a
|
||||||
// call to connectNewPump. If we do that, then we will have a TBR started by the "n/a" pump and
|
// call to connectNewPump. If we do that, then we will have a TBR started by the "n/a" pump and
|
||||||
|
@ -323,7 +322,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
duration = T.mins(PodConstants.MAX_POD_LIFETIME.toMinutes()).msecs(),
|
duration = T.mins(PodConstants.MAX_POD_LIFETIME.toMinutes()).msecs(),
|
||||||
isAbsolute = true,
|
isAbsolute = true,
|
||||||
type = PumpSync.TemporaryBasalType.PUMP_SUSPEND,
|
type = PumpSync.TemporaryBasalType.PUMP_SUSPEND,
|
||||||
pumpId = Random.Default.nextLong(), // we don't use this, just make sure it's unique
|
pumpId = System.currentTimeMillis(), // we don't use this, just make sure it's unique
|
||||||
pumpType = PumpType.OMNIPOD_DASH,
|
pumpType = PumpType.OMNIPOD_DASH,
|
||||||
pumpSerial = serialNumber()
|
pumpSerial = serialNumber()
|
||||||
)
|
)
|
||||||
|
@ -356,7 +355,7 @@ class OmnipodDashPumpPlugin @Inject constructor(
|
||||||
}
|
}
|
||||||
pumpSync.insertAnnouncement(
|
pumpSync.insertAnnouncement(
|
||||||
error = it.toString(),
|
error = it.toString(),
|
||||||
pumpId = Random.Default.nextLong(),
|
pumpId = System.currentTimeMillis(),
|
||||||
pumpType = PumpType.OMNIPOD_DASH,
|
pumpType = PumpType.OMNIPOD_DASH,
|
||||||
pumpSerial = serialNumber()
|
pumpSerial = serialNumber()
|
||||||
)
|
)
|
||||||
|
|
|
@ -15,7 +15,7 @@ abstract class HistoryRecordDao {
|
||||||
|
|
||||||
@Query("SELECT * from historyrecords")
|
@Query("SELECT * from historyrecords")
|
||||||
abstract fun all(): Single<List<HistoryRecordEntity>>
|
abstract fun all(): Single<List<HistoryRecordEntity>>
|
||||||
|
|
||||||
@Query("SELECT * from historyrecords ORDER BY id LIMIT 1")
|
@Query("SELECT * from historyrecords ORDER BY id LIMIT 1")
|
||||||
abstract fun first(): HistoryRecordEntity?
|
abstract fun first(): HistoryRecordEntity?
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue