mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2024-11-19 02:29:25 +01:00
Combined changes:
- Adapt to GmsApi changes - Add GmsLib for play-services-wearable library - Increase version code (fixes #167) - Update wearable
This commit is contained in:
parent
5aa68cc6d1
commit
72ee3bcd38
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -7,3 +7,6 @@
|
||||
[submodule "extern/Wearable"]
|
||||
path = extern/Wearable
|
||||
url = https://github.com/microg/android_external_Wearable.git
|
||||
[submodule "extern/GmsLib"]
|
||||
path = extern/GmsLib
|
||||
url = https://github.com/microg/android_external_GmsLib.git
|
||||
|
7
build.gradle
Normal file
7
build.gradle
Normal file
@ -0,0 +1,7 @@
|
||||
subprojects {
|
||||
group = 'org.microg'
|
||||
repositories {
|
||||
jcenter()
|
||||
}
|
||||
}
|
||||
|
2
extern/GmsApi
vendored
2
extern/GmsApi
vendored
@ -1 +1 @@
|
||||
Subproject commit 3d8fee7fabcd9e7c5c46f3f1f44da6cf4db89a70
|
||||
Subproject commit b9cb95d39bdb4bbac6dd0d2b0405e4d5a23717c2
|
1
extern/GmsLib
vendored
Submodule
1
extern/GmsLib
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 310127db7905a15af2589a161169292275ead064
|
1
play-services-base
Symbolic link
1
play-services-base
Symbolic link
@ -0,0 +1 @@
|
||||
extern/GmsLib/play-services-base
|
1
play-services-basement
Symbolic link
1
play-services-basement
Symbolic link
@ -0,0 +1 @@
|
||||
extern/GmsApi/play-services-basement
|
@ -1 +0,0 @@
|
||||
extern/GmsApi/play-services-common-api/
|
@ -38,6 +38,7 @@ dependencies {
|
||||
|
||||
compile project(":microg-ui-tools")
|
||||
compile project(':play-services-api')
|
||||
compile project(':play-services-wearable')
|
||||
compile project(':unifiednlp-base')
|
||||
compile project(':wearable-lib')
|
||||
|
||||
@ -80,8 +81,7 @@ android {
|
||||
versionName getMyVersionName()
|
||||
def x = getMyVersionCode()
|
||||
// We are not allowed to freely choose the hundreds column as it defines the device type
|
||||
// Update commit id to current when increasing gms version code
|
||||
versionCode(9256200 + x % 100 + ((int) (x / 100)) * 1000)
|
||||
versionCode(9450200 + x % 100 + ((int) (x / 100)) * 1000)
|
||||
|
||||
ndk {
|
||||
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86"
|
||||
|
@ -130,10 +130,10 @@
|
||||
</service>
|
||||
|
||||
<service
|
||||
android:name="org.microg.gms.wearable.WearableLocationService"
|
||||
android:exported="false">
|
||||
android:name="org.microg.gms.wearable.location.WearableLocationService">
|
||||
<intent-filter>
|
||||
<action android:name="com.google.android.gms.wearable.MESSAGE_RECEIVED"/>
|
||||
<data android:scheme="wear" android:host="*" android:pathPrefix="/com/google/android/location/fused/wearable" />
|
||||
</intent-filter>
|
||||
</service>
|
||||
|
||||
|
@ -66,6 +66,7 @@ public class RemoteListenerProxy<T extends IInterface> implements ServiceConnect
|
||||
if (!connecting) Log.d(TAG, "Could not connect to: " + intent);
|
||||
return connecting;
|
||||
}
|
||||
Log.d(TAG, "Unable to resolve: " + searchIntent);
|
||||
return false;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, e);
|
||||
@ -95,6 +96,8 @@ public class RemoteListenerProxy<T extends IInterface> implements ServiceConnect
|
||||
}
|
||||
waiting.clear();
|
||||
context.unbindService(RemoteListenerProxy.this);
|
||||
connecting = false;
|
||||
remote = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -75,17 +75,20 @@ public class NodeDatabaseHelper extends SQLiteOpenHelper {
|
||||
if (path == null) {
|
||||
params = new String[]{packageName, signatureDigest};
|
||||
selection = "packageName = ? AND signatureDigest = ?";
|
||||
} else if (host == null) {
|
||||
} else if (TextUtils.isEmpty(host)) {
|
||||
if (path.endsWith("/")) path = path + "%";
|
||||
path = path.replace("*", "%");
|
||||
params = new String[]{packageName, signatureDigest, path};
|
||||
selection = "packageName = ? AND signatureDigest = ? AND path LIKE ?";
|
||||
} else {
|
||||
if (path.endsWith("/")) path = path + "%";
|
||||
path = path.replace("*", "%");
|
||||
host = host.replace("*", "%");
|
||||
params = new String[]{packageName, signatureDigest, host, path};
|
||||
selection = "packageName = ? AND signatureDigest = ? AND host = ? AND path LIKE ?";
|
||||
}
|
||||
selection += " AND deleted=0 AND assetsPresent !=0";
|
||||
return getReadableDatabase().rawQuery("SELECT host AS host,path AS path,data AS data,\'\' AS tags,assetname AS asset_key,assets_digest AS asset_id FROM dataItemsAndAssets WHERE " + selection, params);
|
||||
return getReadableDatabase().rawQuery("SELECT null AS host,printf(\"wear://%s%s\",host,path) AS path,data AS data,\'\' AS tags,assetname AS asset_key,assets_digest AS asset_id FROM dataItemsAndAssets WHERE " + selection, params);
|
||||
}
|
||||
|
||||
public synchronized Cursor getDataItemsByHostAndPath(String packageName, String signatureDigest, String host, String path) {
|
||||
|
@ -417,9 +417,7 @@ public class WearableImpl {
|
||||
}
|
||||
|
||||
public DataItemRecord putData(PutDataRequest request, String packageName) {
|
||||
String host = request.getUri().getHost();
|
||||
if (TextUtils.isEmpty(host)) host = getLocalNodeId();
|
||||
DataItemInternal dataItem = new DataItemInternal(host, request.getUri().getPath());
|
||||
DataItemInternal dataItem = new DataItemInternal(fixHost(request.getUri().getHost(), true), request.getUri().getPath());
|
||||
for (Map.Entry<String, Asset> assetEntry : request.getAssets().entrySet()) {
|
||||
Asset asset = prepareAsset(packageName, assetEntry.getValue());
|
||||
if (asset != null) {
|
||||
@ -443,6 +441,13 @@ public class WearableImpl {
|
||||
return DataHolder.fromCursor(dataHolderItems, 0, null);
|
||||
}
|
||||
|
||||
private String fixHost(String host, boolean nothingToLocal) {
|
||||
if (TextUtils.isEmpty(host) && nothingToLocal) return getLocalNodeId();
|
||||
if (TextUtils.isEmpty(host)) return null;
|
||||
if (host.equals("local")) return getLocalNodeId();
|
||||
return host;
|
||||
}
|
||||
|
||||
public DataHolder getDataItemsByUriAsHolder(Uri uri, String packageName) {
|
||||
String firstSignature;
|
||||
try {
|
||||
@ -450,23 +455,22 @@ public class WearableImpl {
|
||||
} catch (Exception e) {
|
||||
return null;
|
||||
}
|
||||
Cursor dataHolderItems = nodeDatabase.getDataItemsForDataHolderByHostAndPath(packageName, firstSignature, uri.getHost(), uri.getPath());
|
||||
Cursor dataHolderItems = nodeDatabase.getDataItemsForDataHolderByHostAndPath(packageName, firstSignature, fixHost(uri.getHost(), false), uri.getPath());
|
||||
int j = 0;
|
||||
while (dataHolderItems.moveToNext()) {
|
||||
Log.d(TAG, "getDataItems[]: path=" + Uri.parse(dataHolderItems.getString(1)).getPath());
|
||||
for (int i = 0; i < dataHolderItems.getColumnCount(); i++) {
|
||||
if (dataHolderItems.getType(i) == Cursor.FIELD_TYPE_STRING) {
|
||||
Log.d(TAG, "getDataItems[" + j + "]: " + dataHolderItems.getColumnName(i) + "=" + dataHolderItems.getString(i));
|
||||
}
|
||||
if (dataHolderItems.getType(i) == Cursor.FIELD_TYPE_INTEGER)
|
||||
Log.d(TAG, "getDataItems[" + j + "]: " + dataHolderItems.getColumnName(i) + "=" + dataHolderItems.getLong(i));
|
||||
}
|
||||
}
|
||||
dataHolderItems.moveToFirst();
|
||||
dataHolderItems.moveToPrevious();
|
||||
return new DataHolder(dataHolderItems, 0, null);
|
||||
}
|
||||
|
||||
public DataHolder getDataItemForRecordAsHolder(DataItemRecord record) {
|
||||
Cursor dataHolderItems = nodeDatabase.getDataItemsForDataHolderByHostAndPath(record.packageName, record.signatureDigest, record.dataItem.uri.getHost(), record.dataItem.uri.getPath());
|
||||
while (dataHolderItems.moveToNext()) {
|
||||
Log.d(TAG, "getDataItems[]: path=" + Uri.parse(dataHolderItems.getString(1)).getPath());
|
||||
}
|
||||
dataHolderItems.moveToFirst();
|
||||
dataHolderItems.moveToPrevious();
|
||||
return new DataHolder(dataHolderItems, 0, null);
|
||||
DataHolder dataHolder = new DataHolder(dataHolderItems, 0, null);
|
||||
Log.d(TAG, "Returning data holder of size " + dataHolder.getCount() + " for query " + uri);
|
||||
return dataHolder;
|
||||
}
|
||||
|
||||
public synchronized void addListener(String packageName, IWearableListener listener) {
|
||||
@ -515,7 +519,7 @@ public class WearableImpl {
|
||||
}
|
||||
|
||||
public int deleteDataItems(Uri uri, String packageName) {
|
||||
List<DataItemRecord> records = nodeDatabase.deleteDataItems(packageName, PackageUtils.firstSignatureDigest(context, packageName), uri.getHost(), uri.getPath());
|
||||
List<DataItemRecord> records = nodeDatabase.deleteDataItems(packageName, PackageUtils.firstSignatureDigest(context, packageName), fixHost(uri.getHost(), false), uri.getPath());
|
||||
for (DataItemRecord record : records) {
|
||||
syncRecordToAll(record);
|
||||
}
|
||||
@ -533,7 +537,7 @@ public class WearableImpl {
|
||||
}
|
||||
|
||||
public DataItemRecord getDataItemByUri(Uri uri, String packageName) {
|
||||
Cursor cursor = nodeDatabase.getDataItemsByHostAndPath(packageName, PackageUtils.firstSignatureDigest(context, packageName), uri.getHost(), uri.getPath());
|
||||
Cursor cursor = nodeDatabase.getDataItemsByHostAndPath(packageName, PackageUtils.firstSignatureDigest(context, packageName), fixHost(uri.getHost(), true), uri.getPath());
|
||||
DataItemRecord record = null;
|
||||
if (cursor != null) {
|
||||
if (cursor.moveToNext()) {
|
||||
|
@ -1,55 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013-2016 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.app.Service;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
import android.support.annotation.Nullable;
|
||||
|
||||
import com.google.android.gms.location.internal.LocationRequestInternal;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class WearableLocationService extends Service {
|
||||
// TODO: Implement and use WearableListenerService
|
||||
private static final String TAG = "GmsWearLocSvc";
|
||||
|
||||
private WearableLocationListener listener;
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
listener = new WearableLocationListener(this);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
if (intent.getAction().equals("com.google.android.gms.wearable.BIND_LISTENER")) {
|
||||
return listener.asBinder();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void onLocationRequests(String nodeId, Collection<LocationRequestInternal> requests, boolean triggerUpdate) {
|
||||
|
||||
}
|
||||
|
||||
public void onCapabilityQuery(String nodeId) {
|
||||
|
||||
}
|
||||
}
|
@ -21,6 +21,7 @@ import android.net.Uri;
|
||||
import android.os.Parcel;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Base64;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.gms.common.api.Status;
|
||||
@ -154,11 +155,11 @@ public class WearableServiceImpl extends IWearableService.Stub {
|
||||
|
||||
@Override
|
||||
public void sendMessage(IWearableCallbacks callbacks, String targetNodeId, String path, byte[] data) throws RemoteException {
|
||||
Log.d(TAG, "sendMessage: " + targetNodeId + " / " + path);
|
||||
Log.d(TAG, "sendMessage: " + targetNodeId + " / " + path + ": " + (data == null ? null : Base64.encodeToString(data, Base64.NO_WRAP)));
|
||||
SendMessageResponse sendMessageResponse = new SendMessageResponse();
|
||||
try {
|
||||
sendMessageResponse.resultId = wearable.sendMessage(packageName, targetNodeId, path, data);
|
||||
if (sendMessageResponse.resultId == -1) {
|
||||
sendMessageResponse.requestId = wearable.sendMessage(packageName, targetNodeId, path, data);
|
||||
if (sendMessageResponse.requestId == -1) {
|
||||
sendMessageResponse.statusCode = 4000;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
@ -262,8 +263,8 @@ public class WearableServiceImpl extends IWearableService.Stub {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getStrorageInformation(IWearableCallbacks callbacks) throws RemoteException {
|
||||
Log.d(TAG, "unimplemented Method: getStrorageInformation");
|
||||
public void getStorageInformation(IWearableCallbacks callbacks) throws RemoteException {
|
||||
Log.d(TAG, "unimplemented Method: getStorageInformation");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -14,86 +14,83 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.microg.gms.wearable;
|
||||
package org.microg.gms.wearable.location;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
|
||||
import com.google.android.gms.common.data.DataHolder;
|
||||
import com.google.android.gms.common.api.GoogleApiClient;
|
||||
import com.google.android.gms.location.LocationRequest;
|
||||
import com.google.android.gms.location.internal.ClientIdentity;
|
||||
import com.google.android.gms.location.internal.LocationRequestInternal;
|
||||
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.IWearableListener;
|
||||
import com.google.android.gms.wearable.internal.MessageEventParcelable;
|
||||
import com.google.android.gms.wearable.internal.NodeParcelable;
|
||||
import com.google.android.gms.wearable.DataMap;
|
||||
import com.google.android.gms.wearable.MessageEvent;
|
||||
import com.google.android.gms.wearable.Node;
|
||||
import com.google.android.gms.wearable.Wearable;
|
||||
import com.google.android.gms.wearable.WearableListenerService;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class WearableLocationListener extends IWearableListener.Stub {
|
||||
public static final String LOCATION_REQUESTS = "com/google/android/location/fused/wearable/LOCATION_REQUESTS";
|
||||
public static final String CAPABILITY_QUERY = "com/google/android/location/fused/wearable/CAPABILITY_QUERY";
|
||||
public class WearableLocationService extends WearableListenerService {
|
||||
private static final String TAG = "GmsWearLocSvc";
|
||||
|
||||
private static final String TAG = "GmsWearLocListener";
|
||||
public static final String PATH_LOCATION_REQUESTS = "com/google/android/location/fused/wearable/LOCATION_REQUESTS";
|
||||
public static final String PATH_CAPABILITY_QUERY = "com/google/android/location/fused/wearable/CAPABILITY_QUERY";
|
||||
public static final String PATH_CAPABILITY = "com/google/android/location/fused/wearable/CAPABILITY";
|
||||
|
||||
private WearableLocationService locationService;
|
||||
|
||||
public WearableLocationListener(WearableLocationService locationService) {
|
||||
this.locationService = locationService;
|
||||
}
|
||||
private GoogleApiClient apiClient;
|
||||
private Map<String, Collection<LocationRequestInternal>> requestMap = new HashMap<String, Collection<LocationRequestInternal>>();
|
||||
|
||||
@Override
|
||||
public void onDataChanged(DataHolder data) throws RemoteException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessageReceived(MessageEventParcelable messageEvent) throws RemoteException {
|
||||
if (messageEvent.getPath().equals(LOCATION_REQUESTS)) {
|
||||
//DataMap dataMap = DataMap.fromByteArray(messageEvent.getData());
|
||||
//locationService.onLocationRequests(messageEvent.getSourceNodeId(), parseLocationRequestList(dataMap, locationService), dataMap.getBoolean("TRIGGER_UPDATE", false));
|
||||
} else if (messageEvent.getPath().equals(CAPABILITY_QUERY)) {
|
||||
locationService.onCapabilityQuery(messageEvent.getSourceNodeId());
|
||||
public void onMessageReceived(MessageEvent messageEvent) {
|
||||
if (messageEvent.getPath().equals(PATH_LOCATION_REQUESTS)) {
|
||||
DataMap dataMap = DataMap.fromByteArray(messageEvent.getData());
|
||||
onLocationRequests(messageEvent.getSourceNodeId(), readLocationRequestList(dataMap, this), dataMap.getBoolean("TRIGGER_UPDATE", false));
|
||||
} else if (messageEvent.getPath().equals(PATH_CAPABILITY_QUERY)) {
|
||||
onCapabilityQuery(messageEvent.getSourceNodeId());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPeerConnected(NodeParcelable node) throws RemoteException {
|
||||
public void onPeerDisconnected(Node peer) {
|
||||
onLocationRequests(peer.getId(), null, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPeerDisconnected(NodeParcelable node) throws RemoteException {
|
||||
locationService.onLocationRequests(node.getId(), Collections.<LocationRequestInternal>emptyList(), false);
|
||||
public void onLocationRequests(String nodeId, Collection<LocationRequestInternal> requests, boolean triggerUpdate) {
|
||||
if (requests == null || requests.isEmpty()) {
|
||||
requestMap.remove(nodeId);
|
||||
} else {
|
||||
requestMap.put(nodeId, requests);
|
||||
}
|
||||
Log.d(TAG, "Requests: "+requestMap.entrySet());
|
||||
// TODO actually request
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectedNodes(List<NodeParcelable> nodes) throws RemoteException {
|
||||
public void onCapabilityQuery(String nodeId) {
|
||||
Wearable.MessageApi.sendMessage(getApiClient(), nodeId, PATH_CAPABILITY, writeLocationCapability(new DataMap(), true).toByteArray());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNotificationReceived(AncsNotificationParcelable notification) throws RemoteException {
|
||||
private GoogleApiClient getApiClient() {
|
||||
if (apiClient == null) {
|
||||
apiClient = new GoogleApiClient.Builder(this).addApi(Wearable.API).build();
|
||||
}
|
||||
if (!apiClient.isConnected()) {
|
||||
apiClient.connect();
|
||||
}
|
||||
return apiClient;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChannelEvent(ChannelEventParcelable channelEvent) throws RemoteException {
|
||||
public static DataMap writeLocationCapability(DataMap dataMap, boolean locationCapable) {
|
||||
dataMap.putBoolean("CAPABILITY_LOCATION", locationCapable);
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConnectedCapabilityChanged(CapabilityInfoParcelable capabilityInfo) throws RemoteException {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityUpdate(AmsEntityUpdateParcelable update) throws RemoteException {
|
||||
}
|
||||
|
||||
/*public static Collection<LocationRequestInternal> parseLocationRequestList(DataMap dataMap, Context context) {
|
||||
public static Collection<LocationRequestInternal> readLocationRequestList(DataMap dataMap, Context context) {
|
||||
if (!dataMap.containsKey("REQUEST_LIST")) {
|
||||
Log.w(TAG, "malformed DataMap: missing key REQUEST_LIST");
|
||||
return Collections.emptyList();
|
||||
@ -101,12 +98,12 @@ public class WearableLocationListener extends IWearableListener.Stub {
|
||||
List<DataMap> requestMapList = dataMap.getDataMapArrayList("REQUEST_LIST");
|
||||
List<LocationRequestInternal> locationRequests = new ArrayList<LocationRequestInternal>();
|
||||
for (DataMap map : requestMapList) {
|
||||
locationRequests.add(parseLocationRequest(map, context));
|
||||
locationRequests.add(readLocationRequest(map, context));
|
||||
}
|
||||
return locationRequests;
|
||||
}
|
||||
|
||||
private static LocationRequestInternal parseLocationRequest(DataMap dataMap, Context context) {
|
||||
private static LocationRequestInternal readLocationRequest(DataMap dataMap, Context context) {
|
||||
LocationRequestInternal request = new LocationRequestInternal();
|
||||
request.triggerUpdate = true;
|
||||
request.request = new LocationRequest();
|
||||
@ -142,11 +139,11 @@ public class WearableLocationListener extends IWearableListener.Stub {
|
||||
|
||||
private static ClientIdentity generateClientIdentity(String packageName, Context context) {
|
||||
return null;
|
||||
try {
|
||||
/*try {
|
||||
return new ClientIdentity(context.getPackageManager().getApplicationInfo(packageName, 0).uid, packageName);
|
||||
} catch (PackageManager.NameNotFoundException e) {
|
||||
Log.w(TAG, "Unknown client identity: " + packageName, e);
|
||||
return new ClientIdentity(context.getApplicationInfo().uid, context.getPackageName());
|
||||
}
|
||||
}*/
|
||||
}*/
|
||||
}
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/databundle.proto
|
||||
package org.microg.gms.wearable.databundle;
|
||||
|
||||
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 DataBundle extends Message {
|
||||
|
||||
public static final List<DataBundleEntry> DEFAULT_ENTRIES = Collections.emptyList();
|
||||
|
||||
@ProtoField(tag = 1, label = REPEATED, messageType = DataBundleEntry.class)
|
||||
public final List<DataBundleEntry> entries;
|
||||
|
||||
public DataBundle(List<DataBundleEntry> entries) {
|
||||
this.entries = immutableCopyOf(entries);
|
||||
}
|
||||
|
||||
private DataBundle(Builder builder) {
|
||||
this(builder.entries);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof DataBundle)) return false;
|
||||
return equals(entries, ((DataBundle) other).entries);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
return result != 0 ? result : (hashCode = entries != null ? entries.hashCode() : 1);
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<DataBundle> {
|
||||
|
||||
public List<DataBundleEntry> entries;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(DataBundle message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.entries = copyOf(message.entries);
|
||||
}
|
||||
|
||||
public Builder entries(List<DataBundleEntry> entries) {
|
||||
this.entries = checkForNulls(entries);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataBundle build() {
|
||||
return new DataBundle(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/databundle.proto
|
||||
package org.microg.gms.wearable.databundle;
|
||||
|
||||
import com.squareup.wire.Message;
|
||||
import com.squareup.wire.ProtoField;
|
||||
|
||||
import static com.squareup.wire.Message.Datatype.STRING;
|
||||
|
||||
public final class DataBundleEntry extends Message {
|
||||
|
||||
public static final String DEFAULT_KEY = "";
|
||||
|
||||
@ProtoField(tag = 1, type = STRING)
|
||||
public final String key;
|
||||
|
||||
@ProtoField(tag = 2)
|
||||
public final DataBundleTypedValue typedValue;
|
||||
|
||||
public DataBundleEntry(String key, DataBundleTypedValue typedValue) {
|
||||
this.key = key;
|
||||
this.typedValue = typedValue;
|
||||
}
|
||||
|
||||
private DataBundleEntry(Builder builder) {
|
||||
this(builder.key, builder.typedValue);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof DataBundleEntry)) return false;
|
||||
DataBundleEntry o = (DataBundleEntry) other;
|
||||
return equals(key, o.key)
|
||||
&& equals(typedValue, o.typedValue);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = key != null ? key.hashCode() : 0;
|
||||
result = result * 37 + (typedValue != null ? typedValue.hashCode() : 0);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<DataBundleEntry> {
|
||||
|
||||
public String key;
|
||||
public DataBundleTypedValue typedValue;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(DataBundleEntry message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.key = message.key;
|
||||
this.typedValue = message.typedValue;
|
||||
}
|
||||
|
||||
public Builder key(String key) {
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder typedValue(DataBundleTypedValue typedValue) {
|
||||
this.typedValue = typedValue;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataBundleEntry build() {
|
||||
return new DataBundleEntry(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,80 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/databundle.proto
|
||||
package org.microg.gms.wearable.databundle;
|
||||
|
||||
import com.squareup.wire.Message;
|
||||
import com.squareup.wire.ProtoField;
|
||||
|
||||
import static com.squareup.wire.Message.Datatype.INT32;
|
||||
|
||||
public final class DataBundleTypedValue extends Message {
|
||||
|
||||
public static final Integer DEFAULT_TYPE = 0;
|
||||
|
||||
@ProtoField(tag = 1, type = INT32)
|
||||
public final Integer type;
|
||||
|
||||
@ProtoField(tag = 2)
|
||||
public final DataBundleValue value;
|
||||
|
||||
public DataBundleTypedValue(Integer type, DataBundleValue value) {
|
||||
this.type = type;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
private DataBundleTypedValue(Builder builder) {
|
||||
this(builder.type, builder.value);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof DataBundleTypedValue)) return false;
|
||||
DataBundleTypedValue o = (DataBundleTypedValue) other;
|
||||
return equals(type, o.type)
|
||||
&& equals(value, o.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = type != null ? type.hashCode() : 0;
|
||||
result = result * 37 + (value != null ? value.hashCode() : 0);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<DataBundleTypedValue> {
|
||||
|
||||
public Integer type;
|
||||
public DataBundleValue value;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(DataBundleTypedValue message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.type = message.type;
|
||||
this.value = message.value;
|
||||
}
|
||||
|
||||
public Builder type(Integer type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder value(DataBundleValue value) {
|
||||
this.value = value;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataBundleTypedValue build() {
|
||||
return new DataBundleTypedValue(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,259 +0,0 @@
|
||||
// Code generated by Wire protocol buffer compiler, do not edit.
|
||||
// Source file: protos-repo/databundle.proto
|
||||
package org.microg.gms.wearable.databundle;
|
||||
|
||||
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.DOUBLE;
|
||||
import static com.squareup.wire.Message.Datatype.FLOAT;
|
||||
import static com.squareup.wire.Message.Datatype.INT32;
|
||||
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 DataBundleValue extends Message {
|
||||
|
||||
public static final ByteString DEFAULT_BYTEARRAY = ByteString.EMPTY;
|
||||
public static final String DEFAULT_STRINGVAL = "";
|
||||
public static final Double DEFAULT_DOUBLEVAL = 0D;
|
||||
public static final Float DEFAULT_FLOATVAL = 0F;
|
||||
public static final Long DEFAULT_LONGVAL = 0L;
|
||||
public static final Integer DEFAULT_INTVAL = 0;
|
||||
public static final Integer DEFAULT_BYTEVAL = 0;
|
||||
public static final Boolean DEFAULT_BOOLEANVAL = false;
|
||||
public static final List<DataBundleEntry> DEFAULT_MAP = Collections.emptyList();
|
||||
public static final List<DataBundleTypedValue> DEFAULT_LIST = Collections.emptyList();
|
||||
public static final List<String> DEFAULT_STRINGARRAY = Collections.emptyList();
|
||||
public static final List<Long> DEFAULT_LONGARRAY = Collections.emptyList();
|
||||
public static final Integer DEFAULT_LENGTH = 0;
|
||||
public static final List<Float> DEFAULT_FLOATARRAY = Collections.emptyList();
|
||||
|
||||
@ProtoField(tag = 1, type = BYTES)
|
||||
public final ByteString byteArray;
|
||||
|
||||
@ProtoField(tag = 2, type = STRING)
|
||||
public final String stringVal;
|
||||
|
||||
@ProtoField(tag = 3, type = DOUBLE)
|
||||
public final Double doubleVal;
|
||||
|
||||
@ProtoField(tag = 4, type = FLOAT)
|
||||
public final Float floatVal;
|
||||
|
||||
@ProtoField(tag = 5, type = INT64)
|
||||
public final Long longVal;
|
||||
|
||||
@ProtoField(tag = 6, type = INT32)
|
||||
public final Integer intVal;
|
||||
|
||||
@ProtoField(tag = 7, type = INT32)
|
||||
public final Integer byteVal;
|
||||
|
||||
@ProtoField(tag = 8, type = BOOL)
|
||||
public final Boolean booleanVal;
|
||||
|
||||
@ProtoField(tag = 9, label = REPEATED, messageType = DataBundleEntry.class)
|
||||
public final List<DataBundleEntry> map;
|
||||
|
||||
@ProtoField(tag = 10, label = REPEATED, messageType = DataBundleTypedValue.class)
|
||||
public final List<DataBundleTypedValue> list;
|
||||
|
||||
@ProtoField(tag = 11, type = STRING, label = REPEATED)
|
||||
public final List<String> stringArray;
|
||||
|
||||
@ProtoField(tag = 12, type = INT64, label = REPEATED)
|
||||
public final List<Long> longArray;
|
||||
|
||||
@ProtoField(tag = 13, type = INT32)
|
||||
public final Integer length;
|
||||
|
||||
@ProtoField(tag = 14, type = FLOAT, label = REPEATED)
|
||||
public final List<Float> floatArray;
|
||||
|
||||
public DataBundleValue(ByteString byteArray, String stringVal, Double doubleVal, Float floatVal, Long longVal, Integer intVal, Integer byteVal, Boolean booleanVal, List<DataBundleEntry> map, List<DataBundleTypedValue> list, List<String> stringArray, List<Long> longArray, Integer length, List<Float> floatArray) {
|
||||
this.byteArray = byteArray;
|
||||
this.stringVal = stringVal;
|
||||
this.doubleVal = doubleVal;
|
||||
this.floatVal = floatVal;
|
||||
this.longVal = longVal;
|
||||
this.intVal = intVal;
|
||||
this.byteVal = byteVal;
|
||||
this.booleanVal = booleanVal;
|
||||
this.map = immutableCopyOf(map);
|
||||
this.list = immutableCopyOf(list);
|
||||
this.stringArray = immutableCopyOf(stringArray);
|
||||
this.longArray = immutableCopyOf(longArray);
|
||||
this.length = length;
|
||||
this.floatArray = immutableCopyOf(floatArray);
|
||||
}
|
||||
|
||||
private DataBundleValue(Builder builder) {
|
||||
this(builder.byteArray, builder.stringVal, builder.doubleVal, builder.floatVal, builder.longVal, builder.intVal, builder.byteVal, builder.booleanVal, builder.map, builder.list, builder.stringArray, builder.longArray, builder.length, builder.floatArray);
|
||||
setBuilder(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == this) return true;
|
||||
if (!(other instanceof DataBundleValue)) return false;
|
||||
DataBundleValue o = (DataBundleValue) other;
|
||||
return equals(byteArray, o.byteArray)
|
||||
&& equals(stringVal, o.stringVal)
|
||||
&& equals(doubleVal, o.doubleVal)
|
||||
&& equals(floatVal, o.floatVal)
|
||||
&& equals(longVal, o.longVal)
|
||||
&& equals(intVal, o.intVal)
|
||||
&& equals(byteVal, o.byteVal)
|
||||
&& equals(booleanVal, o.booleanVal)
|
||||
&& equals(map, o.map)
|
||||
&& equals(list, o.list)
|
||||
&& equals(stringArray, o.stringArray)
|
||||
&& equals(longArray, o.longArray)
|
||||
&& equals(length, o.length)
|
||||
&& equals(floatArray, o.floatArray);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = hashCode;
|
||||
if (result == 0) {
|
||||
result = byteArray != null ? byteArray.hashCode() : 0;
|
||||
result = result * 37 + (stringVal != null ? stringVal.hashCode() : 0);
|
||||
result = result * 37 + (doubleVal != null ? doubleVal.hashCode() : 0);
|
||||
result = result * 37 + (floatVal != null ? floatVal.hashCode() : 0);
|
||||
result = result * 37 + (longVal != null ? longVal.hashCode() : 0);
|
||||
result = result * 37 + (intVal != null ? intVal.hashCode() : 0);
|
||||
result = result * 37 + (byteVal != null ? byteVal.hashCode() : 0);
|
||||
result = result * 37 + (booleanVal != null ? booleanVal.hashCode() : 0);
|
||||
result = result * 37 + (map != null ? map.hashCode() : 1);
|
||||
result = result * 37 + (list != null ? list.hashCode() : 1);
|
||||
result = result * 37 + (stringArray != null ? stringArray.hashCode() : 1);
|
||||
result = result * 37 + (longArray != null ? longArray.hashCode() : 1);
|
||||
result = result * 37 + (length != null ? length.hashCode() : 0);
|
||||
result = result * 37 + (floatArray != null ? floatArray.hashCode() : 1);
|
||||
hashCode = result;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static final class Builder extends Message.Builder<DataBundleValue> {
|
||||
|
||||
public ByteString byteArray;
|
||||
public String stringVal;
|
||||
public Double doubleVal;
|
||||
public Float floatVal;
|
||||
public Long longVal;
|
||||
public Integer intVal;
|
||||
public Integer byteVal;
|
||||
public Boolean booleanVal;
|
||||
public List<DataBundleEntry> map;
|
||||
public List<DataBundleTypedValue> list;
|
||||
public List<String> stringArray;
|
||||
public List<Long> longArray;
|
||||
public Integer length;
|
||||
public List<Float> floatArray;
|
||||
|
||||
public Builder() {
|
||||
}
|
||||
|
||||
public Builder(DataBundleValue message) {
|
||||
super(message);
|
||||
if (message == null) return;
|
||||
this.byteArray = message.byteArray;
|
||||
this.stringVal = message.stringVal;
|
||||
this.doubleVal = message.doubleVal;
|
||||
this.floatVal = message.floatVal;
|
||||
this.longVal = message.longVal;
|
||||
this.intVal = message.intVal;
|
||||
this.byteVal = message.byteVal;
|
||||
this.booleanVal = message.booleanVal;
|
||||
this.map = copyOf(message.map);
|
||||
this.list = copyOf(message.list);
|
||||
this.stringArray = copyOf(message.stringArray);
|
||||
this.longArray = copyOf(message.longArray);
|
||||
this.length = message.length;
|
||||
this.floatArray = copyOf(message.floatArray);
|
||||
}
|
||||
|
||||
public Builder byteArray(ByteString byteArray) {
|
||||
this.byteArray = byteArray;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder stringVal(String stringVal) {
|
||||
this.stringVal = stringVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder doubleVal(Double doubleVal) {
|
||||
this.doubleVal = doubleVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder floatVal(Float floatVal) {
|
||||
this.floatVal = floatVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder longVal(Long longVal) {
|
||||
this.longVal = longVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder intVal(Integer intVal) {
|
||||
this.intVal = intVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder byteVal(Integer byteVal) {
|
||||
this.byteVal = byteVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder booleanVal(Boolean booleanVal) {
|
||||
this.booleanVal = booleanVal;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder map(List<DataBundleEntry> map) {
|
||||
this.map = checkForNulls(map);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder list(List<DataBundleTypedValue> list) {
|
||||
this.list = checkForNulls(list);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder stringArray(List<String> stringArray) {
|
||||
this.stringArray = checkForNulls(stringArray);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder longArray(List<Long> longArray) {
|
||||
this.longArray = checkForNulls(longArray);
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder length(Integer length) {
|
||||
this.length = length;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder floatArray(List<Float> floatArray) {
|
||||
this.floatArray = checkForNulls(floatArray);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DataBundleValue build() {
|
||||
return new DataBundleValue(this);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,33 +0,0 @@
|
||||
option java_package = "org.microg.gms.wearable.databundle";
|
||||
option java_outer_classname = "DataBundleProto";
|
||||
|
||||
message DataBundle {
|
||||
repeated DataBundleEntry entries = 1;
|
||||
}
|
||||
|
||||
message DataBundleEntry {
|
||||
optional string key = 1;
|
||||
optional DataBundleTypedValue typedValue = 2;
|
||||
}
|
||||
|
||||
message DataBundleTypedValue {
|
||||
optional int32 type = 1;
|
||||
optional DataBundleValue value = 2;
|
||||
}
|
||||
|
||||
message DataBundleValue {
|
||||
optional bytes byteArray = 1;
|
||||
optional string stringVal = 2;
|
||||
optional double doubleVal = 3;
|
||||
optional float floatVal = 4;
|
||||
optional int64 longVal = 5;
|
||||
optional int32 intVal = 6;
|
||||
optional int32 byteVal = 7;
|
||||
optional bool booleanVal = 8;
|
||||
repeated DataBundleEntry map = 9;
|
||||
repeated DataBundleTypedValue list = 10;
|
||||
repeated string stringArray = 11;
|
||||
repeated int64 longArray = 12;
|
||||
optional int32 length = 13;
|
||||
repeated float floatArray = 14;
|
||||
}
|
1
play-services-iid-api
Symbolic link
1
play-services-iid-api
Symbolic link
@ -0,0 +1 @@
|
||||
extern/GmsApi/play-services-iid-api
|
1
play-services-tasks
Symbolic link
1
play-services-tasks
Symbolic link
@ -0,0 +1 @@
|
||||
extern/GmsLib/play-services-tasks
|
1
play-services-wearable
Symbolic link
1
play-services-wearable
Symbolic link
@ -0,0 +1 @@
|
||||
extern/GmsLib/play-services-wearable
|
@ -6,12 +6,18 @@ include ':unifiednlp-api'
|
||||
include ':unifiednlp-base'
|
||||
include ':unifiednlp-compat'
|
||||
|
||||
include ':play-services-basement'
|
||||
|
||||
include ':play-services-api'
|
||||
include ':play-services-cast-api'
|
||||
include ':play-services-common-api'
|
||||
include ':play-services-iid-api'
|
||||
include ':play-services-location-api'
|
||||
include ':play-services-wearable-api'
|
||||
|
||||
include ':play-services-base'
|
||||
include ':play-services-tasks'
|
||||
include ':play-services-wearable'
|
||||
|
||||
include ':play-services-core'
|
||||
|
||||
include ':microg-ui-tools'
|
||||
|
Loading…
Reference in New Issue
Block a user