From 5fa3c312a592f58af9eba21e259ce5a402d86774 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Tue, 9 May 2017 21:18:28 +0200 Subject: don't load signed prekeys on startup --- .../pixart/messenger/services/XmppConnectionService.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/pixart/messenger/services/XmppConnectionService.java') diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java index 8ad433b0f..a09bc5761 100644 --- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java +++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java @@ -1093,7 +1093,9 @@ public class XmppConnectionService extends Service { } }; + Log.d(Config.LOGTAG, "initializing database..."); this.databaseBackend = DatabaseBackend.getInstance(getApplicationContext()); + Log.d(Config.LOGTAG, "restoring accounts..."); this.accounts = databaseBackend.getAccounts(); if (databaseBackend.startTimeCountExceedsThreshold()) { @@ -1559,6 +1561,8 @@ public class XmppConnectionService extends Service { for (Account account : this.accounts) { accountLookupTable.put(account.getUuid(), account); } + Log.d(Config.LOGTAG, "restoring conversations..."); + final long startTimeConversationsRestore = SystemClock.elapsedRealtime(); this.conversations.addAll(databaseBackend.getConversations(Conversation.STATUS_AVAILABLE)); for (Iterator iterator = conversations.listIterator(); iterator.hasNext(); ) { Conversation conversation = iterator.next(); @@ -1570,6 +1574,8 @@ public class XmppConnectionService extends Service { iterator.remove(); } } + long diffConversationsRestore = SystemClock.elapsedRealtime() - startTimeConversationsRestore; + Log.d(Config.LOGTAG, "finished restoring conversations in " + diffConversationsRestore + "ms"); Runnable runnable = new Runnable() { @Override public void run() { @@ -1579,14 +1585,15 @@ public class XmppConnectionService extends Service { Log.d(Config.LOGTAG, "deleting messages that are older than " + AbstractGenerator.getTimestamp(deletionDate)); databaseBackend.expireOldMessages(deletionDate); } - Log.d(Config.LOGTAG, "restoring roster"); + Log.d(Config.LOGTAG, "restoring roster..."); for (Account account : accounts) { databaseBackend.readRoster(account.getRoster()); account.initAccountServices(XmppConnectionService.this); //roster needs to be loaded at this stage } getBitmapCache().evictAll(); loadPhoneContacts(); - Log.d(Config.LOGTAG, "restoring messages"); + Log.d(Config.LOGTAG, "restoring messages..."); + final long startMessageRestore = SystemClock.elapsedRealtime(); for (Conversation conversation : conversations) { conversation.addAll(0, databaseBackend.getMessages(conversation, Config.PAGE_SIZE)); checkDeletedFiles(conversation); @@ -1606,7 +1613,8 @@ public class XmppConnectionService extends Service { } mNotificationService.finishBacklog(false); mRestoredFromDatabase = true; - Log.d(Config.LOGTAG, "restored all messages"); + final long diffMessageRestore = SystemClock.elapsedRealtime() - startMessageRestore; + Log.d(Config.LOGTAG, "finished restoring messages in " + diffMessageRestore + "ms"); updateConversationUi(); } }; -- cgit v1.2.3