Migrate to AutoSafeParcelable

This commit is contained in:
mar-v-in 2015-01-12 11:02:10 +01:00
parent 7c312bfe30
commit 95fabdd877
29 changed files with 112 additions and 779 deletions

View File

@ -0,0 +1,7 @@
package com.google.android.gms.common.api;
import org.microg.safeparcel.AutoSafeParcelable;
public class AccountInfo extends AutoSafeParcelable {
public static final Creator<AccountInfo> CREATOR = new AutoCreator<>(AccountInfo.class);
}

View File

@ -1,15 +1,16 @@
package com.google.android.gms.common.api; package com.google.android.gms.common.api;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.SafeParceled;
import org.microg.safeparcel.SafeParcelable;
/** /**
* Describes an OAuth 2.0 scope to request. This has security implications for the user, and * Describes an OAuth 2.0 scope to request. This has security implications for the user, and
* requesting additional scopes will result in authorization dialogs. * requesting additional scopes will result in authorization dialogs.
*/ */
public class Scope implements SafeParcelable { public class Scope extends AutoSafeParcelable {
@SafeParceled(1)
private final int versionCode; private final int versionCode;
@SafeParceled(2)
private final String scopeUri; private final String scopeUri;
private Scope() { private Scope() {
@ -17,11 +18,6 @@ public class Scope implements SafeParcelable {
scopeUri = null; scopeUri = null;
} }
private Scope(Parcel in) {
this();
SafeParcelUtil.readObject(this, in);
}
/** /**
* Creates a new scope with the given URI. * Creates a new scope with the given URI.
*/ */
@ -30,11 +26,6 @@ public class Scope implements SafeParcelable {
this.scopeUri = scopeUri; this.scopeUri = scopeUri;
} }
@Override
public int describeContents() {
return 0;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
return this == o || o instanceof Scope && scopeUri.equals(((Scope) o).scopeUri); return this == o || o instanceof Scope && scopeUri.equals(((Scope) o).scopeUri);
@ -54,20 +45,5 @@ public class Scope implements SafeParcelable {
return scopeUri; return scopeUri;
} }
@Override public static final Creator<Scope> CREATOR = new AutoCreator<>(Scope.class);
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<Scope> CREATOR = new Creator<Scope>() {
@Override
public Scope createFromParcel(Parcel parcel) {
return new Scope(parcel);
}
@Override
public Scope[] newArray(int i) {
return new Scope[i];
}
};
} }

View File

@ -1,36 +1,11 @@
package com.google.android.gms.common.data; package com.google.android.gms.common.data;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
/** /**
* TODO: usage * TODO: usage
*/ */
public class DataHolder implements SafeParcelable { public class DataHolder extends AutoSafeParcelable {
private DataHolder(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
@Override public static final Creator<DataHolder> CREATOR = new AutoCreator<>(DataHolder.class);
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<DataHolder> CREATOR = new Creator<DataHolder>() {
@Override
public DataHolder createFromParcel(Parcel parcel) {
return new DataHolder(parcel);
}
@Override
public DataHolder[] newArray(int i) {
return new DataHolder[i];
}
};
} }

View File

@ -16,33 +16,9 @@
package com.google.android.gms.location; package com.google.android.gms.location;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
public class Geofence implements SafeParcelable { public class Geofence extends AutoSafeParcelable {
public static Creator<Geofence> CREATOR = new AutoCreator<>(Geofence.class);
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
SafeParcelUtil.writeObject(this, dest, flags);
}
public static Creator<Geofence> CREATOR = new Creator<Geofence>() {
@Override
public Geofence createFromParcel(Parcel source) {
return new Geofence();
}
@Override
public Geofence[] newArray(int size) {
return new Geofence[size];
}
};
} }

View File

