diff options
author | Davide Garberi <dade.garberi@gmail.com> | 2018-12-06 20:47:47 +0100 |
---|---|---|
committer | Davide Garberi <dade.garberi@gmail.com> | 2018-12-04 13:55:19 +0100 |
commit | 3f963bb897e8c5f8c633af50c96bdb4e68a6c5a8 (patch) | |
tree | 33695824de14addf3108cdecefe1dec49e87f640 /gps/android/location_api | |
parent | e95825d6dbfa247b82678cf48c85399bd4d5bc58 (diff) |
msm8996-common: gps: Switch back to 89xx tags
* Basically just remove the gnss 1.1 support
* Tag: LA.UM.7.6.r1-03100-89xx.0
Change-Id: Ie52463e60c6f6bb127e736fe3e23a8b75c044a3a
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Diffstat (limited to 'gps/android/location_api')
-rw-r--r-- | gps/android/location_api/BatchingAPIClient.cpp | 4 | ||||
-rw-r--r-- | gps/android/location_api/BatchingAPIClient.h | 4 | ||||
-rw-r--r-- | gps/android/location_api/GeofenceAPIClient.cpp | 4 | ||||
-rw-r--r-- | gps/android/location_api/GeofenceAPIClient.h | 4 | ||||
-rw-r--r-- | gps/android/location_api/GnssAPIClient.cpp | 4 | ||||
-rw-r--r-- | gps/android/location_api/GnssAPIClient.h | 8 | ||||
-rw-r--r-- | gps/android/location_api/LocationUtil.cpp | 4 | ||||
-rw-r--r-- | gps/android/location_api/LocationUtil.h | 4 | ||||
-rw-r--r-- | gps/android/location_api/MeasurementAPIClient.cpp | 48 | ||||
-rw-r--r-- | gps/android/location_api/MeasurementAPIClient.h | 11 |
10 files changed, 28 insertions, 67 deletions
diff --git a/gps/android/location_api/BatchingAPIClient.cpp b/gps/android/location_api/BatchingAPIClient.cpp index 82a803f..264ab83 100644 --- a/gps/android/location_api/BatchingAPIClient.cpp +++ b/gps/android/location_api/BatchingAPIClient.cpp @@ -42,7 +42,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssBatching; @@ -190,7 +190,7 @@ static void convertBatchOption(const IGnssBatching::Options& in, LocationOptions } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/location_api/BatchingAPIClient.h b/gps/android/location_api/BatchingAPIClient.h index 64d47a0..5d64df3 100644 --- a/gps/android/location_api/BatchingAPIClient.h +++ b/gps/android/location_api/BatchingAPIClient.h @@ -39,7 +39,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { class BatchingAPIClient : public LocationAPIClientBase @@ -67,7 +67,7 @@ private: }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/location_api/GeofenceAPIClient.cpp b/gps/android/location_api/GeofenceAPIClient.cpp index 93d175e..774a049 100644 --- a/gps/android/location_api/GeofenceAPIClient.cpp +++ b/gps/android/location_api/GeofenceAPIClient.cpp @@ -39,7 +39,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; @@ -269,7 +269,7 @@ void GeofenceAPIClient::onResumeGeofencesCb(size_t count, LocationError* errors, } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/location_api/GeofenceAPIClient.h b/gps/android/location_api/GeofenceAPIClient.h index c74a59a..dc99ddd 100644 --- a/gps/android/location_api/GeofenceAPIClient.h +++ b/gps/android/location_api/GeofenceAPIClient.h @@ -37,7 +37,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::sp; @@ -69,7 +69,7 @@ private: }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/location_api/GnssAPIClient.cpp b/gps/android/location_api/GnssAPIClient.cpp index 4e3b0ac..320ae15 100644 --- a/gps/android/location_api/GnssAPIClient.cpp +++ b/gps/android/location_api/GnssAPIClient.cpp @@ -40,7 +40,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnss; @@ -531,7 +531,7 @@ static void convertGnssSvStatus(GnssSvNotification& in, IGnssCallback::GnssSvSta } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/location_api/GnssAPIClient.h b/gps/android/location_api/GnssAPIClient.h index 1589f39..923cb48 100644 --- a/gps/android/location_api/GnssAPIClient.h +++ b/gps/android/location_api/GnssAPIClient.h @@ -32,15 +32,15 @@ #include <mutex> -#include <android/hardware/gnss/1.1/IGnss.h> -#include <android/hardware/gnss/1.1/IGnssCallback.h> +#include <android/hardware/gnss/1.0/IGnss.h> +#include <android/hardware/gnss/1.0/IGnssCallback.h> #include <android/hardware/gnss/1.0/IGnssNiCallback.h> #include <LocationAPIClientBase.h> namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::sp; @@ -101,7 +101,7 @@ private: }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/location_api/LocationUtil.cpp b/gps/android/location_api/LocationUtil.cpp index 21c2e39..89681f2 100644 --- a/gps/android/location_api/LocationUtil.cpp +++ b/gps/android/location_api/LocationUtil.cpp @@ -32,7 +32,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::GnssLocation; @@ -182,7 +182,7 @@ void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEph } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/location_api/LocationUtil.h b/gps/android/location_api/LocationUtil.h index 63f4f6f..9e0cd36 100644 --- a/gps/android/location_api/LocationUtil.h +++ b/gps/android/location_api/LocationUtil.h @@ -37,7 +37,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { void convertGnssLocation(Location& in, V1_0::GnssLocation& out); @@ -48,7 +48,7 @@ void convertGnssEphemerisSource(GnssEphemerisSource& in, GnssDebug::SatelliteEph void convertGnssEphemerisHealth(GnssEphemerisHealth& in, GnssDebug::SatelliteEphemerisHealth& out); } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/location_api/MeasurementAPIClient.cpp b/gps/android/location_api/MeasurementAPIClient.cpp index f1a5d01..823851d 100644 --- a/gps/android/location_api/MeasurementAPIClient.cpp +++ b/gps/android/location_api/MeasurementAPIClient.cpp @@ -39,23 +39,20 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssMeasurement; -using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback; +using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback; static void convertGnssData(GnssMeasurementsNotification& in, V1_0::IGnssMeasurementCallback::GnssData& out); -static void convertGnssData_1_1(GnssMeasurementsNotification& in, - IGnssMeasurementCallback::GnssData& out); static void convertGnssMeasurement(GnssMeasurementsData& in, V1_0::IGnssMeasurementCallback::GnssMeasurement& out); static void convertGnssClock(GnssMeasurementsClock& in, IGnssMeasurementCallback::GnssClock& out); MeasurementAPIClient::MeasurementAPIClient() : mGnssMeasurementCbIface(nullptr), - mGnssMeasurementCbIface_1_1(nullptr), mTracking(false) { LOC_LOGD("%s]: ()", __FUNCTION__); @@ -80,18 +77,6 @@ MeasurementAPIClient::measurementSetCallback(const sp<V1_0::IGnssMeasurementCall } Return<IGnssMeasurement::GnssMeasurementStatus> -MeasurementAPIClient::measurementSetCallback_1_1(const sp<IGnssMeasurementCallback>& callback) -{ - LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); - - mMutex.lock(); - mGnssMeasurementCbIface_1_1 = callback; - mMutex.unlock(); - - return startTracking(); -} - -Return<IGnssMeasurement::GnssMeasurementStatus> MeasurementAPIClient::startTracking() { LocationCallbacks locationCallbacks; @@ -108,7 +93,7 @@ MeasurementAPIClient::startTracking() locationCallbacks.gnssNmeaCb = nullptr; locationCallbacks.gnssMeasurementsCb = nullptr; - if (mGnssMeasurementCbIface_1_1 != nullptr || mGnssMeasurementCbIface != nullptr) { + if (mGnssMeasurementCbIface != nullptr) { locationCallbacks.gnssMeasurementsCb = [this](GnssMeasurementsNotification gnssMeasurementsNotification) { onGnssMeasurementsCb(gnssMeasurementsNotification); @@ -144,23 +129,12 @@ void MeasurementAPIClient::onGnssMeasurementsCb( if (mTracking) { mMutex.lock(); sp<V1_0::IGnssMeasurementCallback> gnssMeasurementCbIface = nullptr; - sp<IGnssMeasurementCallback> gnssMeasurementCbIface_1_1 = nullptr; - if (mGnssMeasurementCbIface_1_1 != nullptr) { - gnssMeasurementCbIface_1_1 = mGnssMeasurementCbIface_1_1; - } else if (mGnssMeasurementCbIface != nullptr) { + if (mGnssMeasurementCbIface != nullptr) { gnssMeasurementCbIface = mGnssMeasurementCbIface; } mMutex.unlock(); - if (gnssMeasurementCbIface_1_1 != nullptr) { - IGnssMeasurementCallback::GnssData gnssData; - convertGnssData_1_1(gnssMeasurementsNotification, gnssData); - auto r = gnssMeasurementCbIface_1_1->gnssMeasurementCb(gnssData); - if (!r.isOk()) { - LOC_LOGE("%s] Error from gnssMeasurementCb description=%s", - __func__, r.description().c_str()); - } - } else if (gnssMeasurementCbIface != nullptr) { + if (gnssMeasurementCbIface != nullptr) { V1_0::IGnssMeasurementCallback::GnssData gnssData; convertGnssData(gnssMeasurementsNotification, gnssData); auto r = gnssMeasurementCbIface->GnssMeasurementCb(gnssData); @@ -294,18 +268,8 @@ static void convertGnssData(GnssMeasurementsNotification& in, convertGnssClock(in.clock, out.clock); } -static void convertGnssData_1_1(GnssMeasurementsNotification& in, - IGnssMeasurementCallback::GnssData& out) -{ - out.measurements.resize(in.count); - for (size_t i = 0; i < in.count; i++) { - convertGnssMeasurement(in.measurements[i], out.measurements[i].v1_0); - } - convertGnssClock(in.clock, out.clock); -} - } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/location_api/MeasurementAPIClient.h b/gps/android/location_api/MeasurementAPIClient.h index 117ad54..08b4811 100644 --- a/gps/android/location_api/MeasurementAPIClient.h +++ b/gps/android/location_api/MeasurementAPIClient.h @@ -31,15 +31,15 @@ #define MEASUREMENT_API_CLINET_H #include <mutex> -#include <android/hardware/gnss/1.1/IGnssMeasurement.h> -#include <android/hardware/gnss/1.1/IGnssMeasurementCallback.h> +#include <android/hardware/gnss/1.0/IGnssMeasurement.h> +#include <android/hardware/gnss/1.0/IGnssMeasurementCallback.h> #include <LocationAPIClientBase.h> #include <hidl/Status.h> namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::sp; @@ -55,8 +55,6 @@ public: // for GpsMeasurementInterface Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback( const sp<V1_0::IGnssMeasurementCallback>& callback); - Return<V1_0::IGnssMeasurement::GnssMeasurementStatus> measurementSetCallback_1_1( - const sp<IGnssMeasurementCallback>& callback); void measurementClose(); Return<IGnssMeasurement::GnssMeasurementStatus> startTracking(); @@ -66,13 +64,12 @@ public: private: std::mutex mMutex; sp<V1_0::IGnssMeasurementCallback> mGnssMeasurementCbIface; - sp<IGnssMeasurementCallback> mGnssMeasurementCbIface_1_1; bool mTracking; }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android |