diff --git a/.gitmodules b/.gitmodules index b26d31a0..36e22e46 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "extern/GmsApi"] path = extern/GmsApi url = https://github.com/microg/android_external_GmsApi.git +[submodule "extern/Wearable"] + path = extern/Wearable + url = https://github.com/microg/android_external_Wearable.git diff --git a/extern/GmsApi b/extern/GmsApi index 4f6a84de..f0ec7e60 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit 4f6a84de9d95fef255579c5ce06a89363dc05aa8 +Subproject commit f0ec7e606f3e6e3a219eb87266c4dae1828b5083 diff --git a/extern/Wearable b/extern/Wearable new file mode 160000 index 00000000..e6d59dc0 --- /dev/null +++ b/extern/Wearable @@ -0,0 +1 @@ +Subproject commit e6d59dc062def314cdebf64699b15bb8b6a5eede diff --git a/play-services-core/build.gradle b/play-services-core/build.gradle index 823a1d96..a0679d9f 100644 --- a/play-services-core/build.gradle +++ b/play-services-core/build.gradle @@ -39,6 +39,7 @@ dependencies { compile 'com.squareup.wire:wire-runtime:1.6.1' compile project(':play-services-api') compile project(':unifiednlp-base') + compile project(':wearable-lib') // vtm from ./libs compile 'org.oscim:vtm-android:0.6.0-SNAPSHOT@aar' compile 'org.oscim:vtm-themes:0.6.0-SNAPSHOT' diff --git a/play-services-core/src/main/java/org/microg/gms/maps/camera/CameraUpdateFactoryImpl.java b/play-services-core/src/main/java/org/microg/gms/maps/camera/CameraUpdateFactoryImpl.java index 238b7dd3..f64aa601 100644 --- a/play-services-core/src/main/java/org/microg/gms/maps/camera/CameraUpdateFactoryImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/maps/camera/CameraUpdateFactoryImpl.java @@ -18,12 +18,14 @@ package org.microg.gms.maps.camera; import android.os.RemoteException; import android.util.Log; + import com.google.android.gms.dynamic.IObjectWrapper; import com.google.android.gms.dynamic.ObjectWrapper; import com.google.android.gms.maps.internal.ICameraUpdateFactoryDelegate; import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.model.LatLng; import com.google.android.gms.maps.model.LatLngBounds; + import org.microg.gms.maps.GmsMapsTypeHelper; import org.oscim.core.MapPosition; import org.oscim.map.Map; @@ -159,7 +161,7 @@ public class CameraUpdateFactoryImpl extends ICameraUpdateFactoryDelegate.Stub { } @Override - public IObjectWrapper newLatLngBounds(final LatLngBounds bounds, int i) throws RemoteException { + public IObjectWrapper newLatLngBounds(final LatLngBounds bounds, int padding) throws RemoteException { Log.d(TAG, "newLatLngBounds"); return new ObjectWrapper(new MapPositionCameraUpdate() { @Override @@ -173,9 +175,17 @@ public class CameraUpdateFactoryImpl extends ICameraUpdateFactoryDelegate.Stub { } @Override - public IObjectWrapper newLatLngBoundsWithSize(LatLngBounds bounds, int i1, int i2, int i3) + public IObjectWrapper newLatLngBoundsWithSize(final LatLngBounds bounds, final int width, final int height, int padding) throws RemoteException { Log.d(TAG, "newLatLngBoundsWithSize"); - return new ObjectWrapper(new NoCameraUpdate()); + return new ObjectWrapper(new MapPositionCameraUpdate() { + @Override + MapPosition getMapPosition(Map map) { + MapPosition mapPosition = map.getMapPosition(); + mapPosition.setByBoundingBox(GmsMapsTypeHelper.fromLatLngBounds(bounds), + width, height); + return mapPosition; + } + }); } } diff --git a/play-services-core/src/main/java/org/microg/gms/wearable/DataItemInternal.java b/play-services-core/src/main/java/org/microg/gms/wearable/DataItemInternal.java index 9a657dd9..f9f5d333 100644 --- a/play-services-core/src/main/java/org/microg/gms/wearable/DataItemInternal.java +++ b/play-services-core/src/main/java/org/microg/gms/wearable/DataItemInternal.java @@ -37,6 +37,12 @@ public class DataItemInternal { this.uri = new Uri.Builder().scheme("wear").authority(host).path(path).build(); } + public DataItemInternal(Uri uri) { + this.uri = uri; + this.host = uri.getAuthority(); + this.path = uri.getPath(); + } + public DataItemInternal addAsset(String key, Asset asset) { this.assets.put(key, asset); return this; diff --git a/play-services-core/src/main/java/org/microg/gms/wearable/DataItemRecord.java b/play-services-core/src/main/java/org/microg/gms/wearable/DataItemRecord.java index e86b4de4..7e8e98d1 100644 --- a/play-services-core/src/main/java/org/microg/gms/wearable/DataItemRecord.java +++ b/play-services-core/src/main/java/org/microg/gms/wearable/DataItemRecord.java @@ -18,11 +18,15 @@ package org.microg.gms.wearable; import android.content.ContentValues; import android.database.Cursor; +import android.net.Uri; import com.google.android.gms.wearable.Asset; import com.google.android.gms.wearable.internal.DataItemAssetParcelable; import com.google.android.gms.wearable.internal.DataItemParcelable; +import org.microg.wearable.proto.AssetEntry; +import org.microg.wearable.proto.SetDataItem; + import java.util.Map; public class DataItemRecord { @@ -76,4 +80,23 @@ public class DataItemRecord { record.assetsAreReady = cursor.getLong(10) > 0; return record; } + + public static DataItemRecord fromSetDataItem(SetDataItem setDataItem) { + DataItemRecord record = new DataItemRecord(); + record.dataItem = new DataItemInternal(Uri.parse(setDataItem.uri)); + if (setDataItem.data != null) record.dataItem.data = setDataItem.data.toByteArray(); + if (setDataItem.assets != null) { + for (AssetEntry asset : setDataItem.assets) { + // TODO record.dataItem.addAsset(asset.key, asset.value) + } + } + record.source = setDataItem.source; + record.seqId = setDataItem.seqId; + record.v1SeqId = -1; + record.lastModified = setDataItem.lastModified; + record.deleted = setDataItem.deleted == null ? false : setDataItem.deleted; + record.packageName = setDataItem.packageName; + record.signatureDigest = setDataItem.signatureDigest; + return record; + } } diff --git a/play-services-core/src/main/java/org/microg/gms/wearable/MessageHandler.java b/play-services-core/src/main/java/org/microg/gms/wearable/MessageHandler.java new file mode 100644 index 00000000..c21dd9de --- /dev/null +++ b/play-services-core/src/main/java/org/microg/gms/wearable/MessageHandler.java @@ -0,0 +1,153 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.microg.gms.wearable; + +import android.text.TextUtils; +import android.util.Log; + +import com.google.android.gms.wearable.ConnectionConfiguration; +import com.google.android.gms.wearable.internal.MessageEventParcelable; +import com.google.android.gms.wearable.internal.NodeParcelable; + +import org.microg.gms.checkin.LastCheckinInfo; +import org.microg.gms.common.Build; +import org.microg.wearable.ServerMessageListener; +import org.microg.wearable.proto.AckAsset; +import org.microg.wearable.proto.Connect; +import org.microg.wearable.proto.FetchAsset; +import org.microg.wearable.proto.FilePiece; +import org.microg.wearable.proto.Heartbeat; +import org.microg.wearable.proto.Request; +import org.microg.wearable.proto.RootMessage; +import org.microg.wearable.proto.SetAsset; +import org.microg.wearable.proto.SetDataItem; +import org.microg.wearable.proto.SyncStart; +import org.microg.wearable.proto.SyncTableEntry; + +import java.io.IOException; +import java.util.Arrays; + +public class MessageHandler extends ServerMessageListener { + private static final String TAG = "GmsWearMsgHandler"; + private final WearableServiceImpl service; + private final ConnectionConfiguration config; + + public MessageHandler(WearableServiceImpl service, ConnectionConfiguration config) { + this(service, config, new Build().model, config.nodeId, LastCheckinInfo.read(service.getContext()).androidId); + } + + private MessageHandler(WearableServiceImpl service, ConnectionConfiguration config, String name, String networkId, long androidId) { + super(new Connect.Builder() + .name(name) + .id(config.nodeId) + .networkId(networkId) + .peerAndroidId(androidId) + .unknown4(3) + .unknown5(1) + .build()); + this.service = service; + this.config = config; + } + + @Override + public void onConnect(Connect connect) { + super.onConnect(connect); + config.peerNodeId = connect.id; + config.connected = true; + service.onPeerConnected(new NodeParcelable(connect.id, connect.name)); + try { + getConnection().writeMessage(new RootMessage.Builder().syncStart(new SyncStart.Builder() + .receivedSeqId(-1L) + .version(2) + .syncTable(Arrays.asList( + new SyncTableEntry.Builder().key("cloud").value(1L).build(), + new SyncTableEntry.Builder().key(config.nodeId).value(service.getCurrentSeqId(config.nodeId)).build(), // TODO + new SyncTableEntry.Builder().key(config.peerNodeId).value(service.getCurrentSeqId(config.peerNodeId)).build() // TODO + )).build()).build()); + } catch (IOException e) { + Log.w(TAG, e); + } + } + + @Override + public void onSetAsset(SetAsset setAsset) { + Log.d(TAG, "onSetAsset: " + setAsset); + } + + @Override + public void onAckAsset(AckAsset ackAsset) { + Log.d(TAG, "onAckAsset: " + ackAsset); + } + + @Override + public void onFetchAsset(FetchAsset fetchAsset) { + Log.d(TAG, "onFetchAsset: " + fetchAsset); + } + + @Override + public void onSyncStart(SyncStart syncStart) { + Log.d(TAG, "onSyncStart: " + syncStart); + if (syncStart.version < 2) { + Log.d(TAG, "Sync uses version " + syncStart.version + " which is not supported (yet)"); + } + if (syncStart.syncTable != null) { + for (SyncTableEntry entry : syncStart.syncTable) { + service.syncToPeer(getConnection(), entry.key, entry.value); + } + } + } + + @Override + public void onSetDataItem(SetDataItem setDataItem) { + Log.d(TAG, "onSetDataItem: " + setDataItem); + service.putDataItem(DataItemRecord.fromSetDataItem(setDataItem)); + } + + @Override + public void onRcpRequest(Request rcpRequest) { + Log.d(TAG, "onRcpRequest: " + rcpRequest); + if (TextUtils.isEmpty(rcpRequest.targetNodeId)) { + // TODO: That's probably not how it should go! + MessageEventParcelable messageEvent = new MessageEventParcelable(); + messageEvent.data = rcpRequest.rawData != null ? rcpRequest.rawData.toByteArray() : null; + messageEvent.path = rcpRequest.path; + messageEvent.requestId = rcpRequest.requestId + 31 * (rcpRequest.generation + 527); + messageEvent.sourceNodeId = TextUtils.isEmpty(rcpRequest.sourceNodeId) ? config.peerNodeId : rcpRequest.sourceNodeId; + + service.onMessageReceived(messageEvent); + } else if (rcpRequest.targetNodeId.equals(config.peerNodeId)) { + // Drop it, loop detection (yes we really need this in this protocol o.O) + } else { + // TODO: find next hop (yes, wtf hops in a network usually consisting of two devices) + } + } + + @Override + public void onHearbeat(Heartbeat heartbeat) { + Log.d(TAG, "onHearbeat: " + heartbeat); + } + + @Override + public void onFilePiece(FilePiece filePiece) { + Log.d(TAG, "onFilePiece: " + filePiece); + } + + @Override + public void onChannelRequest(Request channelRequest) { + Log.d(TAG, "onChannelRequest:" + channelRequest); + } +} diff --git a/play-services-core/src/main/java/org/microg/gms/wearable/NetworkConnectionThread.java b/play-services-core/src/main/java/org/microg/gms/wearable/NetworkConnectionThread.java new file mode 100644 index 00000000..ab682f17 --- /dev/null +++ b/play-services-core/src/main/java/org/microg/gms/wearable/NetworkConnectionThread.java @@ -0,0 +1,62 @@ +/* + * Copyright 2013-2015 microG Project Team + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.microg.gms.wearable; + +import android.util.Log; + +import com.google.android.gms.wearable.ConnectionConfiguration; + +import org.microg.wearable.SocketWearableConnection; + +import java.io.IOException; +import java.net.ServerSocket; +import java.net.Socket; + +class NetworkConnectionThread extends Thread { + private static final String TAG = "GmsWearNetConnThr"; + private static final int WEAR_TCP_PORT = 5601; + + private ConnectionConfiguration config; + private ServerSocket socket; + private MessageHandler handler; + + public NetworkConnectionThread(WearableServiceImpl service, ConnectionConfiguration config) { + this.config = config; + this.handler = new MessageHandler(service, config); + } + + public void close() { + try { + socket.close(); + } catch (IOException e) { + Log.w(TAG, e); + } + } + + @Override + public void run() { + try { + socket = new ServerSocket(WEAR_TCP_PORT); + Log.d(TAG, "Listening for connections on TCP :" + WEAR_TCP_PORT); + Socket accepted = socket.accept(); + new SocketWearableConnection(accepted, handler).run(); + Log.d(TAG, "Connection terminated, me too"); + } catch (IOException e) { + Log.w(TAG, e); + } + } +} diff --git a/play-services-core/src/main/java/org/microg/gms/wearable/NodeDatabaseHelper.java b/play-services-core/src/main/java/org/microg/gms/wearable/NodeDatabaseHelper.java index 2ddfe586..e362d550 100644 --- a/play-services-core/src/main/java/org/microg/gms/wearable/NodeDatabaseHelper.java +++ b/play-services-core/src/main/java/org/microg/gms/wearable/NodeDatabaseHelper.java @@ -187,6 +187,11 @@ public class NodeDatabaseHelper extends SQLiteOpenHelper { return db.query("dataItemsAndAssets", GDIBHAP_FIELDS, selection, params, null, null, "packageName, signatureDigest, host, path"); } + public Cursor getModifiedDataItems(final String nodeId, final long seqId, final boolean excludeDeleted) { + String selection = "sourceNode =? AND seqId >?" + (excludeDeleted ? "AND deleted =0" : ""); + return getReadableDatabase().query("dataItemsAndAssets", GDIBHAP_FIELDS, selection, new String[]{nodeId, Long.toString(seqId)}, null, null, "seqId", null); + } + public synchronized int deleteDataItems(String packageName, String signatureDigest, String host, String path) { SQLiteDatabase db = getWritableDatabase(); db.beginTransaction(); @@ -204,4 +209,17 @@ public class NodeDatabaseHelper extends SQLiteOpenHelper { db.endTransaction(); return n; } + + public long getCurrentSeqId(String sourceNode) { + SQLiteDatabase db = getReadableDatabase(); + Cursor cursor = db.query("dataItemsAndAssets", new String[]{"seqId"}, "sourceNode=?", new String[]{sourceNode}, null, null, "seqId DESC", "1"); + long res = 1; + if (cursor != null) { + if (cursor.moveToFirst()) { + res = cursor.getLong(0); + } + cursor.close();; + } + return res; + } } diff --git a/play-services-core/src/main/java/org/microg/gms/wearable/WearableServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/wearable/WearableServiceImpl.java index 50bfab62..30753e96 100644 --- a/play-services-core/src/main/java/org/microg/gms/wearable/WearableServiceImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/wearable/WearableServiceImpl.java @@ -28,28 +28,35 @@ import android.util.Log; import com.google.android.gms.common.api.Status; import com.google.android.gms.common.data.DataHolder; -import com.google.android.gms.wearable.internal.AddListenerRequest; import com.google.android.gms.wearable.Asset; import com.google.android.gms.wearable.ConnectionConfiguration; +import com.google.android.gms.wearable.Node; +import com.google.android.gms.wearable.internal.AddListenerRequest; +import com.google.android.gms.wearable.internal.AmsEntityUpdateParcelable; +import com.google.android.gms.wearable.internal.AncsNotificationParcelable; import com.google.android.gms.wearable.internal.CapabilityInfoParcelable; import com.google.android.gms.wearable.internal.ChannelEventParcelable; +import com.google.android.gms.wearable.internal.DataItemParcelable; import com.google.android.gms.wearable.internal.DeleteDataItemsResponse; import com.google.android.gms.wearable.internal.GetConfigResponse; import com.google.android.gms.wearable.internal.GetConfigsResponse; import com.google.android.gms.wearable.internal.GetConnectedNodesResponse; import com.google.android.gms.wearable.internal.GetDataItemResponse; import com.google.android.gms.wearable.internal.GetLocalNodeResponse; +import com.google.android.gms.wearable.internal.IWearableCallbacks; import com.google.android.gms.wearable.internal.IWearableListener; +import com.google.android.gms.wearable.internal.IWearableService; import com.google.android.gms.wearable.internal.MessageEventParcelable; +import com.google.android.gms.wearable.internal.NodeParcelable; import com.google.android.gms.wearable.internal.PutDataRequest; import com.google.android.gms.wearable.internal.PutDataResponse; import com.google.android.gms.wearable.internal.RemoveListenerRequest; -import com.google.android.gms.wearable.internal.DataItemParcelable; -import com.google.android.gms.wearable.internal.IWearableCallbacks; -import com.google.android.gms.wearable.internal.IWearableService; -import com.google.android.gms.wearable.internal.NodeParcelable; import org.microg.gms.common.PackageUtils; +import org.microg.wearable.WearableConnection; +import org.microg.wearable.proto.AssetEntry; +import org.microg.wearable.proto.RootMessage; +import org.microg.wearable.proto.SetDataItem; import java.io.File; import java.io.FileOutputStream; @@ -63,6 +70,8 @@ import java.util.Map; import java.util.Set; import java.util.UUID; +import okio.ByteString; + public class WearableServiceImpl extends IWearableService.Stub implements IWearableListener { private static final String TAG = "GmsWearSvcImpl"; @@ -75,6 +84,10 @@ public class WearableServiceImpl extends IWearableService.Stub implements IWeara private final NodeDatabaseHelper nodeDatabase; private final ConfigurationDatabaseHelper configDatabase; private Set listeners = new HashSet(); + private Set connectedNodes = new HashSet(); + private ConnectionConfiguration[] configurations; + private boolean configurationsUpdated = false; + private NetworkConnectionThread nct; private long seqIdBlock; private long seqIdInBlock = -1; @@ -125,7 +138,7 @@ public class WearableServiceImpl extends IWearableService.Stub implements IWeara callbacks.onPutDataResponse(new PutDataResponse(0, parcelable)); } - private DataItemRecord putDataItem(String packageName, String signatureDigest, String source, DataItemInternal dataItem) { + public DataItemRecord putDataItem(String packageName, String signatureDigest, String source, DataItemInternal dataItem) { DataItemRecord record = new DataItemRecord(); record.packageName = packageName; record.signatureDigest = signatureDigest; @@ -134,6 +147,10 @@ public class WearableServiceImpl extends IWearableService.Stub implements IWeara record.dataItem = dataItem; record.v1SeqId = getNextSeqId(); if (record.source.equals(getLocalNodeId())) record.seqId = record.v1SeqId; + return putDataItem(record); + } + + public DataItemRecord putDataItem(DataItemRecord record) { nodeDatabase.putRecord(record); return record; } @@ -231,8 +248,16 @@ public class WearableServiceImpl extends IWearableService.Stub implements IWeara @Override public void getConnectedNodes(IWearableCallbacks callbacks) throws RemoteException { - Log.d(TAG, "getConnectedNodes[fak]"); - callbacks.onGetConnectedNodesResponse(new GetConnectedNodesResponse(0, new ArrayList())); + Log.d(TAG, "getConnectedNodes"); + callbacks.onGetConnectedNodesResponse(new GetConnectedNodesResponse(0, getConnectedNodesParcelableList())); + } + + private List getConnectedNodesParcelableList() { + List nodes = new ArrayList(); + for (Node connectedNode : connectedNodes) { + nodes.add(new NodeParcelable(connectedNode)); + } + return nodes; } @Override @@ -253,13 +278,14 @@ public class WearableServiceImpl extends IWearableService.Stub implements IWeara public void putConfig(IWearableCallbacks callbacks, ConnectionConfiguration config) throws RemoteException { Log.d(TAG, "putConfig[nyp]: " + config); configDatabase.putConfiguration(config); + configurationsUpdated = true; callbacks.onStatus(Status.SUCCESS); } @Override public void getConfig(IWearableCallbacks callbacks) throws RemoteException { Log.d(TAG, "getConfig"); - ConnectionConfiguration[] configurations = configDatabase.getAllConfigurations(); + ConnectionConfiguration[] configurations = getConfigurations(); if (configurations == null || configurations.length == 0) { callbacks.onGetConfigResponse(new GetConfigResponse(1, new ConnectionConfiguration(null, null, 0, 0, false))); } else { @@ -271,16 +297,59 @@ public class WearableServiceImpl extends IWearableService.Stub implements IWeara public void getConfigs(IWearableCallbacks callbacks) throws RemoteException { Log.d(TAG, "getConfigs"); try { - callbacks.onGetConfigsResponse(new GetConfigsResponse(0, configDatabase.getAllConfigurations())); + callbacks.onGetConfigsResponse(new GetConfigsResponse(0, getConfigurations())); } catch (Exception e) { callbacks.onGetConfigsResponse(new GetConfigsResponse(8, new ConnectionConfiguration[0])); } } + private synchronized ConnectionConfiguration[] getConfigurations() { + if (configurations == null) { + configurations = configDatabase.getAllConfigurations(); + } + if (configurationsUpdated) { + configurationsUpdated = false; + ConnectionConfiguration[] newConfigurations = configDatabase.getAllConfigurations(); + for (ConnectionConfiguration configuration : configurations) { + for (ConnectionConfiguration newConfiguration : newConfigurations) { + if (newConfiguration.name.equals(configuration.name)) { + newConfiguration.connected = configuration.connected; + newConfiguration.peerNodeId = configuration.peerNodeId; + break; + } + } + } + configurations = newConfigurations; + } + return configurations; + } + + @Override + public void enableConnection(IWearableCallbacks callbacks, String name) throws RemoteException { + Log.d(TAG, "enableConnection: " + name); + configDatabase.setEnabledState(name, true); + configurationsUpdated = true; + callbacks.onStatus(Status.SUCCESS); + if (name.equals("server")) { + // TODO: hackady hack + (nct = new NetworkConnectionThread(this, configDatabase.getConfiguration(name))).start(); + } + } + @Override public void disableConnection(IWearableCallbacks callbacks, String name) throws RemoteException { + Log.d(TAG, "disableConnection: " + name); configDatabase.setEnabledState(name, false); + configurationsUpdated = true; callbacks.onStatus(Status.SUCCESS); + if (name.equals("server")) { + // TODO: hacady hack + if (nct != null) { + nct.close(); + nct.interrupt(); + nct = null; + } + } } @Override @@ -298,17 +367,45 @@ public class WearableServiceImpl extends IWearableService.Stub implements IWeara } @Override - public void onMessageReceived(MessageEventParcelable messageEvent) throws RemoteException { - for (IWearableListener listener : listeners) { - listener.onMessageReceived(messageEvent); + public void onMessageReceived(MessageEventParcelable messageEvent) { + Log.d(TAG, "onMessageReceived: " + messageEvent); + for (IWearableListener listener : new ArrayList(listeners)) { + try { + listener.onMessageReceived(messageEvent); + } catch (RemoteException e) { + listeners.remove(listener); + } } } @Override - public void onPeerConnected(NodeParcelable node) throws RemoteException { - for (IWearableListener listener : listeners) { - listener.onPeerConnected(node); + public void onPeerConnected(NodeParcelable node) { + Log.d(TAG, "onPeerConnected: " + node); + for (IWearableListener listener : new ArrayList(listeners)) { + try { + listener.onPeerConnected(node); + } catch (RemoteException e) { + listeners.remove(listener); + } } + addConnectedNode(node); + } + + private void addConnectedNode(Node node) { + connectedNodes.add(node); + onConnectedNodes(getConnectedNodesParcelableList()); + } + + private void removeConnectedNode(String nodeId) { + Node toRemove = null; + for (Node node : connectedNodes) { + if (node.getId().equals(nodeId)) { + toRemove = node; + break; + } + } + connectedNodes.remove(toRemove); + onConnectedNodes(getConnectedNodesParcelableList()); } @Override @@ -319,9 +416,21 @@ public class WearableServiceImpl extends IWearableService.Stub implements IWeara } @Override - public void onConnectedNodes(List nodes) throws RemoteException { + public void onConnectedNodes(List nodes) { + Log.d(TAG, "onConnectedNodes: " + nodes); for (IWearableListener listener : listeners) { - listener.onConnectedNodes(nodes); + try { + listener.onConnectedNodes(nodes); + } catch (RemoteException e) { + listeners.remove(listener); + } + } + } + + @Override + public void onNotificationReceived(AncsNotificationParcelable notification) throws RemoteException { + for (IWearableListener listener : listeners) { + listener.onNotificationReceived(notification); } } @@ -338,4 +447,55 @@ public class WearableServiceImpl extends IWearableService.Stub implements IWeara listener.onConnectedCapabilityChanged(capabilityInfo); } } + + @Override + public void onEntityUpdate(AmsEntityUpdateParcelable update) throws RemoteException { + for (IWearableListener listener : listeners) { + listener.onEntityUpdate(update); + } + } + + public Context getContext() { + return context; + } + + public void syncToPeer(WearableConnection connection, String nodeId, long seqId) { + Cursor cursor = nodeDatabase.getModifiedDataItems(nodeId, seqId, true); + if (cursor != null) { + while (cursor.moveToNext()) { + DataItemRecord record = DataItemRecord.fromCursor(cursor); + SetDataItem.Builder builder = new SetDataItem.Builder() + .packageName(record.packageName) + .signatureDigest(record.signatureDigest) + .uri(record.dataItem.uri.toString()) + .seqId(record.seqId) + .deleted(record.deleted) + .lastModified(record.lastModified); + if (record.source != null) builder.source(record.source); + if (record.dataItem.data != null) builder.data(ByteString.of(record.dataItem.data)); + List protoAssets = new ArrayList(); + Map assets = record.dataItem.getAssets(); + for (String key : assets.keySet()) { + protoAssets.add(new AssetEntry.Builder() + .key(key) + .unknown3(4) + .value(new org.microg.wearable.proto.Asset.Builder() + .digest(assets.get(key).getDigest()) + .build()).build()); + } + builder.assets(protoAssets); + try { + connection.writeMessage(new RootMessage.Builder().setDataItem(builder.build()).build()); + } catch (IOException e) { + Log.w(TAG, e); + break; + } + } + cursor.close(); + } + } + + public long getCurrentSeqId(String nodeId) { + return nodeDatabase.getCurrentSeqId(nodeId); + } } diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/AckAsset.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/AckAsset.java deleted file mode 100644 index 07dfdc19..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/AckAsset.java +++ /dev/null @@ -1,62 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.STRING; - -public final class AckAsset extends Message { - - public static final String DEFAULT_DIGEST = ""; - - @ProtoField(tag = 1, type = STRING) - public final String digest; - - public AckAsset(String digest) { - this.digest = digest; - } - - private AckAsset(Builder builder) { - this(builder.digest); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof AckAsset)) return false; - return equals(digest, ((AckAsset) other).digest); - } - - @Override - public int hashCode() { - int result = hashCode; - return result != 0 ? result : (hashCode = digest != null ? digest.hashCode() : 0); - } - - public static final class Builder extends Message.Builder { - - public String digest; - - public Builder() { - } - - public Builder(AckAsset message) { - super(message); - if (message == null) return; - this.digest = message.digest; - } - - public Builder digest(String digest) { - this.digest = digest; - return this; - } - - @Override - public AckAsset build() { - return new AckAsset(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/AppKey.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/AppKey.java deleted file mode 100644 index 345aecb6..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/AppKey.java +++ /dev/null @@ -1,81 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.STRING; - -public final class AppKey extends Message { - - public static final String DEFAULT_PACKAGENAME = ""; - public static final String DEFAULT_SIGNATUREDIGEST = ""; - - @ProtoField(tag = 1, type = STRING) - public final String packageName; - - @ProtoField(tag = 2, type = STRING) - public final String signatureDigest; - - public AppKey(String packageName, String signatureDigest) { - this.packageName = packageName; - this.signatureDigest = signatureDigest; - } - - private AppKey(Builder builder) { - this(builder.packageName, builder.signatureDigest); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof AppKey)) return false; - AppKey o = (AppKey) other; - return equals(packageName, o.packageName) - && equals(signatureDigest, o.signatureDigest); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = packageName != null ? packageName.hashCode() : 0; - result = result * 37 + (signatureDigest != null ? signatureDigest.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String packageName; - public String signatureDigest; - - public Builder() { - } - - public Builder(AppKey message) { - super(message); - if (message == null) return; - this.packageName = message.packageName; - this.signatureDigest = message.signatureDigest; - } - - public Builder packageName(String packageName) { - this.packageName = packageName; - return this; - } - - public Builder signatureDigest(String signatureDigest) { - this.signatureDigest = signatureDigest; - return this; - } - - @Override - public AppKey build() { - return new AppKey(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/AppKeys.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/AppKeys.java deleted file mode 100644 index 38e945c1..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/AppKeys.java +++ /dev/null @@ -1,64 +0,0 @@ -// 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 java.util.Collections; -import java.util.List; - -import static com.squareup.wire.Message.Label.REPEATED; - -public final class AppKeys extends Message { - - public static final List DEFAULT_APPKEYS = Collections.emptyList(); - - @ProtoField(tag = 1, label = REPEATED, messageType = AppKey.class) - public final List appKeys; - - public AppKeys(List appKeys) { - this.appKeys = immutableCopyOf(appKeys); - } - - private AppKeys(Builder builder) { - this(builder.appKeys); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof AppKeys)) return false; - return equals(appKeys, ((AppKeys) other).appKeys); - } - - @Override - public int hashCode() { - int result = hashCode; - return result != 0 ? result : (hashCode = appKeys != null ? appKeys.hashCode() : 1); - } - - public static final class Builder extends Message.Builder { - - public List appKeys; - - public Builder() { - } - - public Builder(AppKeys message) { - super(message); - if (message == null) return; - this.appKeys = copyOf(message.appKeys); - } - - public Builder appKeys(List appKeys) { - this.appKeys = checkForNulls(appKeys); - return this; - } - - @Override - public AppKeys build() { - return new AppKeys(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/Asset.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/Asset.java deleted file mode 100644 index f7d900eb..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/Asset.java +++ /dev/null @@ -1,40 +0,0 @@ -// 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; - -public final class Asset extends Message { - - public Asset() { - } - - private Asset(Builder builder) { - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - return other instanceof Asset; - } - - @Override - public int hashCode() { - return 0; - } - - public static final class Builder extends Message.Builder { - - public Builder() { - } - - public Builder(Asset message) { - super(message); - } - - @Override - public Asset build() { - return new Asset(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/AssetEntry.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/AssetEntry.java deleted file mode 100644 index 6dd8ef4d..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/AssetEntry.java +++ /dev/null @@ -1,95 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.STRING; - -public final class AssetEntry extends Message { - - public static final String DEFAULT_KEY = ""; - public static final Integer DEFAULT_UNKNOWN3 = 0; - - @ProtoField(tag = 1, type = STRING) - public final String key; - - @ProtoField(tag = 2) - public final Asset value; - - @ProtoField(tag = 3, type = INT32) - public final Integer unknown3; - - public AssetEntry(String key, Asset value, Integer unknown3) { - this.key = key; - this.value = value; - this.unknown3 = unknown3; - } - - private AssetEntry(Builder builder) { - this(builder.key, builder.value, builder.unknown3); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof AssetEntry)) return false; - AssetEntry o = (AssetEntry) other; - return equals(key, o.key) - && equals(value, o.value) - && equals(unknown3, o.unknown3); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = key != null ? key.hashCode() : 0; - result = result * 37 + (value != null ? value.hashCode() : 0); - result = result * 37 + (unknown3 != null ? unknown3.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String key; - public Asset value; - public Integer unknown3; - - public Builder() { - } - - public Builder(AssetEntry message) { - super(message); - if (message == null) return; - this.key = message.key; - this.value = message.value; - this.unknown3 = message.unknown3; - } - - public Builder key(String key) { - this.key = key; - return this; - } - - public Builder value(Asset value) { - this.value = value; - return this; - } - - public Builder unknown3(Integer unknown3) { - this.unknown3 = unknown3; - return this; - } - - @Override - public AssetEntry build() { - return new AssetEntry(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelControlRequest.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelControlRequest.java deleted file mode 100644 index 08efdb1f..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelControlRequest.java +++ /dev/null @@ -1,154 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; - -public final class ChannelControlRequest extends Message { - - public static final Integer DEFAULT_TYPE = 0; - public static final Long DEFAULT_CHANNELID = 0L; - public static final Boolean DEFAULT_FROMCHANNELOPERATOR = false; - public static final String DEFAULT_PACKAGENAME = ""; - public static final String DEFAULT_SIGNATUREDIGEST = ""; - public static final String DEFAULT_PATH = ""; - public static final Integer DEFAULT_CLOSEERRORCODE = 0; - - @ProtoField(tag = 1, type = INT32) - public final Integer type; - - @ProtoField(tag = 2, type = INT64) - public final Long channelId; - - @ProtoField(tag = 3, type = BOOL) - public final Boolean fromChannelOperator; - - @ProtoField(tag = 4, type = STRING) - public final String packageName; - - @ProtoField(tag = 5, type = STRING) - public final String signatureDigest; - - @ProtoField(tag = 6, type = STRING) - public final String path; - - @ProtoField(tag = 7, type = INT32) - public final Integer closeErrorCode; - - public ChannelControlRequest(Integer type, Long channelId, Boolean fromChannelOperator, String packageName, String signatureDigest, String path, Integer closeErrorCode) { - this.type = type; - this.channelId = channelId; - this.fromChannelOperator = fromChannelOperator; - this.packageName = packageName; - this.signatureDigest = signatureDigest; - this.path = path; - this.closeErrorCode = closeErrorCode; - } - - private ChannelControlRequest(Builder builder) { - this(builder.type, builder.channelId, builder.fromChannelOperator, builder.packageName, builder.signatureDigest, builder.path, builder.closeErrorCode); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof ChannelControlRequest)) return false; - ChannelControlRequest o = (ChannelControlRequest) other; - return equals(type, o.type) - && equals(channelId, o.channelId) - && equals(fromChannelOperator, o.fromChannelOperator) - && equals(packageName, o.packageName) - && equals(signatureDigest, o.signatureDigest) - && equals(path, o.path) - && equals(closeErrorCode, o.closeErrorCode); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = type != null ? type.hashCode() : 0; - result = result * 37 + (channelId != null ? channelId.hashCode() : 0); - result = result * 37 + (fromChannelOperator != null ? fromChannelOperator.hashCode() : 0); - result = result * 37 + (packageName != null ? packageName.hashCode() : 0); - result = result * 37 + (signatureDigest != null ? signatureDigest.hashCode() : 0); - result = result * 37 + (path != null ? path.hashCode() : 0); - result = result * 37 + (closeErrorCode != null ? closeErrorCode.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Integer type; - public Long channelId; - public Boolean fromChannelOperator; - public String packageName; - public String signatureDigest; - public String path; - public Integer closeErrorCode; - - public Builder() { - } - - public Builder(ChannelControlRequest message) { - super(message); - if (message == null) return; - this.type = message.type; - this.channelId = message.channelId; - this.fromChannelOperator = message.fromChannelOperator; - this.packageName = message.packageName; - this.signatureDigest = message.signatureDigest; - this.path = message.path; - this.closeErrorCode = message.closeErrorCode; - } - - public Builder type(Integer type) { - this.type = type; - return this; - } - - public Builder channelId(Long channelId) { - this.channelId = channelId; - return this; - } - - public Builder fromChannelOperator(Boolean fromChannelOperator) { - this.fromChannelOperator = fromChannelOperator; - return this; - } - - public Builder packageName(String packageName) { - this.packageName = packageName; - return this; - } - - public Builder signatureDigest(String signatureDigest) { - this.signatureDigest = signatureDigest; - return this; - } - - public Builder path(String path) { - this.path = path; - return this; - } - - public Builder closeErrorCode(Integer closeErrorCode) { - this.closeErrorCode = closeErrorCode; - return this; - } - - @Override - public ChannelControlRequest build() { - return new ChannelControlRequest(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelDataAckRequest.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelDataAckRequest.java deleted file mode 100644 index 7a4b6443..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelDataAckRequest.java +++ /dev/null @@ -1,80 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.BOOL; - -public final class ChannelDataAckRequest extends Message { - - public static final Boolean DEFAULT_FINALMESSAGE = false; - - @ProtoField(tag = 1) - public final ChannelDataHeader header; - - @ProtoField(tag = 2, type = BOOL) - public final Boolean finalMessage; - - public ChannelDataAckRequest(ChannelDataHeader header, Boolean finalMessage) { - this.header = header; - this.finalMessage = finalMessage; - } - - private ChannelDataAckRequest(Builder builder) { - this(builder.header, builder.finalMessage); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof ChannelDataAckRequest)) return false; - ChannelDataAckRequest o = (ChannelDataAckRequest) other; - return equals(header, o.header) - && equals(finalMessage, o.finalMessage); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = header != null ? header.hashCode() : 0; - result = result * 37 + (finalMessage != null ? finalMessage.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public ChannelDataHeader header; - public Boolean finalMessage; - - public Builder() { - } - - public Builder(ChannelDataAckRequest message) { - super(message); - if (message == null) return; - this.header = message.header; - this.finalMessage = message.finalMessage; - } - - public Builder header(ChannelDataHeader header) { - this.header = header; - return this; - } - - public Builder finalMessage(Boolean finalMessage) { - this.finalMessage = finalMessage; - return this; - } - - @Override - public ChannelDataAckRequest build() { - return new ChannelDataAckRequest(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelDataHeader.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelDataHeader.java deleted file mode 100644 index c654deb6..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelDataHeader.java +++ /dev/null @@ -1,96 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.INT64; - -public final class ChannelDataHeader extends Message { - - public static final Long DEFAULT_CHANNELID = 0L; - public static final Boolean DEFAULT_FROMCHANNELOPERATOR = false; - public static final Long DEFAULT_UNKNOWN3 = 0L; - - @ProtoField(tag = 1, type = INT64) - public final Long channelId; - - @ProtoField(tag = 2, type = BOOL) - public final Boolean fromChannelOperator; - - @ProtoField(tag = 3, type = INT64) - public final Long unknown3; - - public ChannelDataHeader(Long channelId, Boolean fromChannelOperator, Long unknown3) { - this.channelId = channelId; - this.fromChannelOperator = fromChannelOperator; - this.unknown3 = unknown3; - } - - private ChannelDataHeader(Builder builder) { - this(builder.channelId, builder.fromChannelOperator, builder.unknown3); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof ChannelDataHeader)) return false; - ChannelDataHeader o = (ChannelDataHeader) other; - return equals(channelId, o.channelId) - && equals(fromChannelOperator, o.fromChannelOperator) - && equals(unknown3, o.unknown3); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = channelId != null ? channelId.hashCode() : 0; - result = result * 37 + (fromChannelOperator != null ? fromChannelOperator.hashCode() : 0); - result = result * 37 + (unknown3 != null ? unknown3.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Long channelId; - public Boolean fromChannelOperator; - public Long unknown3; - - public Builder() { - } - - public Builder(ChannelDataHeader message) { - super(message); - if (message == null) return; - this.channelId = message.channelId; - this.fromChannelOperator = message.fromChannelOperator; - this.unknown3 = message.unknown3; - } - - public Builder channelId(Long channelId) { - this.channelId = channelId; - return this; - } - - public Builder fromChannelOperator(Boolean fromChannelOperator) { - this.fromChannelOperator = fromChannelOperator; - return this; - } - - public Builder unknown3(Long unknown3) { - this.unknown3 = unknown3; - return this; - } - - @Override - public ChannelDataHeader build() { - return new ChannelDataHeader(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelDataRequest.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelDataRequest.java deleted file mode 100644 index 7f002d98..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelDataRequest.java +++ /dev/null @@ -1,96 +0,0 @@ -// 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.BOOL; -import static com.squareup.wire.Message.Datatype.BYTES; - -public final class ChannelDataRequest extends Message { - - public static final ByteString DEFAULT_PAYLOAD = ByteString.EMPTY; - public static final Boolean DEFAULT_FINALMESSAGE = false; - - @ProtoField(tag = 1) - public final ChannelDataHeader header; - - @ProtoField(tag = 2, type = BYTES) - public final ByteString payload; - - @ProtoField(tag = 3, type = BOOL) - public final Boolean finalMessage; - - public ChannelDataRequest(ChannelDataHeader header, ByteString payload, Boolean finalMessage) { - this.header = header; - this.payload = payload; - this.finalMessage = finalMessage; - } - - private ChannelDataRequest(Builder builder) { - this(builder.header, builder.payload, builder.finalMessage); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof ChannelDataRequest)) return false; - ChannelDataRequest o = (ChannelDataRequest) other; - return equals(header, o.header) - && equals(payload, o.payload) - && equals(finalMessage, o.finalMessage); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = header != null ? header.hashCode() : 0; - result = result * 37 + (payload != null ? payload.hashCode() : 0); - result = result * 37 + (finalMessage != null ? finalMessage.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public ChannelDataHeader header; - public ByteString payload; - public Boolean finalMessage; - - public Builder() { - } - - public Builder(ChannelDataRequest message) { - super(message); - if (message == null) return; - this.header = message.header; - this.payload = message.payload; - this.finalMessage = message.finalMessage; - } - - public Builder header(ChannelDataHeader header) { - this.header = header; - return this; - } - - public Builder payload(ByteString payload) { - this.payload = payload; - return this; - } - - public Builder finalMessage(Boolean finalMessage) { - this.finalMessage = finalMessage; - return this; - } - - @Override - public ChannelDataRequest build() { - return new ChannelDataRequest(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelRequest.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelRequest.java deleted file mode 100644 index 7b3d87c7..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/ChannelRequest.java +++ /dev/null @@ -1,106 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.INT32; - -public final class ChannelRequest extends Message { - - public static final Integer DEFAULT_VERSION = 0; - - @ProtoField(tag = 2) - public final ChannelControlRequest channelControlRequest; - - @ProtoField(tag = 3) - public final ChannelDataRequest channelDataRequest; - - @ProtoField(tag = 4) - public final ChannelDataAckRequest channelDataAckRequest; - - @ProtoField(tag = 6, type = INT32) - public final Integer version; - - public ChannelRequest(ChannelControlRequest channelControlRequest, ChannelDataRequest channelDataRequest, ChannelDataAckRequest channelDataAckRequest, Integer version) { - this.channelControlRequest = channelControlRequest; - this.channelDataRequest = channelDataRequest; - this.channelDataAckRequest = channelDataAckRequest; - this.version = version; - } - - private ChannelRequest(Builder builder) { - this(builder.channelControlRequest, builder.channelDataRequest, builder.channelDataAckRequest, builder.version); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof ChannelRequest)) return false; - ChannelRequest o = (ChannelRequest) other; - return equals(channelControlRequest, o.channelControlRequest) - && equals(channelDataRequest, o.channelDataRequest) - && equals(channelDataAckRequest, o.channelDataAckRequest) - && equals(version, o.version); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = channelControlRequest != null ? channelControlRequest.hashCode() : 0; - result = result * 37 + (channelDataRequest != null ? channelDataRequest.hashCode() : 0); - result = result * 37 + (channelDataAckRequest != null ? channelDataAckRequest.hashCode() : 0); - result = result * 37 + (version != null ? version.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public ChannelControlRequest channelControlRequest; - public ChannelDataRequest channelDataRequest; - public ChannelDataAckRequest channelDataAckRequest; - public Integer version; - - public Builder() { - } - - public Builder(ChannelRequest message) { - super(message); - if (message == null) return; - this.channelControlRequest = message.channelControlRequest; - this.channelDataRequest = message.channelDataRequest; - this.channelDataAckRequest = message.channelDataAckRequest; - this.version = message.version; - } - - public Builder channelControlRequest(ChannelControlRequest channelControlRequest) { - this.channelControlRequest = channelControlRequest; - return this; - } - - public Builder channelDataRequest(ChannelDataRequest channelDataRequest) { - this.channelDataRequest = channelDataRequest; - return this; - } - - public Builder channelDataAckRequest(ChannelDataAckRequest channelDataAckRequest) { - this.channelDataAckRequest = channelDataAckRequest; - return this; - } - - public Builder version(Integer version) { - this.version = version; - return this; - } - - @Override - public ChannelRequest build() { - return new ChannelRequest(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/Connect.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/Connect.java deleted file mode 100644 index 9e3fc4f9..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/Connect.java +++ /dev/null @@ -1,153 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; - -public final class Connect extends Message { - - public static final Integer DEFAULT_ID = 0; - public static final String DEFAULT_NAME = ""; - public static final Long DEFAULT_PEERANDROIDID = 0L; - public static final Integer DEFAULT_UNKNOWN4 = 0; - public static final Integer DEFAULT_UNKNOWN5 = 0; - public static final Integer DEFAULT_UNKNOWN6 = 0; - public static final String DEFAULT_NETWORKID = ""; - - @ProtoField(tag = 1, type = INT32) - public final Integer id; - - @ProtoField(tag = 2, type = STRING) - public final String name; - - @ProtoField(tag = 3, type = INT64) - public final Long peerAndroidId; - - @ProtoField(tag = 4, type = INT32) - public final Integer unknown4; - - @ProtoField(tag = 5, type = INT32) - public final Integer unknown5; - - @ProtoField(tag = 6, type = INT32) - public final Integer unknown6; - - @ProtoField(tag = 7, type = STRING) - public final String networkId; - - public Connect(Integer id, String name, Long peerAndroidId, Integer unknown4, Integer unknown5, Integer unknown6, String networkId) { - this.id = id; - this.name = name; - this.peerAndroidId = peerAndroidId; - this.unknown4 = unknown4; - this.unknown5 = unknown5; - this.unknown6 = unknown6; - this.networkId = networkId; - } - - private Connect(Builder builder) { - this(builder.id, builder.name, builder.peerAndroidId, builder.unknown4, builder.unknown5, builder.unknown6, builder.networkId); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Connect)) return false; - Connect o = (Connect) other; - return equals(id, o.id) - && equals(name, o.name) - && equals(peerAndroidId, o.peerAndroidId) - && equals(unknown4, o.unknown4) - && equals(unknown5, o.unknown5) - && equals(unknown6, o.unknown6) - && equals(networkId, o.networkId); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = id != null ? id.hashCode() : 0; - result = result * 37 + (name != null ? name.hashCode() : 0); - result = result * 37 + (peerAndroidId != null ? peerAndroidId.hashCode() : 0); - result = result * 37 + (unknown4 != null ? unknown4.hashCode() : 0); - result = result * 37 + (unknown5 != null ? unknown5.hashCode() : 0); - result = result * 37 + (unknown6 != null ? unknown6.hashCode() : 0); - result = result * 37 + (networkId != null ? networkId.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Integer id; - public String name; - public Long peerAndroidId; - public Integer unknown4; - public Integer unknown5; - public Integer unknown6; - public String networkId; - - public Builder() { - } - - public Builder(Connect message) { - super(message); - if (message == null) return; - this.id = message.id; - this.name = message.name; - this.peerAndroidId = message.peerAndroidId; - this.unknown4 = message.unknown4; - this.unknown5 = message.unknown5; - this.unknown6 = message.unknown6; - this.networkId = message.networkId; - } - - public Builder id(Integer id) { - this.id = id; - return this; - } - - public Builder name(String name) { - this.name = name; - return this; - } - - public Builder peerAndroidId(Long peerAndroidId) { - this.peerAndroidId = peerAndroidId; - return this; - } - - public Builder unknown4(Integer unknown4) { - this.unknown4 = unknown4; - return this; - } - - public Builder unknown5(Integer unknown5) { - this.unknown5 = unknown5; - return this; - } - - public Builder unknown6(Integer unknown6) { - this.unknown6 = unknown6; - return this; - } - - public Builder networkId(String networkId) { - this.networkId = networkId; - return this; - } - - @Override - public Connect build() { - return new Connect(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/FetchAsset.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/FetchAsset.java deleted file mode 100644 index 238d4c5f..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/FetchAsset.java +++ /dev/null @@ -1,110 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.STRING; - -public final class FetchAsset extends Message { - - public static final String DEFAULT_PACKAGENAME = ""; - public static final String DEFAULT_ASSETNAME = ""; - public static final Boolean DEFAULT_PERMISSION = false; - public static final String DEFAULT_SIGNATUREDIGEST = ""; - - @ProtoField(tag = 1, type = STRING) - public final String packageName; - - @ProtoField(tag = 2, type = STRING) - public final String assetName; - - @ProtoField(tag = 3, type = BOOL) - public final Boolean permission; - - @ProtoField(tag = 4, type = STRING) - public final String signatureDigest; - - public FetchAsset(String packageName, String assetName, Boolean permission, String signatureDigest) { - this.packageName = packageName; - this.assetName = assetName; - this.permission = permission; - this.signatureDigest = signatureDigest; - } - - private FetchAsset(Builder builder) { - this(builder.packageName, builder.assetName, builder.permission, builder.signatureDigest); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof FetchAsset)) return false; - FetchAsset o = (FetchAsset) other; - return equals(packageName, o.packageName) - && equals(assetName, o.assetName) - && equals(permission, o.permission) - && equals(signatureDigest, o.signatureDigest); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = packageName != null ? packageName.hashCode() : 0; - result = result * 37 + (assetName != null ? assetName.hashCode() : 0); - result = result * 37 + (permission != null ? permission.hashCode() : 0); - result = result * 37 + (signatureDigest != null ? signatureDigest.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String packageName; - public String assetName; - public Boolean permission; - public String signatureDigest; - - public Builder() { - } - - public Builder(FetchAsset message) { - super(message); - if (message == null) return; - this.packageName = message.packageName; - this.assetName = message.assetName; - this.permission = message.permission; - this.signatureDigest = message.signatureDigest; - } - - public Builder packageName(String packageName) { - this.packageName = packageName; - return this; - } - - public Builder assetName(String assetName) { - this.assetName = assetName; - return this; - } - - public Builder permission(Boolean permission) { - this.permission = permission; - return this; - } - - public Builder signatureDigest(String signatureDigest) { - this.signatureDigest = signatureDigest; - return this; - } - - @Override - public FetchAsset build() { - return new FetchAsset(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/FilePiece.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/FilePiece.java deleted file mode 100644 index dbcd36d4..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/FilePiece.java +++ /dev/null @@ -1,112 +0,0 @@ -// 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.BOOL; -import static com.squareup.wire.Message.Datatype.BYTES; -import static com.squareup.wire.Message.Datatype.STRING; - -public final class FilePiece extends Message { - - public static final String DEFAULT_FILENAME = ""; - public static final Boolean DEFAULT_FINALPIECE = false; - public static final ByteString DEFAULT_PIECE = ByteString.EMPTY; - public static final String DEFAULT_DIGEST = ""; - - @ProtoField(tag = 1, type = STRING) - public final String fileName; - - @ProtoField(tag = 2, type = BOOL) - public final Boolean finalPiece; - - @ProtoField(tag = 3, type = BYTES) - public final ByteString piece; - - @ProtoField(tag = 4, type = STRING) - public final String digest; - - public FilePiece(String fileName, Boolean finalPiece, ByteString piece, String digest) { - this.fileName = fileName; - this.finalPiece = finalPiece; - this.piece = piece; - this.digest = digest; - } - - private FilePiece(Builder builder) { - this(builder.fileName, builder.finalPiece, builder.piece, builder.digest); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof FilePiece)) return false; - FilePiece o = (FilePiece) other; - return equals(fileName, o.fileName) - && equals(finalPiece, o.finalPiece) - && equals(piece, o.piece) - && equals(digest, o.digest); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = fileName != null ? fileName.hashCode() : 0; - result = result * 37 + (finalPiece != null ? finalPiece.hashCode() : 0); - result = result * 37 + (piece != null ? piece.hashCode() : 0); - result = result * 37 + (digest != null ? digest.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String fileName; - public Boolean finalPiece; - public ByteString piece; - public String digest; - - public Builder() { - } - - public Builder(FilePiece message) { - super(message); - if (message == null) return; - this.fileName = message.fileName; - this.finalPiece = message.finalPiece; - this.piece = message.piece; - this.digest = message.digest; - } - - public Builder fileName(String fileName) { - this.fileName = fileName; - return this; - } - - public Builder finalPiece(Boolean finalPiece) { - this.finalPiece = finalPiece; - return this; - } - - public Builder piece(ByteString piece) { - this.piece = piece; - return this; - } - - public Builder digest(String digest) { - this.digest = digest; - return this; - } - - @Override - public FilePiece build() { - return new FilePiece(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/Heartbeat.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/Heartbeat.java deleted file mode 100644 index da766701..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/Heartbeat.java +++ /dev/null @@ -1,40 +0,0 @@ -// 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; - -public final class Heartbeat extends Message { - - public Heartbeat() { - } - - private Heartbeat(Builder builder) { - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - return other instanceof Heartbeat; - } - - @Override - public int hashCode() { - return 0; - } - - public static final class Builder extends Message.Builder { - - public Builder() { - } - - public Builder(Heartbeat message) { - super(message); - } - - @Override - public Heartbeat build() { - return new Heartbeat(this); - } - } -} 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 deleted file mode 100644 index 11fb291e..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/MessagePiece.java +++ /dev/null @@ -1,126 +0,0 @@ -// 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-java/org/microg/gms/wearable/Request.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/Request.java deleted file mode 100644 index 08504d79..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/Request.java +++ /dev/null @@ -1,195 +0,0 @@ -// 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 Request extends Message { - - public static final Integer DEFAULT_REQUESTID = 0; - public static final String DEFAULT_PACKAGENAME = ""; - public static final String DEFAULT_SIGNATUREDIGEST = ""; - public static final String DEFAULT_TARGETNODEID = ""; - public static final Integer DEFAULT_UNKNOWN5 = 0; - public static final String DEFAULT_PATH = ""; - public static final ByteString DEFAULT_RAWDATA = ByteString.EMPTY; - public static final String DEFAULT_SOURCENODEID = ""; - public static final Integer DEFAULT_GENERATION = 0; - - @ProtoField(tag = 1, type = INT32) - public final Integer requestId; - - @ProtoField(tag = 2, type = STRING) - public final String packageName; - - @ProtoField(tag = 3, type = STRING) - public final String signatureDigest; - - @ProtoField(tag = 4, type = STRING) - public final String targetNodeId; - - @ProtoField(tag = 5, type = INT32) - public final Integer unknown5; - - @ProtoField(tag = 6, type = STRING) - public final String path; - - @ProtoField(tag = 7, type = BYTES) - public final ByteString rawData; - - @ProtoField(tag = 8, type = STRING) - public final String sourceNodeId; - - @ProtoField(tag = 9) - public final ChannelRequest request; - - @ProtoField(tag = 10, type = INT32) - public final Integer generation; - - public Request(Integer requestId, String packageName, String signatureDigest, String targetNodeId, Integer unknown5, String path, ByteString rawData, String sourceNodeId, ChannelRequest request, Integer generation) { - this.requestId = requestId; - this.packageName = packageName; - this.signatureDigest = signatureDigest; - this.targetNodeId = targetNodeId; - this.unknown5 = unknown5; - this.path = path; - this.rawData = rawData; - this.sourceNodeId = sourceNodeId; - this.request = request; - this.generation = generation; - } - - private Request(Builder builder) { - this(builder.requestId, builder.packageName, builder.signatureDigest, builder.targetNodeId, builder.unknown5, builder.path, builder.rawData, builder.sourceNodeId, builder.request, builder.generation); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof Request)) return false; - Request o = (Request) other; - return equals(requestId, o.requestId) - && equals(packageName, o.packageName) - && equals(signatureDigest, o.signatureDigest) - && equals(targetNodeId, o.targetNodeId) - && equals(unknown5, o.unknown5) - && equals(path, o.path) - && equals(rawData, o.rawData) - && equals(sourceNodeId, o.sourceNodeId) - && equals(request, o.request) - && equals(generation, o.generation); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = requestId != null ? requestId.hashCode() : 0; - result = result * 37 + (packageName != null ? packageName.hashCode() : 0); - result = result * 37 + (signatureDigest != null ? signatureDigest.hashCode() : 0); - result = result * 37 + (targetNodeId != null ? targetNodeId.hashCode() : 0); - result = result * 37 + (unknown5 != null ? unknown5.hashCode() : 0); - result = result * 37 + (path != null ? path.hashCode() : 0); - result = result * 37 + (rawData != null ? rawData.hashCode() : 0); - result = result * 37 + (sourceNodeId != null ? sourceNodeId.hashCode() : 0); - result = result * 37 + (request != null ? request.hashCode() : 0); - result = result * 37 + (generation != null ? generation.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Integer requestId; - public String packageName; - public String signatureDigest; - public String targetNodeId; - public Integer unknown5; - public String path; - public ByteString rawData; - public String sourceNodeId; - public ChannelRequest request; - public Integer generation; - - public Builder() { - } - - public Builder(Request message) { - super(message); - if (message == null) return; - this.requestId = message.requestId; - this.packageName = message.packageName; - this.signatureDigest = message.signatureDigest; - this.targetNodeId = message.targetNodeId; - this.unknown5 = message.unknown5; - this.path = message.path; - this.rawData = message.rawData; - this.sourceNodeId = message.sourceNodeId; - this.request = message.request; - this.generation = message.generation; - } - - public Builder requestId(Integer requestId) { - this.requestId = requestId; - return this; - } - - public Builder packageName(String packageName) { - this.packageName = packageName; - return this; - } - - public Builder signatureDigest(String signatureDigest) { - this.signatureDigest = signatureDigest; - return this; - } - - public Builder targetNodeId(String targetNodeId) { - this.targetNodeId = targetNodeId; - return this; - } - - public Builder unknown5(Integer unknown5) { - this.unknown5 = unknown5; - return this; - } - - public Builder path(String path) { - this.path = path; - return this; - } - - public Builder rawData(ByteString rawData) { - this.rawData = rawData; - return this; - } - - public Builder sourceNodeId(String sourceNodeId) { - this.sourceNodeId = sourceNodeId; - return this; - } - - public Builder request(ChannelRequest request) { - this.request = request; - return this; - } - - public Builder generation(Integer generation) { - this.generation = generation; - return this; - } - - @Override - public Request build() { - return new Request(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/RootMessage.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/RootMessage.java deleted file mode 100644 index 7a0fd9f4..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/RootMessage.java +++ /dev/null @@ -1,197 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.BOOL; - -public final class RootMessage extends Message { - - public static final Boolean DEFAULT_UNKNOWN13 = false; - - @ProtoField(tag = 4) - public final SetAsset setAsset; - - @ProtoField(tag = 5) - public final AckAsset ackAsset; - - @ProtoField(tag = 6) - public final FetchAsset fetchAsset; - - @ProtoField(tag = 7) - public final Connect connect; - - @ProtoField(tag = 8) - public final SyncStart syncStart; - - @ProtoField(tag = 9) - public final SetDataItem setDataItem; - - @ProtoField(tag = 10) - public final Request rcpRequest; - - @ProtoField(tag = 11) - public final Heartbeat heartbeat; - - @ProtoField(tag = 12) - public final FilePiece filePiece; - - @ProtoField(tag = 13, type = BOOL) - public final Boolean unknown13; - - @ProtoField(tag = 16) - public final Request channelRequest; - - public RootMessage(SetAsset setAsset, AckAsset ackAsset, FetchAsset fetchAsset, Connect connect, SyncStart syncStart, SetDataItem setDataItem, Request rcpRequest, Heartbeat heartbeat, FilePiece filePiece, Boolean unknown13, Request channelRequest) { - this.setAsset = setAsset; - this.ackAsset = ackAsset; - this.fetchAsset = fetchAsset; - this.connect = connect; - this.syncStart = syncStart; - this.setDataItem = setDataItem; - this.rcpRequest = rcpRequest; - this.heartbeat = heartbeat; - this.filePiece = filePiece; - this.unknown13 = unknown13; - this.channelRequest = channelRequest; - } - - private RootMessage(Builder builder) { - this(builder.setAsset, builder.ackAsset, builder.fetchAsset, builder.connect, builder.syncStart, builder.setDataItem, builder.rcpRequest, builder.heartbeat, builder.filePiece, builder.unknown13, builder.channelRequest); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof RootMessage)) return false; - RootMessage o = (RootMessage) other; - return equals(setAsset, o.setAsset) - && equals(ackAsset, o.ackAsset) - && equals(fetchAsset, o.fetchAsset) - && equals(connect, o.connect) - && equals(syncStart, o.syncStart) - && equals(setDataItem, o.setDataItem) - && equals(rcpRequest, o.rcpRequest) - && equals(heartbeat, o.heartbeat) - && equals(filePiece, o.filePiece) - && equals(unknown13, o.unknown13) - && equals(channelRequest, o.channelRequest); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = setAsset != null ? setAsset.hashCode() : 0; - result = result * 37 + (ackAsset != null ? ackAsset.hashCode() : 0); - result = result * 37 + (fetchAsset != null ? fetchAsset.hashCode() : 0); - result = result * 37 + (connect != null ? connect.hashCode() : 0); - result = result * 37 + (syncStart != null ? syncStart.hashCode() : 0); - result = result * 37 + (setDataItem != null ? setDataItem.hashCode() : 0); - result = result * 37 + (rcpRequest != null ? rcpRequest.hashCode() : 0); - result = result * 37 + (heartbeat != null ? heartbeat.hashCode() : 0); - result = result * 37 + (filePiece != null ? filePiece.hashCode() : 0); - result = result * 37 + (unknown13 != null ? unknown13.hashCode() : 0); - result = result * 37 + (channelRequest != null ? channelRequest.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public SetAsset setAsset; - public AckAsset ackAsset; - public FetchAsset fetchAsset; - public Connect connect; - public SyncStart syncStart; - public SetDataItem setDataItem; - public Request rcpRequest; - public Heartbeat heartbeat; - public FilePiece filePiece; - public Boolean unknown13; - public Request channelRequest; - - public Builder() { - } - - public Builder(RootMessage message) { - super(message); - if (message == null) return; - this.setAsset = message.setAsset; - this.ackAsset = message.ackAsset; - this.fetchAsset = message.fetchAsset; - this.connect = message.connect; - this.syncStart = message.syncStart; - this.setDataItem = message.setDataItem; - this.rcpRequest = message.rcpRequest; - this.heartbeat = message.heartbeat; - this.filePiece = message.filePiece; - this.unknown13 = message.unknown13; - this.channelRequest = message.channelRequest; - } - - public Builder setAsset(SetAsset setAsset) { - this.setAsset = setAsset; - return this; - } - - public Builder ackAsset(AckAsset ackAsset) { - this.ackAsset = ackAsset; - return this; - } - - public Builder fetchAsset(FetchAsset fetchAsset) { - this.fetchAsset = fetchAsset; - return this; - } - - public Builder connect(Connect connect) { - this.connect = connect; - return this; - } - - public Builder syncStart(SyncStart syncStart) { - this.syncStart = syncStart; - return this; - } - - public Builder setDataItem(SetDataItem setDataItem) { - this.setDataItem = setDataItem; - return this; - } - - public Builder rcpRequest(Request rcpRequest) { - this.rcpRequest = rcpRequest; - return this; - } - - public Builder heartbeat(Heartbeat heartbeat) { - this.heartbeat = heartbeat; - return this; - } - - public Builder filePiece(FilePiece filePiece) { - this.filePiece = filePiece; - return this; - } - - public Builder unknown13(Boolean unknown13) { - this.unknown13 = unknown13; - return this; - } - - public Builder channelRequest(Request channelRequest) { - this.channelRequest = channelRequest; - return this; - } - - @Override - public RootMessage build() { - return new RootMessage(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/SetAsset.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/SetAsset.java deleted file mode 100644 index 2935509b..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/SetAsset.java +++ /dev/null @@ -1,96 +0,0 @@ -// 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.STRING; - -public final class SetAsset extends Message { - - public static final String DEFAULT_DIGEST = ""; - public static final ByteString DEFAULT_DATA = ByteString.EMPTY; - - @ProtoField(tag = 1, type = STRING) - public final String digest; - - @ProtoField(tag = 2, type = BYTES) - public final ByteString data; - - @ProtoField(tag = 3) - public final AppKeys appkeys; - - public SetAsset(String digest, ByteString data, AppKeys appkeys) { - this.digest = digest; - this.data = data; - this.appkeys = appkeys; - } - - private SetAsset(Builder builder) { - this(builder.digest, builder.data, builder.appkeys); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof SetAsset)) return false; - SetAsset o = (SetAsset) other; - return equals(digest, o.digest) - && equals(data, o.data) - && equals(appkeys, o.appkeys); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = digest != null ? digest.hashCode() : 0; - result = result * 37 + (data != null ? data.hashCode() : 0); - result = result * 37 + (appkeys != null ? appkeys.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String digest; - public ByteString data; - public AppKeys appkeys; - - public Builder() { - } - - public Builder(SetAsset message) { - super(message); - if (message == null) return; - this.digest = message.digest; - this.data = message.data; - this.appkeys = message.appkeys; - } - - public Builder digest(String digest) { - this.digest = digest; - return this; - } - - public Builder data(ByteString data) { - this.data = data; - return this; - } - - public Builder appkeys(AppKeys appkeys) { - this.appkeys = appkeys; - return this; - } - - @Override - public SetAsset build() { - return new SetAsset(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/SetDataItem.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/SetDataItem.java deleted file mode 100644 index 8d540fa2..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/SetDataItem.java +++ /dev/null @@ -1,200 +0,0 @@ -// 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 java.util.Collections; -import java.util.List; -import okio.ByteString; - -import static com.squareup.wire.Message.Datatype.BOOL; -import static com.squareup.wire.Message.Datatype.BYTES; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; -import static com.squareup.wire.Message.Label.REPEATED; - -public final class SetDataItem extends Message { - - public static final String DEFAULT_PACKAGENAME = ""; - public static final String DEFAULT_URI = ""; - public static final List DEFAULT_UNKNOWN3 = Collections.emptyList(); - public static final ByteString DEFAULT_DATA = ByteString.EMPTY; - public static final Long DEFAULT_SEQID = 0L; - public static final Boolean DEFAULT_DELETED = false; - public static final String DEFAULT_SOURCE = ""; - public static final List DEFAULT_ASSETS = Collections.emptyList(); - public static final String DEFAULT_SIGNATUREDIGEST = ""; - public static final Long DEFAULT_LASTMODIFIED = 0L; - - @ProtoField(tag = 1, type = STRING) - public final String packageName; - - @ProtoField(tag = 2, type = STRING) - public final String uri; - - @ProtoField(tag = 3, type = STRING, label = REPEATED) - public final List unknown3; - - @ProtoField(tag = 4, type = BYTES) - public final ByteString data; - - @ProtoField(tag = 5, type = INT64) - public final Long seqId; - - @ProtoField(tag = 6, type = BOOL) - public final Boolean deleted; - - @ProtoField(tag = 7, type = STRING) - public final String source; - - @ProtoField(tag = 8, label = REPEATED, messageType = AssetEntry.class) - public final List assets; - - @ProtoField(tag = 9, type = STRING) - public final String signatureDigest; - - @ProtoField(tag = 10, type = INT64) - public final Long lastModified; - - public SetDataItem(String packageName, String uri, List unknown3, ByteString data, Long seqId, Boolean deleted, String source, List assets, String signatureDigest, Long lastModified) { - this.packageName = packageName; - this.uri = uri; - this.unknown3 = immutableCopyOf(unknown3); - this.data = data; - this.seqId = seqId; - this.deleted = deleted; - this.source = source; - this.assets = immutableCopyOf(assets); - this.signatureDigest = signatureDigest; - this.lastModified = lastModified; - } - - private SetDataItem(Builder builder) { - this(builder.packageName, builder.uri, builder.unknown3, builder.data, builder.seqId, builder.deleted, builder.source, builder.assets, builder.signatureDigest, builder.lastModified); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof SetDataItem)) return false; - SetDataItem o = (SetDataItem) other; - return equals(packageName, o.packageName) - && equals(uri, o.uri) - && equals(unknown3, o.unknown3) - && equals(data, o.data) - && equals(seqId, o.seqId) - && equals(deleted, o.deleted) - && equals(source, o.source) - && equals(assets, o.assets) - && equals(signatureDigest, o.signatureDigest) - && equals(lastModified, o.lastModified); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = packageName != null ? packageName.hashCode() : 0; - result = result * 37 + (uri != null ? uri.hashCode() : 0); - result = result * 37 + (unknown3 != null ? unknown3.hashCode() : 1); - result = result * 37 + (data != null ? data.hashCode() : 0); - result = result * 37 + (seqId != null ? seqId.hashCode() : 0); - result = result * 37 + (deleted != null ? deleted.hashCode() : 0); - result = result * 37 + (source != null ? source.hashCode() : 0); - result = result * 37 + (assets != null ? assets.hashCode() : 1); - result = result * 37 + (signatureDigest != null ? signatureDigest.hashCode() : 0); - result = result * 37 + (lastModified != null ? lastModified.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String packageName; - public String uri; - public List unknown3; - public ByteString data; - public Long seqId; - public Boolean deleted; - public String source; - public List assets; - public String signatureDigest; - public Long lastModified; - - public Builder() { - } - - public Builder(SetDataItem message) { - super(message); - if (message == null) return; - this.packageName = message.packageName; - this.uri = message.uri; - this.unknown3 = copyOf(message.unknown3); - this.data = message.data; - this.seqId = message.seqId; - this.deleted = message.deleted; - this.source = message.source; - this.assets = copyOf(message.assets); - this.signatureDigest = message.signatureDigest; - this.lastModified = message.lastModified; - } - - public Builder packageName(String packageName) { - this.packageName = packageName; - return this; - } - - public Builder uri(String uri) { - this.uri = uri; - return this; - } - - public Builder unknown3(List unknown3) { - this.unknown3 = checkForNulls(unknown3); - return this; - } - - public Builder data(ByteString data) { - this.data = data; - return this; - } - - public Builder seqId(Long seqId) { - this.seqId = seqId; - return this; - } - - public Builder deleted(Boolean deleted) { - this.deleted = deleted; - return this; - } - - public Builder source(String source) { - this.source = source; - return this; - } - - public Builder assets(List assets) { - this.assets = checkForNulls(assets); - return this; - } - - public Builder signatureDigest(String signatureDigest) { - this.signatureDigest = signatureDigest; - return this; - } - - public Builder lastModified(Long lastModified) { - this.lastModified = lastModified; - return this; - } - - @Override - public SetDataItem build() { - return new SetDataItem(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/SyncStart.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/SyncStart.java deleted file mode 100644 index 652e36a5..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/SyncStart.java +++ /dev/null @@ -1,99 +0,0 @@ -// 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 java.util.Collections; -import java.util.List; - -import static com.squareup.wire.Message.Datatype.INT32; -import static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Label.REPEATED; - -public final class SyncStart extends Message { - - public static final Long DEFAULT_RECEIVEDSEQID = 0L; - public static final List DEFAULT_SYNCTABLE = Collections.emptyList(); - public static final Integer DEFAULT_VERSION = 0; - - @ProtoField(tag = 1, type = INT64) - public final Long receivedSeqId; - - @ProtoField(tag = 2, label = REPEATED, messageType = SyncTableEntry.class) - public final List syncTable; - - @ProtoField(tag = 3, type = INT32) - public final Integer version; - - public SyncStart(Long receivedSeqId, List syncTable, Integer version) { - this.receivedSeqId = receivedSeqId; - this.syncTable = immutableCopyOf(syncTable); - this.version = version; - } - - private SyncStart(Builder builder) { - this(builder.receivedSeqId, builder.syncTable, builder.version); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof SyncStart)) return false; - SyncStart o = (SyncStart) other; - return equals(receivedSeqId, o.receivedSeqId) - && equals(syncTable, o.syncTable) - && equals(version, o.version); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = receivedSeqId != null ? receivedSeqId.hashCode() : 0; - result = result * 37 + (syncTable != null ? syncTable.hashCode() : 1); - result = result * 37 + (version != null ? version.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public Long receivedSeqId; - public List syncTable; - public Integer version; - - public Builder() { - } - - public Builder(SyncStart message) { - super(message); - if (message == null) return; - this.receivedSeqId = message.receivedSeqId; - this.syncTable = copyOf(message.syncTable); - this.version = message.version; - } - - public Builder receivedSeqId(Long receivedSeqId) { - this.receivedSeqId = receivedSeqId; - return this; - } - - public Builder syncTable(List syncTable) { - this.syncTable = checkForNulls(syncTable); - return this; - } - - public Builder version(Integer version) { - this.version = version; - return this; - } - - @Override - public SyncStart build() { - return new SyncStart(this); - } - } -} diff --git a/play-services-core/src/main/protos-java/org/microg/gms/wearable/SyncTableEntry.java b/play-services-core/src/main/protos-java/org/microg/gms/wearable/SyncTableEntry.java deleted file mode 100644 index 19d2f95a..00000000 --- a/play-services-core/src/main/protos-java/org/microg/gms/wearable/SyncTableEntry.java +++ /dev/null @@ -1,82 +0,0 @@ -// 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 static com.squareup.wire.Message.Datatype.INT64; -import static com.squareup.wire.Message.Datatype.STRING; - -public final class SyncTableEntry extends Message { - - public static final String DEFAULT_KEY = ""; - public static final Long DEFAULT_VALUE = 0L; - - @ProtoField(tag = 1, type = STRING) - public final String key; - - @ProtoField(tag = 2, type = INT64) - public final Long value; - - public SyncTableEntry(String key, Long value) { - this.key = key; - this.value = value; - } - - private SyncTableEntry(Builder builder) { - this(builder.key, builder.value); - setBuilder(builder); - } - - @Override - public boolean equals(Object other) { - if (other == this) return true; - if (!(other instanceof SyncTableEntry)) return false; - SyncTableEntry o = (SyncTableEntry) other; - return equals(key, o.key) - && equals(value, o.value); - } - - @Override - public int hashCode() { - int result = hashCode; - if (result == 0) { - result = key != null ? key.hashCode() : 0; - result = result * 37 + (value != null ? value.hashCode() : 0); - hashCode = result; - } - return result; - } - - public static final class Builder extends Message.Builder { - - public String key; - public Long value; - - public Builder() { - } - - public Builder(SyncTableEntry message) { - super(message); - if (message == null) return; - this.key = message.key; - this.value = message.value; - } - - public Builder key(String key) { - this.key = key; - return this; - } - - public Builder value(Long value) { - this.value = value; - return this; - } - - @Override - public SyncTableEntry build() { - return new SyncTableEntry(this); - } - } -} diff --git a/play-services-core/src/main/protos-repo/wearable.proto b/play-services-core/src/main/protos-repo/wearable.proto deleted file mode 100644 index a8aeeccf..00000000 --- a/play-services-core/src/main/protos-repo/wearable.proto +++ /dev/null @@ -1,152 +0,0 @@ -option java_package = "org.microg.gms.wearable"; -option java_outer_classname = "WearableProto"; - -message AckAsset { - optional string digest = 1; -} - -message AppKey { - optional string packageName = 1; - optional string signatureDigest = 2; -} - -message AppKeys { - repeated AppKey appKeys = 1; -} - -message Asset { - // TODO -} - -message AssetEntry { - optional string key = 1; - optional Asset value = 2; - optional int32 unknown3 = 3; -} - -message ChannelControlRequest { - optional int32 type = 1; - optional int64 channelId = 2; - optional bool fromChannelOperator = 3; - optional string packageName = 4; - optional string signatureDigest = 5; - optional string path = 6; - 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 ChannelDataRequest { - optional ChannelDataHeader header = 1; - optional bytes payload = 2; - optional bool finalMessage = 3; -} - -message ChannelRequest { - optional ChannelControlRequest channelControlRequest = 2; - optional ChannelDataRequest channelDataRequest = 3; - optional ChannelDataAckRequest channelDataAckRequest = 4; - optional int32 version = 6; -} - -message Connect { - optional int32 id = 1; - optional string name = 2; - optional int64 peerAndroidId = 3; - optional int32 unknown4 = 4; - optional int32 unknown5 = 5; - optional int32 unknown6 = 6; - optional string networkId = 7; -} - -message FetchAsset { - optional string packageName = 1; - optional string assetName = 2; - optional bool permission = 3; - optional string signatureDigest = 4; -} - -message FilePiece { - optional string fileName = 1; - optional bool finalPiece = 2; - optional bytes piece = 3; - optional string digest = 4; -} - -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; - optional string signatureDigest = 3; - optional string targetNodeId = 4; - optional int32 unknown5 = 5; - optional string path = 6; - optional bytes rawData = 7; - optional string sourceNodeId = 8; - optional ChannelRequest request = 9; - optional int32 generation = 10; -} - -message RootMessage { - optional SetAsset setAsset = 4; - optional AckAsset ackAsset = 5; - optional FetchAsset fetchAsset = 6; - optional Connect connect = 7; - optional SyncStart syncStart = 8; - optional SetDataItem setDataItem = 9; - optional Request rcpRequest = 10; - optional Heartbeat heartbeat = 11; - optional FilePiece filePiece = 12; - optional bool unknown13 = 13; - optional Request channelRequest = 16; -} - -message SetAsset { - optional string digest = 1; - optional bytes data = 2; - optional AppKeys appkeys = 3; -} - -message SetDataItem { - optional string packageName = 1; - optional string uri = 2; - repeated string unknown3 = 3; - optional bytes data = 4; - optional int64 seqId = 5; - optional bool deleted = 6; - optional string source = 7; - repeated AssetEntry assets = 8; - optional string signatureDigest = 9; - optional int64 lastModified = 10; -} - -message SyncStart { - optional int64 receivedSeqId = 1; - repeated SyncTableEntry syncTable = 2; - optional int32 version = 3; -} - -message SyncTableEntry { - optional string key = 1; - optional int64 value = 2; -} diff --git a/settings.gradle b/settings.gradle index d3cec332..92069596 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,7 @@ include ':safe-parcel' +include ':wearable-lib' + include ':unifiednlp-api' include ':unifiednlp-base' include ':unifiednlp-compat' diff --git a/wearable-lib b/wearable-lib new file mode 120000 index 00000000..b3cbdfc2 --- /dev/null +++ b/wearable-lib @@ -0,0 +1 @@ +extern/Wearable/wearable-lib/ \ No newline at end of file