Add some Wearable classes, mark public apis

This commit is contained in:
mar-v-in 2015-01-25 17:59:09 +01:00
parent c4db81d1fc
commit ae39009ccd
24 changed files with 281 additions and 0 deletions

View File

@ -0,0 +1,40 @@
/*
* Copyright 2014-2015 µg 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.common.api;
import org.microg.gms.PublicApi;
@PublicApi
public class CommonStatusCodes {
public static final int SUCCESS_CACHE = -1;
public static final int SUCCESS = 0;
public static final int SERVICE_MISSING = 1;
public static final int SERVICE_VERSION_UPDATE_REQUIRED = 2;
public static final int SERVICE_DISABLED = 3;
public static final int SIGN_IN_REQUIRED = 4;
public static final int INVALID_ACCOUNT = 5;
public static final int RESOLUTION_REQUIRED = 6;
public static final int NETWORK_ERROR = 7;
public static final int INTERNAL_ERROR = 8;
public static final int SERVICE_INVALID = 9;
public static final int DEVELOPER_ERROR = 10;
public static final int LICENSE_CHECK_FAILED = 11;
public static final int ERROR = 13;
public static final int INTERRUPTED = 14;
public static final int TIMEOUT = 15;
public static final int CANCELED = 16;
}

View File

@ -1,8 +1,11 @@
package com.google.android.gms.common.api;
import org.microg.gms.PublicApi;
/**
* Represents the final result of invoking an API method in Google Play Services.
*/
@PublicApi
public interface Result {
public Status getStatus();
}

View File

