mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 00:59:49 +01:00
Convert StorageService protos to wire.
This commit is contained in:
committed by
Greyson Parrelli
parent
9a7d8c858d
commit
6a21106347
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user