Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2712)

Unified Diff: device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java

Issue 2809813002: GeoLocation: add support for GmsCore location provider (Closed)
Patch Set: reillyg@ nit Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java
diff --git a/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java b/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java
index bd2ffb93036452a115b9269b28d05553322fd6e7..c735159562ade09baf87a0df9f37ab094cf5498e 100644
--- a/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java
+++ b/device/geolocation/android/java/src/org/chromium/device/geolocation/LocationProviderAdapter.java
@@ -5,7 +5,9 @@
package org.chromium.device.geolocation;
import android.content.Context;
+import android.location.Location;
+import org.chromium.base.Log;
import org.chromium.base.ThreadUtils;
import org.chromium.base.VisibleForTesting;
import org.chromium.base.annotations.CalledByNative;
@@ -24,6 +26,8 @@ import java.util.concurrent.FutureTask;
@MainDex
@VisibleForTesting
public class LocationProviderAdapter {
+ private static final String TAG = "cr_LocationProvider";
+
// Delegate handling the real work in the main thread.
private LocationProviderFactory.LocationProvider mImpl;
@@ -75,14 +79,15 @@ public class LocationProviderAdapter {
return mImpl.isRunning();
}
- public static void newLocationAvailable(double latitude, double longitude, double timestamp,
- boolean hasAltitude, double altitude, boolean hasAccuracy, double accuracy,
- boolean hasHeading, double heading, boolean hasSpeed, double speed) {
- nativeNewLocationAvailable(latitude, longitude, timestamp, hasAltitude, altitude,
- hasAccuracy, accuracy, hasHeading, heading, hasSpeed, speed);
+ public static void onNewLocationAvailable(Location location) {
+ nativeNewLocationAvailable(location.getLatitude(), location.getLongitude(),
+ location.getTime() / 1000.0, location.hasAltitude(), location.getAltitude(),
+ location.hasAccuracy(), location.getAccuracy(), location.hasBearing(),
+ location.getBearing(), location.hasSpeed(), location.getSpeed());
}
public static void newErrorAvailable(String message) {
+ Log.e(TAG, "newErrorAvailable %s", message);
nativeNewErrorAvailable(message);
}

Powered by Google App Engine
This is Rietveld 408576698