From 3a156903f6fcb441a502613deafeed3f469b632d Mon Sep 17 00:00:00 2001 From: mar-v-in Date: Sun, 4 Oct 2015 04:42:44 +0200 Subject: [PATCH] Fix bug in Location API --- extern/GmsApi | 2 +- .../gms/location/GoogleLocationManagerServiceImpl.java | 10 +++++++--- .../org/microg/gms/location/ReportingServiceImpl.java | 8 ++++++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/extern/GmsApi b/extern/GmsApi index cb0458f1..6f5bf233 160000 --- a/extern/GmsApi +++ b/extern/GmsApi @@ -1 +1 @@ -Subproject commit cb0458f17e55e713b10fe5611890887d0c8b910e +Subproject commit 6f5bf2335138fda80460d906d1f2ec3d6ddfaec5 diff --git a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java index 2b3bc1de..72ca9a1f 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/location/GoogleLocationManagerServiceImpl.java @@ -33,9 +33,10 @@ import com.google.android.gms.location.ILocationListener; 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.LocationSettingsResult; import com.google.android.gms.location.internal.IGeofencerCallbacks; import com.google.android.gms.location.internal.IGoogleLocationManagerService; -import com.google.android.gms.location.internal.ISettingsCallback; +import com.google.android.gms.location.internal.ISettingsCallbacks; import com.google.android.gms.location.internal.LocationRequestInternal; import com.google.android.gms.location.internal.LocationRequestUpdateData; import com.google.android.gms.location.places.AutocompleteFilter; @@ -291,20 +292,23 @@ public class GoogleLocationManagerServiceImpl extends IGoogleLocationManagerServ } @Override - public void iglms63(LocationSettingsRequest settingsRequest, ISettingsCallback callback, String packageName) throws RemoteException { - Log.d(TAG, "iglms63"); + public void requestLocationSettingsDialog(LocationSettingsRequest settingsRequest, ISettingsCallbacks callback, String packageName) throws RemoteException { + Log.d(TAG, "requestLocationSettingsDialog: " + settingsRequest); + callback.onLocationSettingsResult(new LocationSettingsResult(Status.CANCELED)); } @Override public void requestLocationUpdatesInternalWithListener(LocationRequestInternal request, ILocationListener listener) throws RemoteException { Log.d(TAG, "requestLocationUpdatesInternalWithListener: " + request); + getLocationManager().requestLocationUpdates(request.request, listener, null); } @Override public void requestLocationUpdatesInternalWithIntent(LocationRequestInternal request, PendingIntent callbackIntent) throws RemoteException { Log.d(TAG, "requestLocationUpdatesInternalWithIntent: " + request); + getLocationManager().requestLocationUpdates(request.request, callbackIntent, null); } @Override diff --git a/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java b/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java index 386a0f4c..9dbd5e34 100644 --- a/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java +++ b/play-services-core/src/main/java/org/microg/gms/location/ReportingServiceImpl.java @@ -18,6 +18,7 @@ package org.microg.gms.location; import android.accounts.Account; import android.os.RemoteException; +import android.util.Log; import com.google.android.gms.location.places.PlaceReport; import com.google.android.gms.location.reporting.ReportingState; @@ -26,28 +27,35 @@ import com.google.android.gms.location.reporting.UploadRequestResult; import com.google.android.gms.location.reporting.internal.IReportingService; public class ReportingServiceImpl extends IReportingService.Stub { + private static final String TAG = "GmsLocReportSvcImpl"; + @Override public ReportingState getReportingState(Account account) throws RemoteException { + Log.d(TAG, "getReportingState"); return new ReportingState(); } @Override public int tryOptIn(Account account) throws RemoteException { + Log.d(TAG, "tryOptIn"); return 0; } @Override public UploadRequestResult requestUpload(UploadRequest request) throws RemoteException { + Log.d(TAG, "requestUpload"); return new UploadRequestResult(); } @Override public int cancelUploadRequest(long l) throws RemoteException { + Log.d(TAG, "cancelUploadRequest"); return 0; } @Override public int reportDeviceAtPlace(Account account, PlaceReport report) throws RemoteException { + Log.d(TAG, "reportDeviceAtPlace"); return 0; } }