diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-12-08 15:43:21 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-12-08 15:43:21 +0100 |
commit | e0e158e5fc2d1d81a756ad15b978431c66bbfb22 (patch) | |
tree | c923db3d64fb582e3d35b8e4608d86f47f4bf413 /src/main/java/de/pixart/messenger/persistance | |
parent | 31c16b0f8fb54c26e45cdee9a4b47cfe4e5994fa (diff) |
increase cursor window size on Android P when restoring messages
Diffstat (limited to 'src/main/java/de/pixart/messenger/persistance')
-rw-r--r-- | src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java index 44e78015f..9f78b631c 100644 --- a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java @@ -51,6 +51,7 @@ import de.pixart.messenger.entities.Roster; import de.pixart.messenger.entities.ServiceDiscoveryResult; import de.pixart.messenger.services.ShortcutService; import de.pixart.messenger.utils.CryptoHelper; +import de.pixart.messenger.utils.CursorUtils; import de.pixart.messenger.utils.FtsUtils; import de.pixart.messenger.utils.Resolver; import de.pixart.messenger.xmpp.InvalidJid; @@ -793,12 +794,10 @@ public class DatabaseBackend extends SQLiteOpenHelper { null, null, Message.TIME_SENT + " DESC", String.valueOf(limit)); } + CursorUtils.upgradeCursorWindowSize(cursor); while (cursor.moveToNext()) { try { - final Message message = Message.fromCursor(cursor, conversation); - if (message != null && !message.isMessageDeleted()) { - list.add(0, message); - } + list.add(0, Message.fromCursor(cursor, conversation)); } catch (Exception e) { Log.e(Config.LOGTAG, "unable to restore message"); } |