Skip to content

Commit 448f071

Browse files
hai007copybara-github
authored andcommitted
using RoomDatabase
PiperOrigin-RevId: 870266031
1 parent 4a059b0 commit 448f071

File tree

1 file changed

+57
-1
lines changed

1 file changed

+57
-1
lines changed

sharing/proto/wire_format.proto

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ message Frame {
183183
optional V1Frame v1 = 2;
184184
}
185185

186-
// NEXT_ID=8
186+
// NEXT_ID=9
187187
message V1Frame {
188188
enum FrameType {
189189
UNKNOWN_FRAME_TYPE = 0;
@@ -196,6 +196,8 @@ message V1Frame {
196196
CANCEL = 6;
197197
// No longer used.
198198
PROGRESS_UPDATE = 7;
199+
// Photo Sync
200+
PHOTO_SYNC = 8;
199201
}
200202

201203
optional FrameType type = 1;
@@ -207,6 +209,7 @@ message V1Frame {
207209
optional PairedKeyResultFrame paired_key_result = 5;
208210
optional CertificateInfoFrame certificate_info = 6 [deprecated = true];
209211
optional ProgressUpdateFrame progress_update = 7 [deprecated = true];
212+
optional PhotoSyncFrame photo_sync = 8;
210213
}
211214

212215
// An introduction packet sent by the sending side. Contains a list of files
@@ -405,3 +408,56 @@ message StreamDetails {
405408
// Serialized ParcelFileDescriptor for input stream (for the receiver).
406409
optional bytes input_stream_parcel_file_descriptor_bytes = 1;
407410
}
411+
412+
// --- Photo Sync specific messages ---
413+
414+
// Represents a folder being backed up.
415+
// NEXT_ID=5
416+
message Folder {
417+
optional string id = 1;
418+
optional string label = 2;
419+
// The highest sequence number of the folder.
420+
optional int64 max_sequence = 3;
421+
// A random number used on both sides to ensure they are working on the same
422+
// index table.
423+
optional int64 index_id = 4;
424+
}
425+
426+
// Contains information about the folders being synced.
427+
// NEXT_ID=2
428+
message SyncConfig {
429+
repeated Folder folders = 1;
430+
}
431+
432+
// Represents metadata for a single file.
433+
// NEXT_ID=5
434+
message FileInfo {
435+
optional int64 sequence = 1;
436+
// The relative path of the file within the folder.
437+
optional string file_path = 2;
438+
// The SHA-256 hash of the file content.
439+
optional bytes file_hash = 3;
440+
// The last modified timestamp of the file in milliseconds since epoch.
441+
optional int64 last_modified = 4;
442+
}
443+
444+
// Describes a folder and its contents.
445+
// NEXT_ID=3
446+
message Index {
447+
optional string folder = 1;
448+
repeated FileInfo files = 2;
449+
}
450+
451+
message SyncRequest {
452+
optional int64 max_sequence = 1;
453+
}
454+
455+
// A frame for Photo Sync metadata exchange.
456+
// NEXT_ID=4
457+
message PhotoSyncFrame {
458+
oneof metadata {
459+
SyncRequest sync_request = 1;
460+
SyncConfig sync_config = 2;
461+
Index index = 3;
462+
}
463+
}

0 commit comments

Comments
 (0)