From b80844001442bde6189015b01dc9c6f87a898560 Mon Sep 17 00:00:00 2001 From: David Christie Date: Tue, 14 Apr 2015 14:51:42 -0700 Subject: Ensure GeofenceHardware will return capabilities for old implementations. New FLP HAL implementations will explicitly return their capabilities, but old versions won't (the implicit capability in old versions was GNNS). Ensure that the getCapabilities feature of GeofenceHardware will return GNNS for old binaries, so GmsCore doesn't have to worry about versioning. Change-Id: I4b1c942b0d68d87bfbb18b8c06fd9d8b8f68efa6 --- core/java/android/hardware/location/GeofenceHardwareImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/java/android/hardware/location/GeofenceHardwareImpl.java b/core/java/android/hardware/location/GeofenceHardwareImpl.java index b34c9fbb7948..ee2d43ce45f3 100644 --- a/core/java/android/hardware/location/GeofenceHardwareImpl.java +++ b/core/java/android/hardware/location/GeofenceHardwareImpl.java @@ -239,7 +239,12 @@ public final class GeofenceHardwareImpl { case GeofenceHardware.MONITORING_TYPE_GPS_HARDWARE: return CAPABILITY_GNSS; case GeofenceHardware.MONITORING_TYPE_FUSED_HARDWARE: - return mCapabilities; + if (mVersion >= FIRST_VERSION_WITH_CAPABILITIES) { + return mCapabilities; + } + // This was the implied capability on old FLP HAL versions that didn't + // have the capability callback. + return CAPABILITY_GNSS; } break; } -- cgit v1.2.3-59-g8ed1b