diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/MessagePiece.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/MessagePiece.java new file mode 100644 index 00000000..11fb291e --- /dev/null +++ b/play-services-core/src/main/protos-java/org/microg/gms/wearable/MessagePiece.java @@ -0,0 +1,126 @@ +// Code generated by Wire protocol buffer compiler, do not edit. +// Source file: protos-repo/wearable.proto +package org.microg.gms.wearable; + +import com.squareup.wire.Message; +import com.squareup.wire.ProtoField; +import okio.ByteString; + +import static com.squareup.wire.Message.Datatype.BYTES; +import static com.squareup.wire.Message.Datatype.INT32; +import static com.squareup.wire.Message.Datatype.STRING; + +public final class MessagePiece extends Message { + + public static final ByteString DEFAULT_DATA = ByteString.EMPTY; + public static final String DEFAULT_DIGEST = ""; + public static final Integer DEFAULT_THISPIECE = 0; + public static final Integer DEFAULT_TOTALPIECES = 0; + public static final Integer DEFAULT_QUEUEID = 0; + + @ProtoField(tag = 1, type = BYTES) + public final ByteString data; + + @ProtoField(tag = 2, type = STRING) + public final String digest; + + @ProtoField(tag = 3, type = INT32) + public final Integer thisPiece; + + @ProtoField(tag = 4, type = INT32) + public final Integer totalPieces; + + @ProtoField(tag = 5, type = INT32) + public final Integer queueId; + + public MessagePiece(ByteString data, String digest, Integer thisPiece, Integer totalPieces, Integer queueId) { + this.data = data; + this.digest = digest; + this.thisPiece = thisPiece; + this.totalPieces = totalPieces; + this.queueId = queueId; + } + + private MessagePiece(Builder builder) { + this(builder.data, builder.digest, builder.thisPiece, builder.totalPieces, builder.queueId); + setBuilder(builder); + } + + @Override + public boolean equals(Object other) { + if (other == this) return true; + if (!(other instanceof MessagePiece)) return false; + MessagePiece o = (MessagePiece) other; + return equals(data, o.data) + && equals(digest, o.digest) + && equals(thisPiece, o.thisPiece) + && equals(totalPieces, o.totalPieces) + && equals(queueId, o.queueId); + } + + @Override + public int hashCode() { + int result = hashCode; + if (result == 0) { + result = data != null ? data.hashCode() : 0; + result = result * 37 + (digest != null ? digest.hashCode() : 0); + result = result * 37 + (thisPiece != null ? thisPiece.hashCode() : 0); + result = result * 37 + (totalPieces != null ? totalPieces.hashCode() : 0); + result = result * 37 + (queueId != null ? queueId.hashCode() : 0); + hashCode = result; + } + return result; + } + + public static final class Builder extends Message.Builder { + + public ByteString data; + public String digest; + public Integer thisPiece; + public Integer totalPieces; + public Integer queueId; + + public Builder() { + } + + public Builder(MessagePiece message) { + super(message); + if (message == null) return; + this.data = message.data; + this.digest = message.digest; + this.thisPiece = message.thisPiece; + this.totalPieces = message.totalPieces; + this.queueId = message.queueId; + } + + public Builder data(ByteString data) { + this.data = data; + return this; + } + + public Builder digest(String digest) { + this.digest = digest; + return this; + } + + public Builder thisPiece(Integer thisPiece) { + this.thisPiece = thisPiece; + return this; + } + + public Builder totalPieces(Integer totalPieces) { + this.totalPieces = totalPieces; + return this; + } + + public Builder queueId(Integer queueId) { + this.queueId = queueId; + return this; + } + + @Override + public MessagePiece build() { + return new MessagePiece(this); + } + } +} diff --git a/play-services-core/src/main/protos-repo/wearable.proto b/play-services-core/src/main/protos-repo/wearable.proto index a0a12395..a8aeeccf 100644 --- a/play-services-core/src/main/protos-repo/wearable.proto +++ b/play-services-core/src/main/protos-repo/wearable.proto @@ -34,17 +34,17 @@ message ChannelControlRequest { optional int32 closeErrorCode = 7; } +message ChannelDataAckRequest { + optional ChannelDataHeader header = 1; + optional bool finalMessage = 2; +} + message ChannelDataHeader { optional int64 channelId = 1; optional bool fromChannelOperator = 2; optional int64 unknown3 = 3; } -message ChannelDataAckRequest { - optional ChannelDataHeader header = 1; - optional bool finalMessage = 2; -} - message ChannelDataRequest { optional ChannelDataHeader header = 1; optional bytes payload = 2; @@ -86,6 +86,14 @@ message Heartbeat { } +message MessagePiece { + optional bytes data = 1; + optional string digest = 2; + optional int32 thisPiece = 3; + optional int32 totalPieces = 4; + optional int32 queueId = 5; +} + message Request { optional int32 requestId = 1; optional string packageName = 2;