0
0
Fork 0
mirror of https://github.com/YTVanced/VancedMicroG synced 2024-11-24 04:05:13 +00:00

Add api stuff

This commit is contained in:
mar-v-in 2015-01-15 20:16:15 +01:00
parent 95fabdd877
commit c1f66a6b3b
4 changed files with 89 additions and 1 deletions

View file

@ -15,7 +15,7 @@ dependencies {
android {
compileSdkVersion 21
buildToolsVersion "21.0.2"
buildToolsVersion "21.1.2"
lintOptions.abortOnError false
sourceSets {

View file

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

View file

@ -0,0 +1,79 @@
package com.google.android.gms.common.api;
import android.app.PendingIntent;
import org.microg.safeparcel.AutoSafeParcelable;
/**
* Represents the results of work.
* <p/>
* TODO: Docs
*/
public final class Status extends AutoSafeParcelable implements Result {
private static final int STATUS_CODE_INTERRUPTED = 14;
private static final int STATUS_CODE_CANCELED = 16;
public static final Status INTERRUPTED = new Status(STATUS_CODE_INTERRUPTED);
public static final Status CANCELED = new Status(STATUS_CODE_CANCELED);
private final int versionCode;
private final int statusCode;
private final String statusMessage;
private final PendingIntent resolution;
private Status() {
versionCode = 1;
statusCode = 0;
statusMessage = null;
resolution = null;
}
public Status(int statusCode) {
this(statusCode, null);
}
public Status(int statusCode, String statusMessage) {
this(statusCode, statusMessage, null);
}
public Status(int statusCode, String statusMessage, PendingIntent resolution) {
this.versionCode = 1;
this.statusCode = statusCode;
this.statusMessage = statusMessage;
this.resolution = resolution;
}
public PendingIntent getResolution() {
return resolution;
}
public int getStatusCode() {
return statusCode;
}
public String getStatusMessage() {
return statusMessage;
}
public boolean hasResolution() {
return resolution != null;
}
public boolean isCanceled() {
return statusCode == STATUS_CODE_CANCELED;
}
public boolean isInterrupted() {
return statusCode == STATUS_CODE_INTERRUPTED;
}
public boolean isSuccess() {
return statusCode <= 0;
}
@Override
public Status getStatus() {
return this;
}
public static final Creator<Status> CREATOR = new AutoCreator<>(Status.class);
}

View file

@ -9,6 +9,7 @@ public class Constants {
public static final String ACTION_GMS_LOCATION_MANAGER_SERVICE_START = "com.google.android.location.internal.GoogleLocationManagerService.START";
public static final String KEY_MOCK_LOCATION = "mockLocation";
public static final String DEFAULT_ACCOUNT = "<<default account>>";
public static final String GMS_PACKAGE_NAME = "com.google.android.gms";
/**
* No base map tiles.