mirror of
https://github.com/TeamVanced/VancedMicroG
synced 2025-01-11 11:55:48 +01:00
Update wearable APIs
This commit is contained in:
parent
cf2927f275
commit
417ec2585f
@ -0,0 +1,3 @@
|
||||
package com.google.android.gms.wearable;
|
||||
|
||||
parcelable Asset;
|
@ -0,0 +1,3 @@
|
||||
package com.google.android.gms.wearable.internal;
|
||||
|
||||
parcelable GetCloudSyncSettingResponse;
|
@ -0,0 +1,4 @@
|
||||
package com.google.android.gms.wearable.internal;
|
||||
|
||||
interface IChannelStreamCallbacks {
|
||||
}
|
@ -3,6 +3,7 @@ package com.google.android.gms.wearable.internal;
|
||||
import com.google.android.gms.common.api.Status;
|
||||
import com.google.android.gms.common.data.DataHolder;
|
||||
import com.google.android.gms.wearable.internal.DeleteDataItemsResponse;
|
||||
import com.google.android.gms.wearable.internal.GetCloudSyncSettingResponse;
|
||||
import com.google.android.gms.wearable.internal.GetConfigResponse;
|
||||
import com.google.android.gms.wearable.internal.GetConfigsResponse;
|
||||
import com.google.android.gms.wearable.internal.GetConnectedNodesResponse;
|
||||
@ -17,7 +18,7 @@ interface IWearableCallbacks {
|
||||
void onGetConfigResponse(in GetConfigResponse response) = 1;
|
||||
void onPutDataResponse(in PutDataResponse response) = 2;
|
||||
void onGetDataItemResponse(in GetDataItemResponse response) = 3;
|
||||
void onDataHolder(in DataHolder dataHolder) = 4;
|
||||
void onDataItemChanged(in DataHolder dataHolder) = 4;
|
||||
void onDeleteDataItemsResponse(in DeleteDataItemsResponse response) = 5;
|
||||
void onSendMessageResponse(in SendMessageResponse response) = 6;
|
||||
void onGetFdForAssetResponse(in GetFdForAssetResponse response) = 7;
|
||||
@ -26,4 +27,6 @@ interface IWearableCallbacks {
|
||||
void onStatus(in Status status) = 10;
|
||||
void onStorageInfoResponse(in StorageInfoResponse response) = 11;
|
||||
void onGetConfigsResponse(in GetConfigsResponse response) = 12;
|
||||
|
||||
void onGetCloudSyncSettingResponse(in GetCloudSyncSettingResponse response) = 28;
|
||||
}
|
||||
|
@ -1,28 +1,82 @@
|
||||
package com.google.android.gms.wearable.internal;
|
||||
|
||||
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.internal.AddListenerRequest;
|
||||
import com.google.android.gms.wearable.internal.AncsNotificationParcelable;
|
||||
import com.google.android.gms.wearable.internal.PutDataRequest;
|
||||
import com.google.android.gms.wearable.internal.RemoveListenerRequest;
|
||||
import com.google.android.gms.wearable.internal.IChannelStreamCallbacks;
|
||||
import com.google.android.gms.wearable.internal.IWearableCallbacks;
|
||||
import com.google.android.gms.wearable.internal.IWearableService;
|
||||
|
||||
interface IWearableService {
|
||||
void getConfig(IWearableCallbacks callbacks) = 2;
|
||||
void putData(IWearableCallbacks callbacks, in PutDataRequest request) = 5;
|
||||
void getDataItem(IWearableCallbacks callbacks, in Uri uri) = 6;
|
||||
void getDataItems(IWearableCallbacks callbacks) = 7;
|
||||
void sendMessage(IWearableCallbacks callbacks, String targetNodeId, String path, in byte[] data) = 11;
|
||||
void getLocalNode(IWearableCallbacks callbacks) = 13;
|
||||
void getConnectedNodes(IWearableCallbacks callbacks) = 14;
|
||||
void addListener(IWearableCallbacks callbacks, in AddListenerRequest request) = 15;
|
||||
void removeListener(IWearableCallbacks callbacks, in RemoveListenerRequest request) = 16;
|
||||
// Configs
|
||||
void putConfig(IWearableCallbacks callbacks, in ConnectionConfiguration config) = 19;
|
||||
void deleteConfig(IWearableCallbacks callbacks, String name) = 20;
|
||||
void getConfigs(IWearableCallbacks callbacks) = 21;
|
||||
void enableConnection(IWearableCallbacks callbacks, String name) = 22;
|
||||
void disableConnection(IWearableCallbacks callbacks, String name) = 23;
|
||||
void getDataItemsByUri(IWearableCallbacks callbacks, in Uri uri, int i) = 39;
|
||||
void deleteDataItems(IWearableCallbacks callbacks, in Uri uri) = 40;
|
||||
void enableConfig(IWearableCallbacks callbacks, String name) = 22;
|
||||
void disableConfig(IWearableCallbacks callbacks, String name) = 23;
|
||||
|
||||
// DataItems
|
||||
void putData(IWearableCallbacks callbacks, in PutDataRequest request) = 5;
|
||||
void getDataItem(IWearableCallbacks callbacks, in Uri uri) = 6;
|
||||
void getDataItems(IWearableCallbacks callbacks) = 7;
|
||||
void getDataItemsByUri(IWearableCallbacks callbacks, in Uri uri) = 8;
|
||||
void getDataItemsByUriWithFilter(IWearableCallbacks callbacks, in Uri uri, int typeFilter) = 39;
|
||||
void deleteDataItems(IWearableCallbacks callbacks, in Uri uri) = 10;
|
||||
void deleteDataItemsWithFilter(IWearableCallbacks callbacks, in Uri uri, int typeFilter) = 40;
|
||||
|
||||
void sendMessage(IWearableCallbacks callbacks, String targetNodeId, String path, in byte[] data) = 11;
|
||||
void getFdForAsset(IWearableCallbacks callbacks, in Asset asset) = 12;
|
||||
|
||||
void getLocalNode(IWearableCallbacks callbacks) = 13;
|
||||
void getConnectedNodes(IWearableCallbacks callbacks) = 14;
|
||||
|
||||
// Capabilties
|
||||
void getConnectedCapability(IWearableCallbacks callbacks, String s1, int i) = 41;
|
||||
void getConnectedCapaibilties(IWearableCallbacks callbacks, int i) = 42;
|
||||
void addLocalCapability(IWearableCallbacks callbacks, String cap) = 45;
|
||||
void removeLocalCapability(IWearableCallbacks callbacks, String cap) = 46;
|
||||
|
||||
void addListener(IWearableCallbacks callbacks, in AddListenerRequest request) = 15;
|
||||
void removeListener(IWearableCallbacks callbacks, in RemoveListenerRequest request) = 16;
|
||||
|
||||
void getStrorageInformation(IWearableCallbacks callbacks) = 17;
|
||||
void clearStorage(IWearableCallbacks callbacks) = 18;
|
||||
|
||||
void endCall(IWearableCallbacks callbacks) = 24;
|
||||
void acceptRingingCall(IWearableCallbacks callbacks) = 25;
|
||||
void silenceRinger(IWearableCallbacks callbacks) = 29;
|
||||
|
||||
// Apple Notification Center Service
|
||||
void injectAncsNotificationForTesting(IWearableCallbacks callbacks, in AncsNotificationParcelable notification) = 26;
|
||||
void doAncsPositiveAction(IWearableCallbacks callbacks, int i) = 27;
|
||||
void doAncsNegativeAction(IWearableCallbacks callbacks, int i) = 28;
|
||||
|
||||
// Channels
|
||||
void openChannel(IWearableCallbacks callbacks, String s1, String s2) = 30;
|
||||
void closeChannel(IWearableCallbacks callbacks, String s) = 31;
|
||||
void closeChannelWithError(IWearableCallbacks callbacks, String s, int errorCode) = 32;
|
||||
void getChannelInputStream(IWearableCallbacks callbacks, IChannelStreamCallbacks channelCallbacks, String s) = 33;
|
||||
void getChannelOutputStream(IWearableCallbacks callbacks, IChannelStreamCallbacks channelCallbacks, String s) = 34;
|
||||
void writeChannelInputToFd(IWearableCallbacks callbacks, String s, in ParcelFileDescriptor fd) = 37;
|
||||
void readChannelOutputFromFd(IWearableCallbacks callbacks, String s, in ParcelFileDescriptor fd, long l1, long l2) = 38;
|
||||
|
||||
void syncWifiCredentials(IWearableCallbacks callbacks) = 36;
|
||||
|
||||
// Cloud Sync
|
||||
void optInCloudSync(IWearableCallbacks callbacks, boolean enable) = 47;
|
||||
void getCloudSyncOptInDone(IWearableCallbacks callbacks) = 48; // deprecated
|
||||
void setCloudSyncSetting(IWearableCallbacks callbacks, boolean enable) = 49;
|
||||
void getCloudSyncSetting(IWearableCallbacks callbacks) = 50;
|
||||
void getCloudSyncOptInStatus(IWearableCallbacks callbacks) = 51;
|
||||
|
||||
void sendRemoteCommand(IWearableCallbacks callbacks, byte b) = 52;
|
||||
|
||||
// deprecated Connection
|
||||
void putConnection(IWearableCallbacks callbacks, in ConnectionConfiguration config) = 1;
|
||||
void getConnection(IWearableCallbacks callbacks) = 2;
|
||||
void enableConnection(IWearableCallbacks callbacks) = 3;
|
||||
void disableConnection(IWearableCallbacks callbacks) = 4;
|
||||
}
|
||||
|
@ -33,4 +33,9 @@ public interface Node {
|
||||
* Returns an opaque string that represents a node in the Android Wear network.
|
||||
*/
|
||||
String getId();
|
||||
|
||||
/**
|
||||
* Indicates that this node can be considered geographically nearby the local node.
|
||||
*/
|
||||
boolean isNearby();
|
||||
}
|
||||
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* 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 com.google.android.gms.wearable.internal;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
import org.microg.safeparcel.SafeParceled;
|
||||
|
||||
public class GetCloudSyncSettingResponse extends AutoSafeParcelable {
|
||||
@SafeParceled(1)
|
||||
private int versionCode = 1;
|
||||
@SafeParceled(2)
|
||||
public int statusCode;
|
||||
@SafeParceled(3)
|
||||
public boolean cloudSyncEnabled;
|
||||
|
||||
private GetCloudSyncSettingResponse() {}
|
||||
|
||||
public GetCloudSyncSettingResponse(int statusCode, boolean cloudSyncEnabled) {
|
||||
this.statusCode = statusCode;
|
||||
this.cloudSyncEnabled = cloudSyncEnabled;
|
||||
}
|
||||
|
||||
public static final Creator<GetCloudSyncSettingResponse> CREATOR = new AutoCreator<GetCloudSyncSettingResponse>(GetCloudSyncSettingResponse.class);
|
||||
}
|
@ -16,8 +16,28 @@
|
||||
|
||||
package com.google.android.gms.wearable.internal;
|
||||
|
||||
import android.os.ParcelFileDescriptor;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
import org.microg.safeparcel.SafeParceled;
|
||||
|
||||
public class GetFdForAssetResponse extends AutoSafeParcelable {
|
||||
@SafeParceled(1)
|
||||
private int versionCode = 1;
|
||||
|
||||
@SafeParceled(2)
|
||||
public int statusCode;
|
||||
|
||||
@SafeParceled(3)
|
||||
public ParcelFileDescriptor pfd;
|
||||
|
||||
private GetFdForAssetResponse() {
|
||||
}
|
||||
|
||||
public GetFdForAssetResponse(int statusCode, ParcelFileDescriptor pfd) {
|
||||
this.statusCode = statusCode;
|
||||
this.pfd = pfd;
|
||||
}
|
||||
|
||||
public static final Creator<GetFdForAssetResponse> CREATOR = new AutoCreator<GetFdForAssetResponse>(GetFdForAssetResponse.class);
|
||||
}
|
||||
|
@ -28,22 +28,33 @@ public class NodeParcelable extends AutoSafeParcelable implements Node {
|
||||
@SafeParceled(1)
|
||||
private int versionCode = 1;
|
||||
@SafeParceled(2)
|
||||
private final String id;
|
||||
private final String nodeId;
|
||||
@SafeParceled(3)
|
||||
private final String displayName;
|
||||
@SafeParceled(4)
|
||||
private final int hops;
|
||||
@SafeParceled(5)
|
||||
private final boolean isNearby;
|
||||
|
||||
private NodeParcelable() {
|
||||
id = displayName = null;
|
||||
nodeId = displayName = null;
|
||||
hops = 0;
|
||||
isNearby = false;
|
||||
}
|
||||
|
||||
public NodeParcelable(String id, String displayName) {
|
||||
this.id = id;
|
||||
public NodeParcelable(String nodeId, String displayName, int hops, boolean isNearby) {
|
||||
this.nodeId = nodeId;
|
||||
this.displayName = displayName;
|
||||
this.hops = hops;
|
||||
this.isNearby = isNearby;
|
||||
}
|
||||
|
||||
public NodeParcelable(String nodeId, String displayName) {
|
||||
this(nodeId, displayName, 0, false);
|
||||
}
|
||||
|
||||
public NodeParcelable(Node node) {
|
||||
this.id = node.getId();
|
||||
this.displayName = node.getDisplayName();
|
||||
this(node.getId(), node.getDisplayName(), 0, node.isNearby());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,7 +64,7 @@ public class NodeParcelable extends AutoSafeParcelable implements Node {
|
||||
|
||||
NodeParcelable that = (NodeParcelable) o;
|
||||
|
||||
if (!id.equals(that.id)) return false;
|
||||
if (!nodeId.equals(that.nodeId)) return false;
|
||||
if (!displayName.equals(that.displayName)) return false;
|
||||
|
||||
return true;
|
||||
@ -66,18 +77,22 @@ public class NodeParcelable extends AutoSafeParcelable implements Node {
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return id;
|
||||
return nodeId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isNearby() {
|
||||
return isNearby;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = 37 * 17 + id.hashCode();
|
||||
return 37 * result + displayName.hashCode();
|
||||
return nodeId.hashCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NodeParcelable{" + id + "," + displayName + "}";
|
||||
return "NodeParcelable{" + displayName + ", id=" + displayName + ", hops=" + hops + ", isNearby=" + isNearby + "}";
|
||||
}
|
||||
|
||||
public static final Creator<NodeParcelable> CREATOR = new AutoCreator<NodeParcelable>(NodeParcelable.class);
|
||||
|
@ -17,7 +17,18 @@
|
||||
package com.google.android.gms.wearable.internal;
|
||||
|
||||
import org.microg.safeparcel.AutoSafeParcelable;
|
||||
import org.microg.safeparcel.SafeParceled;
|
||||
|
||||
public class SendMessageResponse extends AutoSafeParcelable {
|
||||
|
||||
@SafeParceled(1)
|
||||
private int versionCode = 1;
|
||||
|
||||
@SafeParceled(2)
|
||||
public int statusCode;
|
||||
|
||||
@SafeParceled(3)
|
||||
public int resultId = -1;
|
||||
|
||||
public static final Creator<SendMessageResponse> CREATOR = new AutoCreator<SendMessageResponse>(SendMessageResponse.class);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user