diff --git a/extern/SafeParcel b/extern/SafeParcel index cbe7b4b9..89dd3272 160000 --- a/extern/SafeParcel +++ b/extern/SafeParcel @@ -1 +1 @@ -Subproject commit cbe7b4b90452670c422f8303ec2a19aac7179d32 +Subproject commit 89dd3272d40271120913e0ba71b0fd348387f1d6 diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl new file mode 100644 index 00000000..52b4c775 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/ActivityRecognitionResult.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable ActivityRecognitionResult; \ No newline at end of file diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl new file mode 100644 index 00000000..9fffa77a --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/GestureRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable GestureRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl new file mode 100644 index 00000000..bbccd355 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/ILocationCallback.aidl @@ -0,0 +1,11 @@ +package com.google.android.gms.location; + +import android.location.Location; + +import com.google.android.gms.location.LocationAvailability; +import com.google.android.gms.location.LocationResult; + +interface ILocationCallback { + void onLocationResult(in LocationResult result) = 0; + void onLocationAvailability(in LocationAvailability availability) = 1; +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl new file mode 100644 index 00000000..8037232b --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationAvailability.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable LocationAvailability; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl new file mode 100644 index 00000000..d79917b7 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationResult.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable LocationResult; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl new file mode 100644 index 00000000..2552ed66 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/LocationSettingsRequest.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location; + +parcelable LocationSettingsRequest; diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl index e2fb3acc..be26aeac 100644 --- a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/IGoogleLocationManagerService.aidl @@ -4,9 +4,12 @@ import android.app.PendingIntent; import android.location.Location; import android.os.Bundle; +import com.google.android.gms.common.api.Status; import com.google.android.gms.location.places.AutocompleteFilter; import com.google.android.gms.location.places.internal.IPlacesCallbacks; +import com.google.android.gms.location.internal.ISettingsCallback; import com.google.android.gms.location.internal.LocationRequestInternal; +import com.google.android.gms.location.internal.LocationRequestUpdateData; import com.google.android.gms.location.places.NearbyAlertRequest; import com.google.android.gms.location.places.PlaceFilter; import com.google.android.gms.location.places.PlaceRequest; @@ -14,9 +17,13 @@ import com.google.android.gms.location.places.PlaceReport; import com.google.android.gms.location.places.internal.PlacesParams; import com.google.android.gms.location.places.UserAddedPlace; import com.google.android.gms.location.places.UserDataType; +import com.google.android.gms.location.ActivityRecognitionResult; import com.google.android.gms.location.Geofence; import com.google.android.gms.location.GeofencingRequest; +import com.google.android.gms.location.GestureRequest; +import com.google.android.gms.location.LocationAvailability; import com.google.android.gms.location.LocationRequest; +import com.google.android.gms.location.LocationSettingsRequest; import com.google.android.gms.location.LocationStatus; import com.google.android.gms.location.internal.IGeofencerCallbacks; import com.google.android.gms.location.ILocationListener; @@ -25,40 +32,54 @@ import com.google.android.gms.maps.model.LatLngBounds; interface IGoogleLocationManagerService { void addGeofencesList(in List geofences, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks, String packageName) = 0; + void addGeofences(in GeofencingRequest geofencingRequest, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks) = 56; void removeGeofencesByIntent(in PendingIntent pendingIntent, IGeofencerCallbacks callbacks, String packageName) = 1; void removeGeofencesById(in String[] geofenceRequestIds, IGeofencerCallbacks callbacks, String packageName) = 2; - void iglms4(IGeofencerCallbacks callbacks, String packageName) = 3; + void removeAllGeofences(IGeofencerCallbacks callbacks, String packageName) = 3; + void requestActivityUpdates(long detectionIntervalMillis, boolean alwaysTrue, in PendingIntent callbackIntent) = 4; void removeActivityUpdates(in PendingIntent callbackIntent) = 5; + ActivityRecognitionResult getLastActivity(String packageName) = 63; + Status iglms65(in PendingIntent pendingIntent) = 64; + Status iglms66(in PendingIntent pendingIntent) = 65; + + Status requestGestureUpdates(in GestureRequest request, in PendingIntent pendingIntent) = 59; + Status iglms61(in PendingIntent pendingIntent) = 60; + Location getLastLocation() = 6; void requestLocationUpdatesWithListener(in LocationRequest request, ILocationListener listener) = 7; + void requestLocationUpdatesWithPackage(in LocationRequest request, ILocationListener listener, String packageName) = 19; void requestLocationUpdatesWithIntent(in LocationRequest request, in PendingIntent callbackIntent) = 8; + void requestLocationUpdatesInternalWithListener(in LocationRequestInternal request, ILocationListener listener) = 51; + void requestLocationUpdatesInternalWithIntent(in LocationRequestInternal request, in PendingIntent callbackIntent) = 52; void removeLocationUpdatesWithListener(ILocationListener listener) = 9; void removeLocationUpdatesWithIntent(in PendingIntent callbackIntent) = 10; + void updateLocationRequest(in LocationRequestUpdateData locationRequestUpdateData) = 58; + void setMockMode(boolean mockMode) = 11; void setMockLocation(in Location mockLocation) = 12; + + Location getLastLocationWithPackage(String packageName) = 20; + void iglms26(in Location var1, int var2) = 25; + LocationAvailability iglms34(String var1) = 33; + + IBinder iglms51() = 50; + void iglms63(in LocationSettingsRequest settingsRequest, ISettingsCallback callback, String packageName) = 62; + void iglms14(in LatLngBounds var1, int var2, in PlaceFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 13; void iglms15(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 14; void iglms16(in LatLng var1, in PlaceFilter var2, in PlacesParams var3, IPlacesCallbacks var4) = 15; void iglms17(in PlaceFilter var1, in PlacesParams var2, IPlacesCallbacks var3) = 16; void iglms18(in PlaceRequest var1, in PlacesParams var2, in PendingIntent var3) = 17; void iglms19(in PlacesParams var1, in PendingIntent var2) = 18; - void requestLocationUpdatesWithPackage(in LocationRequest request, ILocationListener listener, String packageName) = 19; - Location getLastLocationWithPackage(String packageName) = 20; void iglms25(in PlaceReport var1, in PlacesParams var2) = 24; - void iglms26(in Location var1, int var2) = 25; - LocationStatus iglms34(String var1) = 33; void iglms42(String var1, in PlacesParams var2, IPlacesCallbacks var3) = 41; void iglms46(in UserAddedPlace var1, in PlacesParams var2, IPlacesCallbacks var3) = 45; void iglms47(in LatLngBounds var1, int var2, String var3, in PlaceFilter var4, in PlacesParams var5, IPlacesCallbacks var6) = 46; void iglms48(in NearbyAlertRequest var1, in PlacesParams var2, in PendingIntent var3) = 47; void iglms49(in PlacesParams var1, in PendingIntent var2) = 48; void iglms50(in UserDataType var1, in LatLngBounds var2, in List var3, in PlacesParams var4, IPlacesCallbacks var5) = 49; - IBinder iglms51() = 50; - void requestLocationUpdatesInternalWithListener(in LocationRequestInternal request, ILocationListener listener) = 51; - void requestLocationUpdatesInternalWithIntent(in LocationRequestInternal request, in PendingIntent callbackIntent) = 52; IBinder iglms54() = 53; void iglms55(String var1, in LatLngBounds var2, in AutocompleteFilter var3, in PlacesParams var4, IPlacesCallbacks var5) = 54; - void addGeofences(in GeofencingRequest geofencingRequest, in PendingIntent pendingIntent, IGeofencerCallbacks callbacks) = 56; void iglms58(in List var1, in PlacesParams var2, IPlacesCallbacks var3) = 57; } diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl new file mode 100644 index 00000000..f1ec017e --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/ISettingsCallback.aidl @@ -0,0 +1,5 @@ +package com.google.android.gms.location.internal; + +interface ISettingsCallback { + // TODO +} diff --git a/play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl new file mode 100644 index 00000000..812f2ca5 --- /dev/null +++ b/play-services-api/src/main/aidl/com/google/android/gms/location/internal/LocationRequestUpdateData.aidl @@ -0,0 +1,3 @@ +package com.google.android.gms.location.internal; + +parcelable LocationRequestUpdateData; diff --git a/play-services-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java b/play-services-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java new file mode 100644 index 00000000..497cfdb8 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/ActivityRecognitionResult.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class ActivityRecognitionResult extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(ActivityRecognitionResult.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/GestureRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/GestureRequest.java new file mode 100644 index 00000000..78bc5004 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/GestureRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class GestureRequest extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(GestureRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java new file mode 100644 index 00000000..2cba0cf6 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationAvailability.java @@ -0,0 +1,24 @@ +/* + * Copyright 2013-2015 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.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LocationAvailability extends AutoSafeParcelable { + + public static final Creator CREATOR = new AutoCreator(LocationAvailability.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java index 41660fac..27907f2f 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationRequest.java @@ -423,8 +423,16 @@ public class LocationRequest extends AutoSafeParcelable { @Override public String toString() { - // TODO - return super.toString(); + return "LocationRequest{" + + "priority=" + priority + + ", interval=" + interval + + ", fastestInterval=" + fastestInterval + + ", explicitFastestInterval=" + explicitFastestInterval + + ", expirationTime=" + expirationTime + + ", numUpdates=" + numUpdates + + ", smallestDesplacement=" + smallestDesplacement + + ", maxWaitTime=" + maxWaitTime + + '}'; } public static final Creator CREATOR = new AutoCreator(LocationRequest.class); diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationResult.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationResult.java new file mode 100644 index 00000000..9bfcf71c --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationResult.java @@ -0,0 +1,45 @@ +/* + * Copyright 2013-2015 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.location; + +import android.location.Location; + +import org.microg.gms.common.PublicApi; +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; + +@PublicApi +public class LocationResult extends AutoSafeParcelable { + + @SafeParceled(1000) + private int versionCode = 2; + + @SafeParceled(value = 1, subClass = Location.class) + public final List locations; + + private LocationResult(List locations) { + this.locations = locations; + } + + public static LocationResult create(List locations) { + return new LocationResult(locations); + } + + public static final Creator CREATOR = new AutoCreator(LocationResult.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java new file mode 100644 index 00000000..cd52b8fa --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/LocationSettingsRequest.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013-2015 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.location; + +import org.microg.safeparcel.AutoSafeParcelable; + +public class LocationSettingsRequest extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(LocationSettingsRequest.class); +} diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java index 7c707529..8b9758a8 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/ClientIdentity.java @@ -16,5 +16,8 @@ package com.google.android.gms.location.internal; -public class ClientIdentity { +import org.microg.safeparcel.AutoSafeParcelable; + +public class ClientIdentity extends AutoSafeParcelable { + public static final Creator CREATOR = new AutoCreator(ClientIdentity.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java index c7eb2e15..1c9fe3d6 100644 --- a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestInternal.java @@ -16,12 +16,51 @@ package com.google.android.gms.location.internal; -import org.microg.safeparcel.AutoSafeParcelable; +import com.google.android.gms.location.LocationRequest; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +import java.util.List; -/** - * TODO: usage - */ public class LocationRequestInternal extends AutoSafeParcelable { + @SafeParceled(1000) + private int versionCode = 1; + + @SafeParceled(1) + public LocationRequest request; + + @SafeParceled(2) + public boolean requestNlpDebugInfo; + + @SafeParceled(3) + public boolean restorePendingIntentListeners; + + @SafeParceled(4) + public boolean triggerUpdate; + + @SafeParceled(value = 5, subClass = ClientIdentity.class) + public List clients; + + @SafeParceled(6) + public String tag; + + @SafeParceled(7) + public boolean hideFromAppOps; + + @Override + public String toString() { + return "LocationRequestInternal{" + + "request=" + request + + ", requestNlpDebugInfo=" + requestNlpDebugInfo + + ", restorePendingIntentListeners=" + restorePendingIntentListeners + + ", triggerUpdate=" + triggerUpdate + + ", clients=" + clients + + ", tag='" + tag + '\'' + + ", hideFromAppOps=" + hideFromAppOps + + '}'; + } + public static final Creator CREATOR = new AutoCreator(LocationRequestInternal.class); } diff --git a/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java new file mode 100644 index 00000000..748f2f13 --- /dev/null +++ b/play-services-api/src/main/java/com/google/android/gms/location/internal/LocationRequestUpdateData.java @@ -0,0 +1,62 @@ +/* + * Copyright 2013-2015 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.location.internal; + +import android.app.PendingIntent; + +import com.google.android.gms.location.ILocationCallback; +import com.google.android.gms.location.ILocationListener; + +import org.microg.safeparcel.AutoSafeParcelable; +import org.microg.safeparcel.SafeParceled; + +public class LocationRequestUpdateData extends AutoSafeParcelable { + + public static final int REQUEST_UPDATES = 1; + public static final int REMOVE_UPDATES = 2; + + @SafeParceled(1000) + private int versionCode; + + @SafeParceled(1) + public int opCode; + + @SafeParceled(2) + public LocationRequestInternal request; + + @SafeParceled(3) + public ILocationListener listener; + + @SafeParceled(4) + public PendingIntent pendingIntent; + + @SafeParceled(5) + public ILocationCallback callback; + + @Override + public String toString() { + return "LocationRequestUpdateData{" + + "opCode=" + opCode + + ", request=" + request + + ", listener=" + listener + + ", pendingIntent=" + pendingIntent + + ", callback=" + callback + + '}'; + } + + public static final Creator CREATOR = new AutoCreator(LocationRequestUpdateData.class); +}