Skip to content

[SMS App] Prevent assert in PduPersistor.load

Summary

Work around assert in Klinker's PduPersistor.load(..) by reading from the PduCache directly.

This probably improves performance, but more importantly it prevents PduPersistor.load(..) from trying to write to a value which is already written (causing it to assert).

Probably the root-cause bug is somewhere in Android or Sqlite, since I do not think that the type of message which is causing the assert is valid (and thus indicates that it should not be in this state) but we can't have our code crashing regardless of the cause.

(The message of interest was sent using Google Messages directly on the handset, so it is not an issue in KDE Connect SMS)

See bug 434348 for specific crash details.

BUG: 434348

Test Plan

Before:

Loading a PDU with type == PduHeaders.MESSAGE_TYPE_SEND_REQ will cause KDE Connect to assert and crash.

After:

Loading such a PDU will not cause KDE Connect to crash.

Edited by Simon Redman

Merge request reports