mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Fix MessageContentProcessor logging.
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
package org.thoughtcrime.securesms.database;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import net.sqlcipher.database.SQLiteDatabase;
|
||||
|
||||
import java.io.Closeable;
|
||||
|
||||
public final class DatabaseLock {
|
||||
|
||||
public static @NonNull Lock acquire(@NonNull Context context) {
|
||||
SQLiteDatabase db = DatabaseFactory.getInstance(context).getRawDatabase();
|
||||
|
||||
if (db.isDbLockedByCurrentThread()) {
|
||||
return () -> {};
|
||||
}
|
||||
|
||||
db.beginTransaction();
|
||||
|
||||
return () -> {
|
||||
db.setTransactionSuccessful();
|
||||
db.endTransaction();
|
||||
};
|
||||
}
|
||||
|
||||
public interface Lock extends Closeable {
|
||||
@Override
|
||||
void close();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user