RTP: write log message on background thread

This commit is contained in:
Daniel Gultsch 2020-06-12 09:08:09 +02:00
parent b7f3b4333e
commit 0ba4892d3e
3 changed files with 5 additions and 1 deletions

View File

@ -3303,6 +3303,10 @@ public class XmppConnectionService extends Service {
updateConversationUi();
}
public void createMessageAsync(final Message message) {
mDatabaseWriterExecutor.execute(()-> databaseBackend.createMessage(message));
}
public void updateMessage(Message message, String uuid) {
if (!databaseBackend.updateMessage(message, uuid)) {
Log.e(Config.LOGTAG, "error updated message in DB after edit");

View File

@ -1219,7 +1219,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
final Conversational conversational = message.getConversation();
if (conversational instanceof Conversation) {
((Conversation) conversational).add(this.message);
xmppConnectionService.databaseBackend.createMessage(message);
xmppConnectionService.createMessageAsync(message);
xmppConnectionService.updateConversationUi();
} else {
throw new IllegalStateException("Somehow the conversation in a message was a stub");