RTP: write log message on background thread
This commit is contained in:
		
							parent
							
								
									b7f3b4333e
								
							
						
					
					
						commit
						0ba4892d3e
					
				@ -3303,6 +3303,10 @@ public class XmppConnectionService extends Service {
 | 
				
			|||||||
        updateConversationUi();
 | 
					        updateConversationUi();
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public void createMessageAsync(final Message message) {
 | 
				
			||||||
 | 
					        mDatabaseWriterExecutor.execute(()-> databaseBackend.createMessage(message));
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void updateMessage(Message message, String uuid) {
 | 
					    public void updateMessage(Message message, String uuid) {
 | 
				
			||||||
        if (!databaseBackend.updateMessage(message, uuid)) {
 | 
					        if (!databaseBackend.updateMessage(message, uuid)) {
 | 
				
			||||||
            Log.e(Config.LOGTAG, "error updated message in DB after edit");
 | 
					            Log.e(Config.LOGTAG, "error updated message in DB after edit");
 | 
				
			||||||
 | 
				
			|||||||
@ -1219,7 +1219,7 @@ public class JingleRtpConnection extends AbstractJingleConnection implements Web
 | 
				
			|||||||
        final Conversational conversational = message.getConversation();
 | 
					        final Conversational conversational = message.getConversation();
 | 
				
			||||||
        if (conversational instanceof Conversation) {
 | 
					        if (conversational instanceof Conversation) {
 | 
				
			||||||
            ((Conversation) conversational).add(this.message);
 | 
					            ((Conversation) conversational).add(this.message);
 | 
				
			||||||
            xmppConnectionService.databaseBackend.createMessage(message);
 | 
					            xmppConnectionService.createMessageAsync(message);
 | 
				
			||||||
            xmppConnectionService.updateConversationUi();
 | 
					            xmppConnectionService.updateConversationUi();
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
            throw new IllegalStateException("Somehow the conversation in a message was a stub");
 | 
					            throw new IllegalStateException("Somehow the conversation in a message was a stub");
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user