Convert StorageService protos to wire.

This commit is contained in:
Cody Henthorne
2023-08-28 22:47:02 -04:00
committed by Greyson Parrelli
parent 9a7d8c858d
commit 6a21106347
28 changed files with 620 additions and 882 deletions

View File

@@ -17,6 +17,8 @@ import org.whispersystems.signalservice.api.storage.SignalAccountRecord;
import org.whispersystems.signalservice.api.storage.StorageId;
import org.whispersystems.signalservice.internal.storage.protos.AccountRecord;
import java.io.IOException;
/**
* Check for unknown fields stored on self and attempt to apply them.
*/
@@ -69,12 +71,12 @@ public class ApplyUnknownFieldsToSelfMigrationJob extends MigrationJob {
try {
StorageId storageId = StorageId.forAccount(self.getStorageServiceId());
AccountRecord accountRecord = AccountRecord.parseFrom(settings.getSyncExtras().getStorageProto());
AccountRecord accountRecord = AccountRecord.ADAPTER.decode(settings.getSyncExtras().getStorageProto());
SignalAccountRecord signalAccountRecord = new SignalAccountRecord(storageId, accountRecord);
Log.d(TAG, "Applying potentially now known unknowns");
StorageSyncHelper.applyAccountStorageSyncUpdates(context, self, signalAccountRecord, false);
} catch (InvalidProtocolBufferException e) {
} catch (IOException e) {
Log.w(TAG, e);
}
}