mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Be more careful with unknown IDs during storage sync.
This commit is contained in:
committed by
Cody Henthorne
parent
1c40f2d167
commit
1322f5bc08
@@ -15,6 +15,7 @@ import org.thoughtcrime.securesms.util.SqlUtil;
|
||||
import org.whispersystems.libsignal.util.guava.Preconditions;
|
||||
import org.whispersystems.signalservice.api.storage.SignalStorageRecord;
|
||||
import org.whispersystems.signalservice.api.storage.StorageId;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.ManifestRecord;
|
||||
import org.whispersystems.signalservice.internal.storage.protos.SignalStorage;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -46,10 +47,13 @@ public class UnknownStorageIdDatabase extends Database {
|
||||
super(context, databaseHelper);
|
||||
}
|
||||
|
||||
public List<StorageId> getAllIds() {
|
||||
List<StorageId> keys = new ArrayList<>();
|
||||
public List<StorageId> getAllUnknownIds() {
|
||||
List<StorageId> keys = new ArrayList<>();
|
||||
|
||||
try (Cursor cursor = databaseHelper.getReadableDatabase().query(TABLE_NAME, null, null, null, null, null, null)) {
|
||||
String query = TYPE + " > ?";
|
||||
String[] args = SqlUtil.buildArgs(StorageId.largestKnownType());
|
||||
|
||||
try (Cursor cursor = databaseHelper.getReadableDatabase().query(TABLE_NAME, null, query, args, null, null, null)) {
|
||||
while (cursor != null && cursor.moveToNext()) {
|
||||
String keyEncoded = cursor.getString(cursor.getColumnIndexOrThrow(STORAGE_ID));
|
||||
int type = cursor.getInt(cursor.getColumnIndexOrThrow(TYPE));
|
||||
|
||||
Reference in New Issue
Block a user