@ -1,5 +1,6 @@
package com.google.android.gms.common.api;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
@ -7,6 +8,7 @@ import org.microg.safeparcel.SafeParceled;
* Describes an OAuth 2.0 scope to request. This has security implications for the user, and
* requesting additional scopes will result in authorization dialogs.
*/
@PublicApi
public class Scope extends AutoSafeParcelable {
@SafeParceled(1)
private final int versionCode;

View File

@ -1,6 +1,8 @@
package com.google.android.gms.common.api;
import android.app.PendingIntent;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
/**
@ -8,6 +10,7 @@ import org.microg.safeparcel.AutoSafeParcelable;
* <p/>
* TODO: Docs
*/
@PublicApi
public final class Status extends AutoSafeParcelable implements Result {
private static final int STATUS_CODE_INTERRUPTED = 14;
private static final int STATUS_CODE_CANCELED = 16;

View File

@ -18,10 +18,13 @@ package com.google.android.gms.maps.model;
import com.google.android.gms.dynamic.IObjectWrapper;
import org.microg.gms.PublicApi;
/**
* Defines an image. For a marker, it can be used to set the image of the marker icon. For a ground
* overlay, it can be used to set the image to place on the surface of the earth.
*/
@PublicApi
public class BitmapDescriptor {
private final IObjectWrapper remoteObject;

View File

@ -18,6 +18,8 @@ package com.google.android.gms.maps.model;
import android.content.Context;
import android.util.AttributeSet;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
@ -26,6 +28,7 @@ import java.util.Arrays;
/**
* An immutable class that aggregates all camera position parameters.
*/
@PublicApi
public final class CameraPosition extends AutoSafeParcelable {
@SafeParceled(1)
private final int versionCode;

View File

@ -17,12 +17,15 @@
package com.google.android.gms.maps.model;
import android.graphics.Color;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
/**
* Defines options for a Circle.
*/
@PublicApi
public class CircleOptions extends AutoSafeParcelable {
@SafeParceled(1)
private int versionCode;

View File

@ -18,12 +18,15 @@ package com.google.android.gms.maps.model;
import android.os.IBinder;
import com.google.android.gms.dynamic.ObjectWrapper;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
/**
* Defines options for a ground overlay.
*/
@PublicApi
public class GroundOverlayOptions extends AutoSafeParcelable {
/**
* Flag for when no dimension is specified for the height.

View File

@ -16,12 +16,14 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
/**
* An immutable class representing a pair of latitude and longitude coordinates, stored as degrees.
*/
@PublicApi
public final class LatLng extends AutoSafeParcelable {
@SafeParceled(1)
private final int versionCode;

View File

@ -16,6 +16,7 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
@ -24,6 +25,7 @@ import java.util.Arrays;
/**
* An immutable class representing a latitude/longitude aligned rectangle.
*/
@PublicApi
public final class LatLngBounds extends AutoSafeParcelable {
@SafeParceled(1)
private final int versionCode;

View File

@ -18,9 +18,12 @@ package com.google.android.gms.maps.model;
import android.os.IBinder;
import com.google.android.gms.dynamic.ObjectWrapper;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
@PublicApi
public class MarkerOptions extends AutoSafeParcelable {
@SafeParceled(1)

View File

@ -16,12 +16,14 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
/**
* Defines options for a polygon.
* TODO
*/
@PublicApi
public class PolygonOptions extends AutoSafeParcelable {
public PolygonOptions() {
}

View File

@ -16,6 +16,7 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
@ -25,6 +26,7 @@ import java.util.List;
* Defines options for a polyline.
* TODO
*/
@PublicApi
public class PolylineOptions extends AutoSafeParcelable {
@SafeParceled(1)
private int versionCode;

View File

@ -1,4 +1,7 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
@PublicApi
public class StreetViewPanoramaCamera {
}

View File

@ -1,4 +1,7 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
@PublicApi
public class StreetViewPanoramaLink {
}

View File

@ -1,4 +1,7 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
@PublicApi
public class StreetViewPanoramaLocation {
}

View File

@ -1,4 +1,7 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
@PublicApi
public class StreetViewPanoramaOrientation {
}

View File

@ -1,5 +1,6 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
@ -7,6 +8,7 @@ import org.microg.safeparcel.SafeParceled;
* Contains information about a Tile that is returned by a {@link TileProvider}.
* TODO SafeParceled
*/
@PublicApi
public class Tile extends AutoSafeParcelable {
@SafeParceled(1)
private final int versionCode;

View File

@ -19,12 +19,15 @@ package com.google.android.gms.maps.model;
import android.os.IBinder;
import android.os.RemoteException;
import com.google.android.gms.maps.model.internal.ITileProviderDelegate;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
/**
* Defines options for a TileOverlay.
*/
@PublicApi
public class TileOverlayOptions extends AutoSafeParcelable {
@SafeParceled(1)

View File

@ -16,9 +16,11 @@
package com.google.android.gms.maps.model;
import org.microg.gms.PublicApi;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
@PublicApi
public class VisibleRegion extends AutoSafeParcelable {
@SafeParceled(1)
private int versionCode;

View File

@ -0,0 +1,36 @@
/*
* Copyright 2014-2015 µg 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;
import org.microg.gms.PublicApi;
/**
* Information about a particular node in the Android Wear network.
*/
@PublicApi
public interface Node {
/**
* Returns a human readable description of the node. Sometimes generated from the Bluetooth
* device name
*/
public abstract String getDisplayName();
/**
* Returns an opaque string that represents a node in the Android Wear network.
*/
public abstract String getId();
}

View File

@ -0,0 +1,53 @@
/*
* Copyright 2014-2015 µg 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;
import com.google.android.gms.common.api.CommonStatusCodes;
import org.microg.gms.PublicApi;
/**
* Error codes for wearable API failures. These values may be returned by APIs to indicate the
* success or failure of a request.
*/
@PublicApi
public class WearableStatusCodes extends CommonStatusCodes {
/**
* Indicates that the targeted node is not accessible in the wearable network.
*/
public static final int TARGET_NODE_NOT_CONNECTED = 4000;
/**
* Indicates that the specified listener is already registered.
*/
public static final int DUPLICATE_LISTENER = 4001;
/**
* Indicates that the specified listener is not recognized.
*/
public static final int UNKNOWN_LISTENER = 4002;
/**
* Indicates that the data item was too large to set.
*/
public static final int DATA_ITEM_TOO_LARGE = 4003;
/**
* Indicates that the targeted node is not a valid node in the wearable network.
*/
public static final int INVALID_TARGET_NODE = 4004;
/**
* Indicates that the requested asset is unavailable.
*/
public static final int ASSET_UNAVAILABLE = 4005;
}

View File

@ -0,0 +1,79 @@
/*
* Copyright 2014-2015 µg 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 com.google.android.gms.wearable.Node;
import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParceled;
/**
* Parcelable implementation of the {@link com.google.android.gms.wearable.Node} interface.
*/
public class NodeParcelable extends AutoSafeParcelable implements Node {
@SafeParceled(1)
private final int versionCode;
@SafeParceled(2)
private final String id;
@SafeParceled(3)
private final String displayName;
private NodeParcelable() {
versionCode = 1;
id = displayName = null;
}
public NodeParcelable(String id, String displayName) {
versionCode = 1;
this.id = id;
this.displayName = displayName;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NodeParcelable that = (NodeParcelable) o;
if (!id.equals(that.id)) return false;
if (!displayName.equals(that.displayName)) return false;
return true;
}
@Override
public String getDisplayName() {
return displayName;
}
@Override
public String getId() {
return id;
}
@Override
public int hashCode() {
int result = 37 * 17 + id.hashCode();
return 37 * result + displayName.hashCode();
}
@Override
public String toString() {
return "NodeParcelable{" + id + "," + displayName + "}";
}
}

View File

@ -0,0 +1,23 @@
/*
* Copyright 2014-2015 µg 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;
public @interface PublicApi {
String since() default "-1";
String until() default "-1";
}