diff options
Diffstat (limited to 'services/core/java/com/android/server/location/FlpHardwareProvider.java')
-rw-r--r-- | services/core/java/com/android/server/location/FlpHardwareProvider.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/location/FlpHardwareProvider.java b/services/core/java/com/android/server/location/FlpHardwareProvider.java index 834dff2..1fb22be 100644 --- a/services/core/java/com/android/server/location/FlpHardwareProvider.java +++ b/services/core/java/com/android/server/location/FlpHardwareProvider.java @@ -42,11 +42,13 @@ import android.util.Log; * {@hide} */ public class FlpHardwareProvider { + private static final int FIRST_VERSION_WITH_FLUSH_LOCATIONS = 2; private GeofenceHardwareImpl mGeofenceHardwareSink = null; private IFusedLocationHardwareSink mLocationSink = null; // Capabilities provided by FlpCallbacks private boolean mHaveBatchingCapabilities; private int mBatchingCapabilities; + private int mVersion; private static FlpHardwareProvider sSingletonInstance = null; @@ -150,6 +152,11 @@ public class FlpHardwareProvider { } } + private void setVersion(int version) { + mVersion = version; + getGeofenceHardwareSink().setVersion(version); + } + private void maybeSendCapabilities() { IFusedLocationHardwareSink sink; boolean haveBatchingCapabilities; @@ -366,7 +373,12 @@ public class FlpHardwareProvider { @Override public void flushBatchedLocations() { - nativeFlushBatchedLocations(); + if (mVersion >= FIRST_VERSION_WITH_FLUSH_LOCATIONS) { + nativeFlushBatchedLocations(); + } else { + Log.wtf(TAG, + "Tried to call flushBatchedLocations on an unsupported implementation"); + } } @Override @@ -388,6 +400,11 @@ public class FlpHardwareProvider { public void injectDeviceContext(int deviceEnabledContext) { nativeInjectDeviceContext(deviceEnabledContext); } + + @Override + public int getVersion() { + return mVersion; + } }; private final IFusedGeofenceHardware mGeofenceHardwareService = |