Fix deadlock between group calling jobs.

fork-5.53.8
Cody Henthorne 2020-12-03 12:50:56 -05:00 zatwierdzone przez Greyson Parrelli
rodzic 82eebbc3b0
commit ac41f3d662
1 zmienionych plików z 8 dodań i 5 usunięć

Wyświetl plik

@ -694,13 +694,16 @@ public class SmsDatabase extends MessageDatabase {
@NonNull Collection<UUID> peekJoinedUuids,
boolean isCallFull)
{
SQLiteDatabase db = databaseHelper.getWritableDatabase();
SQLiteDatabase db = databaseHelper.getWritableDatabase();
long threadId;
try {
db.beginTransaction();
Recipient recipient = Recipient.resolved(groupRecipientId);
long threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipient);
threadId = DatabaseFactory.getThreadDatabase(context).getThreadIdFor(recipient);
boolean peerEraIdSameAsPrevious = updatePreviousGroupCall(threadId, peekGroupCallEraId, peekJoinedUuids, isCallFull);
@ -736,13 +739,13 @@ public class SmsDatabase extends MessageDatabase {
DatabaseFactory.getThreadDatabase(context).update(threadId, true);
notifyConversationListeners(threadId);
ApplicationDependencies.getJobManager().add(new TrimThreadJob(threadId));
db.setTransactionSuccessful();
} finally {
db.endTransaction();
}
notifyConversationListeners(threadId);
ApplicationDependencies.getJobManager().add(new TrimThreadJob(threadId));
}
@Override