From 1eeeb0bcd3a41c0d0546338d59c4926aaa0a068e Mon Sep 17 00:00:00 2001 From: Thibaut Girka Date: Fri, 8 Jul 2016 10:27:00 +0200 Subject: [PATCH] Add internal FusedLocationProviderResult callback --- .../org/microg/gms/location/GoogleLocationManager.java | 9 +++++++++ .../org/microg/gms/location/LocationRequestHelper.java | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java index e7a4fe73..726038c8 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java +++ b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManager.java @@ -21,12 +21,15 @@ import android.app.PendingIntent; import android.content.Context; import android.location.Location; import android.location.LocationManager; +import android.os.RemoteException; import android.support.v4.content.ContextCompat; +import android.util.Log; import android.widget.Toast; import com.google.android.gms.R; import com.google.android.gms.location.ILocationListener; import com.google.android.gms.location.LocationRequest; +import com.google.android.gms.location.internal.FusedLocationProviderResult; import com.google.android.gms.location.internal.LocationRequestUpdateData; import org.microg.gms.common.Utils; @@ -155,6 +158,12 @@ public class GoogleLocationManager implements LocationChangeListener { public void updateLocationRequest(LocationRequestUpdateData data) { if (data.opCode == LocationRequestUpdateData.REQUEST_UPDATES) { requestLocationUpdates(new LocationRequestHelper(context, hasFineLocationPermission(), hasCoarseLocationPermission(), null, data)); + if (data.fusedLocationProviderCallback != null) { + try { + data.fusedLocationProviderCallback.onFusedLocationProviderResult(FusedLocationProviderResult.SUCCESS); + } catch (RemoteException ignored) { + } + } } else if (data.opCode == LocationRequestUpdateData.REMOVE_UPDATES) { for (int i = 0; i < currentRequests.size(); i++) { if (currentRequests.get(i).respondsTo(data.listener) diff --git a/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java b/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java index aceb5408..cffad3f2 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java +++ b/play-services-core/src/main/java/org/microg/gms/location/LocationRequestHelper.java @@ -27,7 +27,11 @@ import com.google.android.gms.location.ILocationCallback; import com.google.android.gms.location.ILocationListener; import com.google.android.gms.location.LocationRequest; import com.google.android.gms.location.LocationResult; +import com.google.android.gms.location.internal.IFusedLocationProviderCallback; import com.google.android.gms.location.internal.LocationRequestUpdateData; +import com.google.android.gms.location.internal.FusedLocationProviderResult; + +import com.google.android.gms.common.api.Status; import java.util.Arrays; import java.util.Collections;