Merge pull request #1015 from avereha/avereha/save-ltk
dash bugfix: save the LTK
This commit is contained in:
commit
8783e67a9c
2 changed files with 4 additions and 3 deletions
|
@ -678,8 +678,9 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
|||
private fun store() {
|
||||
try {
|
||||
val cleanPodState = podState.copy(ltk = byteArrayOf()) // do not log ltk
|
||||
val serialized = Gson().toJson(cleanPodState)
|
||||
logger.debug(LTag.PUMP, "Storing Pod state: $serialized")
|
||||
logger.debug(LTag.PUMP, "Storing Pod state: ${Gson().toJson(cleanPodState)}")
|
||||
|
||||
val serialized = Gson().toJson(podState)
|
||||
sharedPreferences.putString(R.string.key_omnipod_dash_pod_state, serialized)
|
||||
} catch (ex: Exception) {
|
||||
logger.error(LTag.PUMP, "Failed to store Pod state", ex)
|
||||
|
|
|
@ -127,7 +127,7 @@ class DashPodManagementActivity : NoSplashAppCompatActivity() {
|
|||
binding.buttonDiscardPod.visibility = discardButtonEnabled.toVisibility()
|
||||
|
||||
binding.buttonActivatePod.isEnabled = podStateManager.activationProgress.isBefore(ActivationProgress.COMPLETED)
|
||||
binding.buttonDeactivatePod.isEnabled = podStateManager.bluetoothAddress != null
|
||||
binding.buttonDeactivatePod.isEnabled = podStateManager.bluetoothAddress != null || podStateManager.ltk != null
|
||||
|
||||
if (podStateManager.activationProgress.isAtLeast(ActivationProgress.PHASE_1_COMPLETED)) {
|
||||
if (commandQueue.isCustomCommandInQueue(CommandPlayTestBeep::class.java)) {
|
||||
|
|
Loading…
Reference in a new issue