Introduce SignalDatabase as the main database entrypoint.

This commit is contained in:
Greyson Parrelli
2021-11-18 12:36:52 -05:00
committed by GitHub
parent e17c49505c
commit 843ed24bbb
371 changed files with 4198 additions and 4434 deletions

View File

@@ -7,7 +7,7 @@ import androidx.annotation.NonNull;
import org.signal.core.util.concurrent.SignalExecutors;
import org.thoughtcrime.securesms.database.AttachmentDatabase;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.SignalDatabase;
import org.thoughtcrime.securesms.database.StickerDatabase;
import org.thoughtcrime.securesms.database.StickerDatabase.StickerPackRecordReader;
import org.thoughtcrime.securesms.database.model.StickerPackRecord;
@@ -28,8 +28,8 @@ final class StickerManagementRepository {
StickerManagementRepository(@NonNull Context context) {
this.context = context.getApplicationContext();
this.stickerDatabase = DatabaseFactory.getStickerDatabase(context);
this.attachmentDatabase = DatabaseFactory.getAttachmentDatabase(context);
this.stickerDatabase = SignalDatabase.stickers();
this.attachmentDatabase = SignalDatabase.attachments();
}
void deleteOrphanedStickerPacks() {

View File

@@ -10,7 +10,7 @@ import com.annimon.stream.Stream;
import org.signal.core.util.concurrent.SignalExecutors;
import org.signal.core.util.logging.Log;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.SignalDatabase;
import org.thoughtcrime.securesms.database.StickerDatabase;
import org.thoughtcrime.securesms.database.model.StickerPackRecord;
import org.thoughtcrime.securesms.database.model.StickerRecord;
@@ -34,7 +34,7 @@ public final class StickerPackPreviewRepository {
public StickerPackPreviewRepository(@NonNull Context context) {
this.receiver = ApplicationDependencies.getSignalServiceMessageReceiver();
this.stickerDatabase = DatabaseFactory.getStickerDatabase(context);
this.stickerDatabase = SignalDatabase.stickers();
}
public void getStickerManifest(@NonNull String packId,

View File

@@ -8,7 +8,7 @@ import androidx.annotation.NonNull;
import org.signal.core.util.concurrent.SignalExecutors;
import org.thoughtcrime.securesms.components.emoji.EmojiUtil;
import org.thoughtcrime.securesms.database.AttachmentDatabase;
import org.thoughtcrime.securesms.database.DatabaseFactory;
import org.thoughtcrime.securesms.database.SignalDatabase;
import org.thoughtcrime.securesms.database.StickerDatabase;
import org.thoughtcrime.securesms.database.StickerDatabase.StickerRecordReader;
import org.thoughtcrime.securesms.database.model.StickerRecord;
@@ -23,8 +23,8 @@ public final class StickerSearchRepository {
private final AttachmentDatabase attachmentDatabase;
public StickerSearchRepository(@NonNull Context context) {
this.stickerDatabase = DatabaseFactory.getStickerDatabase(context);
this.attachmentDatabase = DatabaseFactory.getAttachmentDatabase(context);
this.stickerDatabase = SignalDatabase.stickers();
this.attachmentDatabase = SignalDatabase.attachments();
}
public void searchByEmoji(@NonNull String emoji, @NonNull Callback<List<StickerRecord>> callback) {