summaryrefslogtreecommitdiffstats
path: root/location
diff options
context:
space:
mode:
Diffstat (limited to 'location')
-rw-r--r--location/lib/java/com/android/location/provider/FusedLocationHardware.java20
-rw-r--r--location/lib/java/com/android/location/provider/FusedLocationHardwareSink.java3
2 files changed, 22 insertions, 1 deletions
diff --git a/location/lib/java/com/android/location/provider/FusedLocationHardware.java b/location/lib/java/com/android/location/provider/FusedLocationHardware.java
index 480a18c..eb3b2f4 100644
--- a/location/lib/java/com/android/location/provider/FusedLocationHardware.java
+++ b/location/lib/java/com/android/location/provider/FusedLocationHardware.java
@@ -216,6 +216,26 @@ public final class FusedLocationHardware {
}
}
+
+ /**
+ * Returns the version of the FLP HAL.
+ *
+ * <p>Version 1 is the initial release.
+ * <p>Version 2 adds the ability to use {@link #flushBatchedLocations},
+ * {@link FusedLocationHardwareSink#onCapabilities}, and
+ * {@link FusedLocationHardwareSink#onStatusChanged}.
+ *
+ * <p>This method is only available on API 23 or later. Older APIs have version 1.
+ */
+ public int getVersion() {
+ try {
+ return mLocationHardware.getVersion();
+ } catch(RemoteException e) {
+ Log.e(TAG, "RemoteException at getVersion");
+ }
+ return 1;
+ }
+
/*
* Helper methods and classes
*/
diff --git a/location/lib/java/com/android/location/provider/FusedLocationHardwareSink.java b/location/lib/java/com/android/location/provider/FusedLocationHardwareSink.java
index 618d5d6..01d37ac 100644
--- a/location/lib/java/com/android/location/provider/FusedLocationHardwareSink.java
+++ b/location/lib/java/com/android/location/provider/FusedLocationHardwareSink.java
@@ -54,7 +54,8 @@ public class FusedLocationHardwareSink {
/**
* Called when the status changes in the underlying FLP HAL
* implementation (the ability to compute location). This
- * callback will only be made on API 23 or later.
+ * callback will only be made on version 2 or later
+ * (see {@link FusedLocationHardware#getVersion()}).
*
* @param status One of FLP_STATUS_LOCATION_AVAILABLE or
* FLP_STATUS_LOCATION_UNAVAILABLE as defined in