mirror of
https://github.com/YTVanced/VancedMicroG
synced 2025-01-03 14:11:00 +00:00
Update Location APIs
This commit is contained in:
parent
35e8503273
commit
cb0458f17e
19 changed files with 322 additions and 17 deletions
2
extern/SafeParcel
vendored
2
extern/SafeParcel
vendored
|
@ -1 +1 @@
|
|||
Subproject commit cbe7b4b90452670c422f8303ec2a19aac7179d32
|
||||
Subproject commit 89dd3272d40271120913e0ba71b0fd348387f1d6
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.location;
|
||||
|
||||
parcelable ActivityRecognitionResult;
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.location;
|
||||
|
||||
parcelable GestureRequest;
|
|
@ -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;
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.location;
|
||||
|
||||
parcelable LocationAvailability;
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.location;
|
||||
|
||||
parcelable LocationResult;
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.location;
|
||||
|
||||
parcelable LocationSettingsRequest;
|
|
@ -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<Geofence> 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;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package com.google.android.gms.location.internal;
|
||||
|
||||
interface ISettingsCallback {
|
||||
// TODO
|
||||
}
|
|
@ -0,0 +1,3 @@
|
|||
package com.google.android.gms.location.internal;
|
||||
|
||||
parcelable LocationRequestUpdateData;
|
|
@ -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<ActivityRecognitionResult> CREATOR = new AutoCreator<ActivityRecognitionResult>(ActivityRecognitionResult.class);
|
||||
}
|
|
@ -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<GestureRequest> CREATOR = new AutoCreator<GestureRequest>(GestureRequest.class);
|
||||
}
|
|
@ -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<LocationAvailability> CREATOR = new AutoCreator<LocationAvailability>(LocationAvailability.class);
|
||||
}
|
|
@ -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<LocationRequest> CREATOR = new AutoCreator<LocationRequest>(LocationRequest.class);
|
||||
|
|
|
@ -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<Location> locations;
|
||||
|
||||
private LocationResult(List<Location> locations) {
|
||||
this.locations = locations;
|
||||
}
|
||||
|
||||
public static LocationResult create(List<Location> locations) {
|
||||
return new LocationResult(locations);
|
||||
}
|
||||
|
||||
public static final Creator<LocationResult> CREATOR = new AutoCreator<LocationResult>(LocationResult.class);
|
||||
}
|
|
@ -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<LocationSettingsRequest> CREATOR = new AutoCreator<LocationSettingsRequest>(LocationSettingsRequest.class);
|
||||
}
|
|
@ -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<ClientIdentity> CREATOR = new AutoCreator<ClientIdentity>(ClientIdentity.class);
|
||||
}
|
||||
|
|
|
@ -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<ClientIdentity> 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<LocationRequestInternal> CREATOR = new AutoCreator<LocationRequestInternal>(LocationRequestInternal.class);
|
||||
}
|
||||
|
|
|
@ -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<LocationRequestUpdateData> CREATOR = new AutoCreator<LocationRequestUpdateData>(LocationRequestUpdateData.class);
|
||||
}
|
Loading…
Reference in a new issue