@ -1,38 +1,12 @@
package com.google.android.gms.location; package com.google.android.gms.location;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import android.os.Parcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
/** /**
* TODO: usage * TODO: usage
*/ */
public class GeofencingRequest implements SafeParcelable { public class GeofencingRequest extends AutoSafeParcelable {
private GeofencingRequest(Parcel in) { public static final Creator<GeofencingRequest> CREATOR = new AutoCreator<>(
SafeParcelUtil.readObject(this, in); GeofencingRequest.class);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Parcelable.Creator<GeofencingRequest> CREATOR = new Parcelable.Creator<GeofencingRequest>() {
@Override
public GeofencingRequest createFromParcel(Parcel parcel) {
return new GeofencingRequest(parcel);
}
@Override
public GeofencingRequest[] newArray(int i) {
return new GeofencingRequest[i];
}
};
} }

View File

@ -1,9 +1,7 @@
package com.google.android.gms.location; package com.google.android.gms.location;
import android.os.Parcel;
import android.os.SystemClock; import android.os.SystemClock;
import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
import java.util.Arrays; import java.util.Arrays;
@ -55,10 +53,8 @@ import java.util.Arrays;
* <p/> * <p/>
* All location requests are considered hints, and you may receive locations that are more/less * All location requests are considered hints, and you may receive locations that are more/less
* accurate, and faster/slower than requested. * accurate, and faster/slower than requested.
* <p/>
* TODO: Works on wire, but methods not yet implemented.
*/ */
public class LocationRequest implements SafeParcelable { public class LocationRequest extends AutoSafeParcelable {
/** /**
* Used with {@link #setPriority(int)} to request "block" level accuracy. * Used with {@link #setPriority(int)} to request "block" level accuracy.
@ -120,11 +116,6 @@ public class LocationRequest implements SafeParcelable {
this.maxWaitTime = 0; this.maxWaitTime = 0;
} }
public LocationRequest(Parcel in) {
this();
SafeParcelUtil.readObject(this, in);
}
/** /**
* Create a location request with default parameters. * Create a location request with default parameters.
* <p/> * <p/>
@ -137,11 +128,6 @@ public class LocationRequest implements SafeParcelable {
return new LocationRequest(); return new LocationRequest();
} }
@Override
public int describeContents() {
return 0;
}
/** /**
* Get the request expiration time, in milliseconds since boot. * Get the request expiration time, in milliseconds since boot.
* <p/> * <p/>
@ -426,20 +412,5 @@ public class LocationRequest implements SafeParcelable {
return super.toString(); return super.toString();
} }
@Override public static final Creator<LocationRequest> CREATOR = new AutoCreator<>(LocationRequest.class);
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<LocationRequest> CREATOR = new Creator<LocationRequest>() {
@Override
public LocationRequest createFromParcel(Parcel parcel) {
return new LocationRequest(parcel);
}
@Override
public LocationRequest[] newArray(int i) {
return new LocationRequest[i];
}
};
} }

View File

@ -1,13 +1,11 @@
package com.google.android.gms.location; package com.google.android.gms.location;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
import java.util.Arrays; import java.util.Arrays;
public class LocationStatus implements SafeParcelable { public class LocationStatus extends AutoSafeParcelable {
public static final int STATUS_SUCCESSFUL = 0; public static final int STATUS_SUCCESSFUL = 0;
public static final int STATUS_UNKNOWN = 1; public static final int STATUS_UNKNOWN = 1;
public static final int STATUS_TIMED_OUT_ON_SCAN = 2; public static final int STATUS_TIMED_OUT_ON_SCAN = 2;
@ -26,14 +24,8 @@ public class LocationStatus implements SafeParcelable {
@SafeParceled(3) @SafeParceled(3)
long elapsedRealtimeNanos; long elapsedRealtimeNanos;
private LocationStatus(Parcel in) { private LocationStatus() {
versionCode = 1; versionCode = 1;
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
} }
@Override @Override
@ -84,20 +76,5 @@ public class LocationStatus implements SafeParcelable {
} }
} }
@Override public static final Creator<LocationStatus> CREATOR = new AutoCreator<>(LocationStatus.class);
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<LocationStatus> CREATOR = new Creator<LocationStatus>() {
@Override
public LocationStatus createFromParcel(Parcel parcel) {
return new LocationStatus(parcel);
}
@Override
public LocationStatus[] newArray(int i) {
return new LocationStatus[i];
}
};
} }

View File

@ -1,37 +1,12 @@
package com.google.android.gms.location.internal; package com.google.android.gms.location.internal;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import android.os.Parcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
/** /**
* TODO: usage * TODO: usage
*/ */
public class LocationRequestInternal implements SafeParcelable { public class LocationRequestInternal extends AutoSafeParcelable {
private LocationRequestInternal(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
@Override public static final Creator<LocationRequestInternal> CREATOR = new AutoCreator<>(
public int describeContents() { LocationRequestInternal.class);
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Parcelable.Creator<LocationRequestInternal> CREATOR = new Parcelable.Creator<LocationRequestInternal>() {
@Override
public LocationRequestInternal createFromParcel(Parcel parcel) {
return new LocationRequestInternal(parcel);
}
@Override
public LocationRequestInternal[] newArray(int i) {
return new LocationRequestInternal[i];
}
};
} }

View File

@ -1,15 +1,13 @@
package com.google.android.gms.location.places; package com.google.android.gms.location.places;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
/** /**
* TODO usage * TODO usage
*/ */
public class AutocompleteFilter implements SafeParcelable { public class AutocompleteFilter extends AutoSafeParcelable {
@SafeParceled(1000) @SafeParceled(1000)
private final int versionCode; private final int versionCode;
@ -17,30 +15,6 @@ public class AutocompleteFilter implements SafeParcelable {
this.versionCode = 1; this.versionCode = 1;
} }
private AutocompleteFilter(Parcel in) { public static final Creator<AutocompleteFilter> CREATOR = new AutoCreator<>(
this(); AutocompleteFilter.class);
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<AutocompleteFilter> CREATOR = new Creator<AutocompleteFilter>() {
@Override
public AutocompleteFilter createFromParcel(Parcel parcel) {
return new AutocompleteFilter(parcel);
}
@Override
public AutocompleteFilter[] newArray(int i) {
return new AutocompleteFilter[i];
}
};
} }

View File

@ -1,36 +1,12 @@
package com.google.android.gms.location.places; package com.google.android.gms.location.places;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
/** /**
* TODO: usage * TODO: usage
*/ */
public class NearbyAlertRequest implements SafeParcelable { public class NearbyAlertRequest extends AutoSafeParcelable {
private NearbyAlertRequest(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
@Override public static final Creator<NearbyAlertRequest> CREATOR = new AutoCreator<>(
public int describeContents() { NearbyAlertRequest.class);
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<NearbyAlertRequest> CREATOR = new Creator<NearbyAlertRequest>() {
@Override
public NearbyAlertRequest createFromParcel(Parcel parcel) {
return new NearbyAlertRequest(parcel);
}
@Override
public NearbyAlertRequest[] newArray(int i) {
return new NearbyAlertRequest[i];
}
};
} }

View File

@ -1,37 +1,11 @@
package com.google.android.gms.location.places; package com.google.android.gms.location.places;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
/** /**
* TODO: usage * TODO: usage
*/ */
public class PlaceFilter implements SafeParcelable { public class PlaceFilter extends AutoSafeParcelable {
private PlaceFilter(Parcel in) { public static final Creator<PlaceFilter> CREATOR = new AutoCreator<>(PlaceFilter.class);
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<PlaceFilter> CREATOR = new Creator<PlaceFilter>() {
@Override
public PlaceFilter createFromParcel(Parcel parcel) {
return new PlaceFilter(parcel);
}
@Override
public PlaceFilter[] newArray(int i) {
return new PlaceFilter[i];
}
};
} }

View File

@ -1,38 +1,10 @@
package com.google.android.gms.location.places; package com.google.android.gms.location.places;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import android.os.Parcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
/** /**
* TODO: usage * TODO: usage
*/ */
public class PlaceReport implements SafeParcelable { public class PlaceReport extends AutoSafeParcelable {
public static final Creator<PlaceReport> CREATOR = new AutoCreator<>(PlaceReport.class);
private PlaceReport(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Parcelable.Creator<PlaceReport> CREATOR = new Parcelable.Creator<PlaceReport>() {
@Override
public PlaceReport createFromParcel(Parcel parcel) {
return new PlaceReport(parcel);
}
@Override
public PlaceReport[] newArray(int i) {
return new PlaceReport[i];
}
};
} }

View File

@ -1,36 +1,10 @@
package com.google.android.gms.location.places; package com.google.android.gms.location.places;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
/** /**
* TODO: usage * TODO: usage
*/ */
public class PlaceRequest implements SafeParcelable { public class PlaceRequest extends AutoSafeParcelable {
private PlaceRequest(Parcel in) { public static final Creator<PlaceRequest> CREATOR = new AutoCreator<>(PlaceRequest.class);
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<PlaceRequest> CREATOR = new Creator<PlaceRequest>() {
@Override
public PlaceRequest createFromParcel(Parcel parcel) {
return new PlaceRequest(parcel);
}
@Override
public PlaceRequest[] newArray(int i) {
return new PlaceRequest[i];
}
};
} }

View File

@ -1,46 +1,19 @@
package com.google.android.gms.location.places; package com.google.android.gms.location.places;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
/** /**
* TODO: usage * TODO: usage
*/ */
public class UserAddedPlace implements SafeParcelable { public class UserAddedPlace extends AutoSafeParcelable {
@SafeParceled(1000) @SafeParceled(1000)
private final int versionCode; private final int versionCode;
private UserAddedPlace() { private UserAddedPlace() {
versionCode = -1; versionCode = 1;
} }
private UserAddedPlace(Parcel in) { public static final Creator<UserAddedPlace> CREATOR = new AutoCreator<>(UserAddedPlace.class);
this();
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<UserAddedPlace> CREATOR = new Creator<UserAddedPlace>() {
@Override
public UserAddedPlace createFromParcel(Parcel parcel) {
return new UserAddedPlace(parcel);
}
@Override
public UserAddedPlace[] newArray(int i) {
return new UserAddedPlace[i];
}
};
} }

View File

@ -1,36 +1,11 @@
package com.google.android.gms.location.places; package com.google.android.gms.location.places;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
/** /**
* TODO: usage * TODO: usage
*/ */
public class UserDataType implements SafeParcelable { public class UserDataType extends AutoSafeParcelable {
private UserDataType(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
@Override public static final Creator<UserDataType> CREATOR = new AutoCreator<>(UserDataType.class);
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<UserDataType> CREATOR = new Creator<UserDataType>() {
@Override
public UserDataType createFromParcel(Parcel parcel) {
return new UserDataType(parcel);
}
@Override
public UserDataType[] newArray(int i) {
return new UserDataType[i];
}
};
} }

View File

@ -1,11 +1,9 @@
package com.google.android.gms.location.places.internal; package com.google.android.gms.location.places.internal;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
public class PlacesParams implements SafeParcelable { public class PlacesParams extends AutoSafeParcelable {
@SafeParceled(1000) @SafeParceled(1000)
private final int versionCode; private final int versionCode;
@ -19,34 +17,9 @@ public class PlacesParams implements SafeParcelable {
public final String gCoreClientName; public final String gCoreClientName;
private PlacesParams() { private PlacesParams() {
versionCode = -1; versionCode = 1;
clientPackageName = locale = accountName = gCoreClientName = null; clientPackageName = locale = accountName = gCoreClientName = null;
} }
private PlacesParams(Parcel in) { public static final Creator<PlacesParams> CREATOR = new AutoCreator<>(PlacesParams.class);
this();
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static final Creator<PlacesParams> CREATOR = new Creator<PlacesParams>() {
@Override
public PlacesParams createFromParcel(Parcel parcel) {
return new PlacesParams(parcel);
}
@Override
public PlacesParams[] newArray(int i) {
return new PlacesParams[i];
}
};
} }

View File

@ -16,13 +16,11 @@
package com.google.android.gms.maps; package com.google.android.gms.maps;
import android.os.Parcel;
import com.google.android.gms.maps.model.CameraPosition; import com.google.android.gms.maps.model.CameraPosition;
import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
public final class GoogleMapOptions implements SafeParcelable { public final class GoogleMapOptions extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private int versionCode; private int versionCode;
@SafeParceled(2) @SafeParceled(2)
@ -46,23 +44,9 @@ public final class GoogleMapOptions implements SafeParcelable {
@SafeParceled(11) @SafeParceled(11)
private boolean rotateGesturesEnabled; private boolean rotateGesturesEnabled;
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
SafeParcelUtil.writeObject(this, dest, flags);
}
public GoogleMapOptions() { public GoogleMapOptions() {
} }
private GoogleMapOptions(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
public int getMapType() { public int getMapType() {
return mapType; return mapType;
} }
@ -95,13 +79,5 @@ public final class GoogleMapOptions implements SafeParcelable {
return rotateGesturesEnabled; return rotateGesturesEnabled;
} }
public static Creator<GoogleMapOptions> CREATOR = new Creator<GoogleMapOptions>() { public static Creator<GoogleMapOptions> CREATOR = new AutoCreator<>(GoogleMapOptions.class);
public GoogleMapOptions createFromParcel(Parcel source) {
return new GoogleMapOptions(source);
}
public GoogleMapOptions[] newArray(int size) {
return new GoogleMapOptions[size];
}
};
} }

View File

@ -17,10 +17,8 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.content.Context; import android.content.Context;
import android.os.Parcel;
import android.util.AttributeSet; import android.util.AttributeSet;
import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
import java.util.Arrays; import java.util.Arrays;
@ -28,7 +26,7 @@ import java.util.Arrays;
/** /**
* An immutable class that aggregates all camera position parameters. * An immutable class that aggregates all camera position parameters.
*/ */
public final class CameraPosition implements SafeParcelable { public final class CameraPosition extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private final int versionCode; private final int versionCode;
/** /**
@ -60,17 +58,10 @@ public final class CameraPosition implements SafeParcelable {
*/ */
private CameraPosition() { private CameraPosition() {
target = null; target = null;
versionCode = -1; versionCode = 1;
zoom = tilt = bearing = 0; zoom = tilt = bearing = 0;
} }
private CameraPosition(Parcel in) {
this();
SafeParcelUtil.readObject(this, in);
if (target == null)
throw new NullPointerException("Target must not be null");
}
/** /**
* Constructs a CameraPosition. * Constructs a CameraPosition.
* *
@ -126,11 +117,6 @@ public final class CameraPosition implements SafeParcelable {
return null; // TODO return null; // TODO
} }
@Override
public int describeContents() {
return 0;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) if (this == o)
@ -181,20 +167,7 @@ public final class CameraPosition implements SafeParcelable {
'}'; '}';
} }
@Override public static Creator<CameraPosition> CREATOR = new AutoCreator<>(CameraPosition.class);
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static Creator<CameraPosition> CREATOR = new Creator<CameraPosition>() {
public CameraPosition createFromParcel(Parcel source) {
return new CameraPosition(source);
}
public CameraPosition[] newArray(int size) {
return new CameraPosition[size];
}
};
/** /**
* Builds camera position. * Builds camera position.

View File

@ -17,15 +17,13 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.graphics.Color; import android.graphics.Color;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
/** /**
* Defines options for a Circle. * Defines options for a Circle.
*/ */
public class CircleOptions implements SafeParcelable { public class CircleOptions extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private int versionCode; private int versionCode;
@SafeParceled(2) @SafeParceled(2)
@ -49,15 +47,6 @@ public class CircleOptions implements SafeParcelable {
public CircleOptions() { public CircleOptions() {
} }
private CircleOptions(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
/** /**
* Sets the center using a {@link LatLng}. * Sets the center using a {@link LatLng}.
* <p/> * <p/>
@ -210,11 +199,6 @@ public class CircleOptions implements SafeParcelable {
return this; return this;
} }
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
/** /**
* Sets the zIndex. * Sets the zIndex.
* <p/> * <p/>
@ -230,13 +214,5 @@ public class CircleOptions implements SafeParcelable {
return this; return this;
} }
public static Creator<CircleOptions> CREATOR = new Creator<CircleOptions>() { public static Creator<CircleOptions> CREATOR = new AutoCreator<>(CircleOptions.class);
public CircleOptions createFromParcel(Parcel source) {
return new CircleOptions(source);
}
public CircleOptions[] newArray(int size) {
return new CircleOptions[size];
}
};
} }

View File

@ -17,16 +17,14 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.os.IBinder; import android.os.IBinder;
import android.os.Parcel;
import com.google.android.gms.dynamic.ObjectWrapper; import com.google.android.gms.dynamic.ObjectWrapper;
import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
/** /**
* Defines options for a ground overlay. * Defines options for a ground overlay.
*/ */
public class GroundOverlayOptions implements SafeParcelable { public class GroundOverlayOptions extends AutoSafeParcelable {
/** /**
* Flag for when no dimension is specified for the height. * Flag for when no dimension is specified for the height.
*/ */
@ -64,10 +62,6 @@ public class GroundOverlayOptions implements SafeParcelable {
public GroundOverlayOptions() { public GroundOverlayOptions() {
} }
private GroundOverlayOptions(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
/** /**
* Specifies the anchor to be at a particular point in the image. * Specifies the anchor to be at a particular point in the image.
* <p/> * <p/>
@ -104,11 +98,6 @@ public class GroundOverlayOptions implements SafeParcelable {
return this; return this;
} }
@Override
public int describeContents() {
return 0;
}
/** /**
* Horizontal distance, normalized to [0, 1], of the anchor from the left edge. * Horizontal distance, normalized to [0, 1], of the anchor from the left edge.
* *
@ -333,11 +322,6 @@ public class GroundOverlayOptions implements SafeParcelable {
return this; return this;
} }
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
/** /**
* Specifies the ground overlay's zIndex, i.e., the order in which it will be drawn. See the * Specifies the ground overlay's zIndex, i.e., the order in which it will be drawn. See the
* documentation at the top of this class for more information about zIndex. * documentation at the top of this class for more information about zIndex.
@ -349,13 +333,6 @@ public class GroundOverlayOptions implements SafeParcelable {
return this; return this;
} }
public static Creator<GroundOverlayOptions> CREATOR = new Creator<GroundOverlayOptions>() { public static Creator<GroundOverlayOptions> CREATOR = new AutoCreator<>(
public GroundOverlayOptions createFromParcel(Parcel source) { GroundOverlayOptions.class);
return new GroundOverlayOptions(source);
}
public GroundOverlayOptions[] newArray(int size) {
return new GroundOverlayOptions[size];
}
};
} }

View File

@ -16,15 +16,13 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
/** /**
* An immutable class representing a pair of latitude and longitude coordinates, stored as degrees. * An immutable class representing a pair of latitude and longitude coordinates, stored as degrees.
*/ */
public final class LatLng implements SafeParcelable { public final class LatLng extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private final int versionCode; private final int versionCode;
/** /**
@ -43,15 +41,10 @@ public final class LatLng implements SafeParcelable {
* In fact, those are replaced by their real values later using SafeParcelUtil. * In fact, those are replaced by their real values later using SafeParcelUtil.
*/ */
private LatLng() { private LatLng() {
versionCode = -1; versionCode = 1;
latitude = longitude = 0; latitude = longitude = 0;
} }
private LatLng(Parcel in) {
this();
SafeParcelUtil.readObject(this, in);
}
/** /**
* Constructs a LatLng with the given latitude and longitude, measured in degrees. * Constructs a LatLng with the given latitude and longitude, measured in degrees.
* *
@ -106,24 +99,6 @@ public final class LatLng implements SafeParcelable {
public String toString() { public String toString() {
return "lat/lng: (" + latitude + "," + longitude + ")"; return "lat/lng: (" + latitude + "," + longitude + ")";
} }
@Override public static Creator<LatLng> CREATOR = new AutoCreator<>(LatLng.class);
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static Creator<LatLng> CREATOR = new Creator<LatLng>() {
public LatLng createFromParcel(Parcel source) {
return new LatLng(source);
}
public LatLng[] newArray(int size) {
return new LatLng[size];
}
};
} }

View File

@ -16,9 +16,7 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
import java.util.Arrays; import java.util.Arrays;
@ -26,7 +24,7 @@ import java.util.Arrays;
/** /**
* An immutable class representing a latitude/longitude aligned rectangle. * An immutable class representing a latitude/longitude aligned rectangle.
*/ */
public final class LatLngBounds implements SafeParcelable { public final class LatLngBounds extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private final int versionCode; private final int versionCode;
/** /**
@ -45,15 +43,10 @@ public final class LatLngBounds implements SafeParcelable {
* In fact, those are replaced by their real values later using SafeParcelUtil. * In fact, those are replaced by their real values later using SafeParcelUtil.
*/ */
private LatLngBounds() { private LatLngBounds() {
this.versionCode = -1; this.versionCode = 1;
southwest = northeast = null; southwest = northeast = null;
} }
private LatLngBounds(Parcel in) {
this();
SafeParcelUtil.readObject(this, in);
}
/** /**
* Creates a new bounds based on a southwest and a northeast corner. * Creates a new bounds based on a southwest and a northeast corner.
* <p/> * <p/>
@ -110,11 +103,6 @@ public final class LatLngBounds implements SafeParcelable {
); );
} }
@Override
public int describeContents() {
return 0;
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) if (this == o)
@ -190,20 +178,7 @@ public final class LatLngBounds implements SafeParcelable {
'}'; '}';
} }
@Override public static Creator<LatLngBounds> CREATOR = new AutoCreator<>(LatLngBounds.class);
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static Creator<LatLngBounds> CREATOR = new Creator<LatLngBounds>() {
public LatLngBounds createFromParcel(Parcel source) {
return new LatLngBounds(source);
}
public LatLngBounds[] newArray(int size) {
return new LatLngBounds[size];
}
};
/** /**
* This is a builder that is able to create a minimum bound based on a set of LatLng points. * This is a builder that is able to create a minimum bound based on a set of LatLng points.

View File

@ -17,13 +17,11 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.os.IBinder; import android.os.IBinder;
import android.os.Parcel;
import com.google.android.gms.dynamic.ObjectWrapper; import com.google.android.gms.dynamic.ObjectWrapper;
import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
public class MarkerOptions implements SafeParcelable { public class MarkerOptions extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private int versionCode = 1; private int versionCode = 1;
@ -64,15 +62,6 @@ public class MarkerOptions implements SafeParcelable {
public MarkerOptions() { public MarkerOptions() {
} }
private MarkerOptions(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
/** /**
* Sets the alpha (opacity) of the marker. This is a value from 0 to 1, where 0 means the * Sets the alpha (opacity) of the marker. This is a value from 0 to 1, where 0 means the
* marker is completely transparent and 1 means the marker is completely opaque. * marker is completely transparent and 1 means the marker is completely opaque.
@ -334,18 +323,5 @@ public class MarkerOptions implements SafeParcelable {
return this; return this;
} }
@Override public static Creator<MarkerOptions> CREATOR = new AutoCreator<>(MarkerOptions.class);
public void writeToParcel(Parcel dest, int flags) {
SafeParcelUtil.writeObject(this, dest, flags);
}
public static Creator<MarkerOptions> CREATOR = new Creator<MarkerOptions>() {
public MarkerOptions createFromParcel(Parcel source) {
return new MarkerOptions(source);
}
public MarkerOptions[] newArray(int size) {
return new MarkerOptions[size];
}
};
} }

View File

@ -16,39 +16,15 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
/** /**
* Defines options for a polygon. * Defines options for a polygon.
* TODO * TODO
*/ */
public class PolygonOptions implements SafeParcelable { public class PolygonOptions extends AutoSafeParcelable {
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
SafeParcelUtil.writeObject(this, dest, flags);
}
public PolygonOptions() { public PolygonOptions() {
} }
private PolygonOptions(Parcel in) { public static Creator<PolygonOptions> CREATOR = new AutoCreator<>(PolygonOptions.class);
SafeParcelUtil.readObject(this, in);
}
public static Creator<PolygonOptions> CREATOR = new Creator<PolygonOptions>() {
public PolygonOptions createFromParcel(Parcel source) {
return new PolygonOptions(source);
}
public PolygonOptions[] newArray(int size) {
return new PolygonOptions[size];
}
};
} }

View File

@ -16,9 +16,7 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
import java.util.List; import java.util.List;
@ -27,7 +25,7 @@ import java.util.List;
* Defines options for a polyline. * Defines options for a polyline.
* TODO * TODO
*/ */
public class PolylineOptions implements SafeParcelable { public class PolylineOptions extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private int versionCode; private int versionCode;
// TODO // TODO
@ -41,27 +39,5 @@ public class PolylineOptions implements SafeParcelable {
public PolylineOptions() { public PolylineOptions() {
} }
private PolylineOptions(Parcel in) { public static Creator<PolylineOptions> CREATOR = new AutoCreator<>(PolylineOptions.class);
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
SafeParcelUtil.writeObject(this, dest, flags);
}
public static Creator<PolylineOptions> CREATOR = new Creator<PolylineOptions>() {
public PolylineOptions createFromParcel(Parcel source) {
return new PolylineOptions(source);
}
public PolylineOptions[] newArray(int size) {
return new PolylineOptions[size];
}
};
} }

View File

@ -1,15 +1,13 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
/** /**
* Contains information about a Tile that is returned by a {@link TileProvider}. * Contains information about a Tile that is returned by a {@link TileProvider}.
* TODO SafeParceled * TODO SafeParceled
*/ */
public class Tile implements SafeParcelable { public class Tile extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private final int versionCode; private final int versionCode;
/** /**
@ -30,16 +28,11 @@ public class Tile implements SafeParcelable {
public final byte[] data; public final byte[] data;
private Tile() { private Tile() {
versionCode = -1; versionCode = 1;
width = height = 0; width = height = 0;
data = null; data = null;
} }
private Tile(Parcel in) {
this();
SafeParcelUtil.readObject(this, in);
}
/** /**
* Constructs a {@link Tile}. * Constructs a {@link Tile}.
* *
@ -56,23 +49,5 @@ public class Tile implements SafeParcelable {
this.data = data; this.data = data;
} }
@Override public static Creator<Tile> CREATOR = new AutoCreator<>(Tile.class);
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel out, int flags) {
SafeParcelUtil.writeObject(this, out, flags);
}
public static Creator<Tile> CREATOR = new Creator<Tile>() {
public Tile createFromParcel(Parcel source) {
return new Tile(source);
}
public Tile[] newArray(int size) {
return new Tile[size];
}
};
} }

View File

@ -17,17 +17,15 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.os.IBinder; import android.os.IBinder;
import android.os.Parcel;
import android.os.RemoteException; import android.os.RemoteException;
import com.google.android.gms.maps.model.internal.ITileProviderDelegate; import com.google.android.gms.maps.model.internal.ITileProviderDelegate;
import org.microg.safeparcel.SafeParcelUtil; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
/** /**
* Defines options for a TileOverlay. * Defines options for a TileOverlay.
*/ */
public class TileOverlayOptions implements SafeParcelable { public class TileOverlayOptions extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private final int versionCode = 1; private final int versionCode = 1;
@ -50,15 +48,6 @@ public class TileOverlayOptions implements SafeParcelable {
public TileOverlayOptions() { public TileOverlayOptions() {
} }
private TileOverlayOptions(Parcel in) {
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
/** /**
* Specifies whether the tiles should fade in. The default is {@code true}. * Specifies whether the tiles should fade in. The default is {@code true}.
* *
@ -132,11 +121,6 @@ public class TileOverlayOptions implements SafeParcelable {
return this; return this;
} }
@Override
public void writeToParcel(Parcel dest, int flags) {
SafeParcelUtil.writeObject(this, dest, flags);
}
/** /**
* Specifies the tile overlay's zIndex, i.e., the order in which it will be drawn where * Specifies the tile overlay's zIndex, i.e., the order in which it will be drawn where
* overlays with larger values are drawn above those with lower values. See the documentation * overlays with larger values are drawn above those with lower values. See the documentation
@ -149,13 +133,5 @@ public class TileOverlayOptions implements SafeParcelable {
return this; return this;
} }
public static Creator<TileOverlayOptions> CREATOR = new Creator<TileOverlayOptions>() { public static Creator<TileOverlayOptions> CREATOR = new AutoCreator<>(TileOverlayOptions.class);
public TileOverlayOptions createFromParcel(Parcel source) {
return new TileOverlayOptions(source);
}
public TileOverlayOptions[] newArray(int size) {
return new TileOverlayOptions[size];
}
};
} }

View File

@ -16,12 +16,10 @@
package com.google.android.gms.maps.model; package com.google.android.gms.maps.model;
import android.os.Parcel; import org.microg.safeparcel.AutoSafeParcelable;
import org.microg.safeparcel.SafeParcelUtil;
import org.microg.safeparcel.SafeParcelable;
import org.microg.safeparcel.SafeParceled; import org.microg.safeparcel.SafeParceled;
public class VisibleRegion implements SafeParcelable { public class VisibleRegion extends AutoSafeParcelable {
@SafeParceled(1) @SafeParceled(1)
private int versionCode; private int versionCode;
@SafeParceled(2) @SafeParceled(2)
@ -35,6 +33,9 @@ public class VisibleRegion implements SafeParcelable {
@SafeParceled(6) @SafeParceled(6)
private LatLngBounds bounds; private LatLngBounds bounds;
private VisibleRegion() {
}
public VisibleRegion(int versionCode, LatLng nearLeft, LatLng nearRight, LatLng farLeft, public VisibleRegion(int versionCode, LatLng nearLeft, LatLng nearRight, LatLng farLeft,
LatLng farRight, LatLngBounds bounds) { LatLng farRight, LatLngBounds bounds) {
this.versionCode = versionCode; this.versionCode = versionCode;
@ -60,27 +61,5 @@ public class VisibleRegion implements SafeParcelable {
bounds); bounds);
} }
public VisibleRegion(Parcel in) { public static Creator<VisibleRegion> CREATOR = new AutoCreator<>(VisibleRegion.class);
SafeParcelUtil.readObject(this, in);
}
@Override
public int describeContents() {
return 0;
}
@Override
public void writeToParcel(Parcel dest, int flags) {
SafeParcelUtil.writeObject(this, dest, flags);
}
public static Creator<VisibleRegion> CREATOR = new Creator<VisibleRegion>() {
public VisibleRegion createFromParcel(Parcel source) {
return new VisibleRegion(source);
}
public VisibleRegion[] newArray(int size) {
return new VisibleRegion[size];
}
};
} }

View File

@ -8,6 +8,7 @@ public class Constants {
public static final int MAX_REFERENCE_VERSION = 6599436; public static final int MAX_REFERENCE_VERSION = 6599436;
public static final String ACTION_GMS_LOCATION_MANAGER_SERVICE_START = "com.google.android.location.internal.GoogleLocationManagerService.START"; 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 KEY_MOCK_LOCATION = "mockLocation";
public static final String DEFAULT_ACCOUNT = "<<default account>>";
/** /**
* No base map tiles. * No base map tiles.