mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 17:29:32 +01:00
Introduce SignalDatabase as the main database entrypoint.
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user