aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-05-09 21:18:28 +0200
committerChristian Schneppe <christian@pix-art.de>2017-05-09 21:18:28 +0200
commit5fa3c312a592f58af9eba21e259ce5a402d86774 (patch)
tree67ae43cec1c4b72e98dbb3d598542612840577ca /src/main/java/de/pixart/messenger/services/XmppConnectionService.java
parente803f3ffa5ab1d451a30164f23c1d2cc3cb147b0 (diff)
don't load signed prekeys on startup
Diffstat (limited to 'src/main/java/de/pixart/messenger/services/XmppConnectionService.java')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java14
1 files changed, 11 insertions, 3 deletions
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<Conversation> 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();
}
};