diff options
| author | David Christie <dnchrist@google.com> | 2015-04-14 12:14:03 -0700 |
|---|---|---|
| committer | David Christie <dnchrist@google.com> | 2015-04-14 12:14:03 -0700 |
| commit | cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1 (patch) | |
| tree | 1fed5109ca15005e7a688d4bd4d28678748fe53e /core/java/android | |
| parent | fff30439cafb737eb54de807caab4fb61432f2cc (diff) | |
| download | frameworks_base-cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1.zip frameworks_base-cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1.tar.gz frameworks_base-cfc9b6d6ab3c622ea4f9d06c28d6e0d2055d98e1.tar.bz2 | |
Add versioning to FLP HAL.
Retain compatibility with implementations compiled
against old headers or left unchanged from LMP.
Change-Id: I3f7cfaaf0cba8697c312940a805b053c6040caa6
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/hardware/location/GeofenceHardwareImpl.java | 11 | ||||
| -rw-r--r-- | core/java/android/hardware/location/IFusedLocationHardware.aidl | 5 |
2 files changed, 15 insertions, 1 deletions
diff --git a/core/java/android/hardware/location/GeofenceHardwareImpl.java b/core/java/android/hardware/location/GeofenceHardwareImpl.java index 5d40e94..b34c9fb 100644 --- a/core/java/android/hardware/location/GeofenceHardwareImpl.java +++ b/core/java/android/hardware/location/GeofenceHardwareImpl.java @@ -41,6 +41,7 @@ import java.util.Iterator; public final class GeofenceHardwareImpl { private static final String TAG = "GeofenceHardwareImpl"; private static final boolean DEBUG = Log.isLoggable(TAG, Log.DEBUG); + private static final int FIRST_VERSION_WITH_CAPABILITIES = 2; private final Context mContext; private static GeofenceHardwareImpl sInstance; @@ -54,6 +55,7 @@ public final class GeofenceHardwareImpl { private IFusedGeofenceHardware mFusedService; private IGpsGeofenceHardware mGpsService; private int mCapabilities; + private int mVersion = 1; private int[] mSupportedMonitorTypes = new int[GeofenceHardware.NUM_MONITORS]; @@ -145,8 +147,10 @@ public final class GeofenceHardwareImpl { private void updateFusedHardwareAvailability() { boolean fusedSupported; try { + final boolean hasGnnsCapabilities = (mVersion < FIRST_VERSION_WITH_CAPABILITIES) + || (mCapabilities & CAPABILITY_GNSS) != 0; fusedSupported = (mFusedService != null - ? mFusedService.isSupported() && (mCapabilities & CAPABILITY_GNSS) != 0 + ? mFusedService.isSupported() && hasGnnsCapabilities : false); } catch (RemoteException e) { Log.e(TAG, "RemoteException calling LocationManagerService"); @@ -177,6 +181,11 @@ public final class GeofenceHardwareImpl { updateFusedHardwareAvailability(); } + public void setVersion(int version) { + mVersion = version; + updateFusedHardwareAvailability(); + } + public void setFusedGeofenceHardware(IFusedGeofenceHardware service) { if(mFusedService == null) { mFusedService = service; diff --git a/core/java/android/hardware/location/IFusedLocationHardware.aidl b/core/java/android/hardware/location/IFusedLocationHardware.aidl index 3de766a..2ea4d23 100644 --- a/core/java/android/hardware/location/IFusedLocationHardware.aidl +++ b/core/java/android/hardware/location/IFusedLocationHardware.aidl @@ -121,4 +121,9 @@ interface IFusedLocationHardware { * of the locations returned in this call. */ void flushBatchedLocations() = 11; + + /** + * Returns the version of this FLP HAL implementation. + */ + int getVersion() = 12; } |
