From d15d528204bd14c319317b7c6f31784897056d0a Mon Sep 17 00:00:00 2001 From: GuaiYiHu Date: Tue, 22 Jan 2019 21:24:19 +0800 Subject: wayne-common: Update GPS from LA.UM.7.2.r1-05800-sdm660.0 Change-Id: Idaec6889200d67c776222aebecdc9c0255e2b963 Signed-off-by: Isaac Chen --- gps/android/AGnss.cpp | 4 +- gps/android/AGnss.h | 10 +- gps/android/AGnssRil.cpp | 4 +- gps/android/AGnssRil.h | 4 +- gps/android/Android.mk | 8 +- gps/android/Gnss.cpp | 113 +-------------------- gps/android/Gnss.h | 23 ++--- gps/android/GnssBatching.cpp | 4 +- gps/android/GnssBatching.h | 10 +- gps/android/GnssConfiguration.cpp | 12 +-- gps/android/GnssConfiguration.h | 18 ++-- gps/android/GnssDebug.cpp | 4 +- gps/android/GnssDebug.h | 10 +- gps/android/GnssGeofencing.cpp | 4 +- gps/android/GnssGeofencing.h | 10 +- gps/android/GnssMeasurement.cpp | 34 +------ gps/android/GnssMeasurement.h | 22 ++-- gps/android/GnssNi.cpp | 4 +- gps/android/GnssNi.h | 10 +- .../android.hardware.gnss@1.1-service-qti.rc | 2 +- gps/android/location_api/BatchingAPIClient.cpp | 4 +- gps/android/location_api/BatchingAPIClient.h | 4 +- gps/android/location_api/GeofenceAPIClient.cpp | 4 +- gps/android/location_api/GeofenceAPIClient.h | 4 +- gps/android/location_api/GnssAPIClient.cpp | 4 +- gps/android/location_api/GnssAPIClient.h | 8 +- gps/android/location_api/LocationUtil.cpp | 4 +- gps/android/location_api/LocationUtil.h | 4 +- gps/android/location_api/MeasurementAPIClient.cpp | 48 ++------- gps/android/location_api/MeasurementAPIClient.h | 11 +- gps/android/service.cpp | 2 +- gps/gnss/GnssAdapter.cpp | 34 ++++--- 32 files changed, 121 insertions(+), 320 deletions(-) (limited to 'gps') diff --git a/gps/android/AGnss.cpp b/gps/android/AGnss.cpp index fe50c9a..faaf75e 100644 --- a/gps/android/AGnss.cpp +++ b/gps/android/AGnss.cpp @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { static AGnss* spAGnss = nullptr; @@ -197,7 +197,7 @@ Return AGnss::setServer(IAGnssCallback::AGnssType type, } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/AGnss.h b/gps/android/AGnss.h index 4b599b9..cdd5931 100644 --- a/gps/android/AGnss.h +++ b/gps/android/AGnss.h @@ -18,8 +18,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H -#define ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H +#ifndef ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H +#define ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H #include #include @@ -28,7 +28,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IAGnss; @@ -71,9 +71,9 @@ struct AGnss : public IAGnss { }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_GNSS_V1_1_AGNSS_H +#endif // ANDROID_HARDWARE_GNSS_V1_0_AGNSS_H diff --git a/gps/android/AGnssRil.cpp b/gps/android/AGnssRil.cpp index 10478aa..f4b9849 100644 --- a/gps/android/AGnssRil.cpp +++ b/gps/android/AGnssRil.cpp @@ -36,7 +36,7 @@ typedef void* (getLocationInterface)(); namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { @@ -87,7 +87,7 @@ Return AGnssRil::updateNetworkState(bool connected, NetworkType type, bool } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/AGnssRil.h b/gps/android/AGnssRil.h index 5c9298a..7f18c57 100644 --- a/gps/android/AGnssRil.h +++ b/gps/android/AGnssRil.h @@ -28,7 +28,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IAGnssRil; @@ -75,7 +75,7 @@ struct AGnssRil : public IAGnssRil { }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/Android.mk b/gps/android/Android.mk index 4f1cdf2..dc721db 100644 --- a/gps/android/Android.mk +++ b/gps/android/Android.mk @@ -1,7 +1,7 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@1.1-impl-qti +LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_SRC_FILES := \ @@ -38,7 +38,6 @@ LOCAL_SHARED_LIBRARIES := \ libcutils \ libutils \ android.hardware.gnss@1.0 \ - android.hardware.gnss@1.1 \ LOCAL_SHARED_LIBRARIES += \ libloc_core \ @@ -58,10 +57,10 @@ endif # BOARD_VENDOR_QCOM_LOC_PDK_FEATURE_SET ifeq ($(BUILD_GNSS_HIDL_SERVICE), true) include $(CLEAR_VARS) -LOCAL_MODULE := android.hardware.gnss@1.1-service-qti +LOCAL_MODULE := android.hardware.gnss@1.0-service-qti LOCAL_VENDOR_MODULE := true LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_INIT_RC := android.hardware.gnss@1.1-service-qti.rc +LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc LOCAL_SRC_FILES := \ service.cpp \ @@ -86,7 +85,6 @@ LOCAL_SHARED_LIBRARIES += \ libhidlbase \ libhidltransport \ android.hardware.gnss@1.0 \ - android.hardware.gnss@1.1 \ LOCAL_CFLAGS += $(GNSS_CFLAGS) include $(BUILD_EXECUTABLE) diff --git a/gps/android/Gnss.cpp b/gps/android/Gnss.cpp index de1430c..c844118 100644 --- a/gps/android/Gnss.cpp +++ b/gps/android/Gnss.cpp @@ -29,52 +29,12 @@ typedef void* (getLocationInterface)(); -#define IMAGES_INFO_FILE "/sys/devices/soc0/images" -#define DELIMITER ";" - namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { -static std::string getVersionString() { - static std::string version; - if (!version.empty()) - return version; - - char value[PROPERTY_VALUE_MAX] = {0}; - property_get("ro.hardware", value, "unknown"); - version.append(value).append(DELIMITER); - - std::ifstream in(IMAGES_INFO_FILE); - std::string s; - while(getline(in, s)) { - std::size_t found = s.find("CRM:"); - if (std::string::npos == found) { - continue; - } - - // skip over space characters after "CRM:" - const char* substr = s.c_str(); - found += 4; - while (0 != substr[found] && isspace(substr[found])) { - found++; - } - if (s.find("11:") != found) { - continue; - } - s.erase(0, found + 3); - - found = s.find_first_of("\r\n"); - if (std::string::npos != found) { - s.erase(s.begin() + found, s.end()); - } - version.append(s).append(DELIMITER); - } - return version; -} - void Gnss::GnssDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { LOC_LOGE("%s] service died. cookie: %llu, who: %p", __FUNCTION__, static_cast(cookie), &who); @@ -366,75 +326,6 @@ Return> Gnss::getExtensionAGnssRil() { return mGnssRil; } -// Methods from ::android::hardware::gnss::V1_1::IGnss follow. -Return Gnss::setCallback_1_1(const sp& callback) { - ENTRY_LOG_CALLFLOW(); - callback->gnssNameCb(getVersionString()); - mGnssCbIface_1_1 = callback; - GnssInterface* gnssInterface = getGnssInterface(); - if (nullptr != gnssInterface) { - OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) { - odcpiRequestCb(odcpiRequest); - }; - gnssInterface->odcpiInit(cb); - } - return setCallback(callback); -} - -Return Gnss::setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode, - V1_0::IGnss::GnssPositionRecurrence recurrence, - uint32_t minIntervalMs, - uint32_t preferredAccuracyMeters, - uint32_t preferredTimeMs, - bool /*lowPowerMode*/) { - ENTRY_LOG_CALLFLOW(); - return setPositionMode(mode, recurrence, minIntervalMs, - preferredAccuracyMeters, preferredTimeMs); -} - -Return> Gnss::getExtensionGnssMeasurement_1_1() { - ENTRY_LOG_CALLFLOW(); - if (mGnssMeasurement == nullptr) - mGnssMeasurement = new GnssMeasurement(); - return mGnssMeasurement; -} - -Return> Gnss::getExtensionGnssConfiguration_1_1() { - ENTRY_LOG_CALLFLOW(); - if (mGnssConfig == nullptr) - mGnssConfig = new GnssConfiguration(this); - return mGnssConfig; -} - -Return Gnss::injectBestLocation(const GnssLocation& gnssLocation) { - ENTRY_LOG_CALLFLOW(); - GnssInterface* gnssInterface = getGnssInterface(); - if (nullptr != gnssInterface) { - Location location = {}; - convertGnssLocation(gnssLocation, location); - gnssInterface->odcpiInject(location); - } - return true; -} - -void Gnss::odcpiRequestCb(const OdcpiRequestInfo& request) { - ENTRY_LOG_CALLFLOW(); - if (mGnssCbIface_1_1 != nullptr) { - // For emergency mode, request DBH (Device based hybrid) location - // Mark Independent from GNSS flag to false. - if (ODCPI_REQUEST_TYPE_START == request.type) { - auto r = mGnssCbIface_1_1->gnssRequestLocationCb(!request.isEmergencyMode); - if (!r.isOk()) { - LOC_LOGe("Error invoking gnssRequestLocationCb %s", r.description().c_str()); - } - } else { - LOC_LOGv("Unsupported ODCPI request type: %d", request.type); - } - } else { - LOC_LOGe("ODCPI request not supported."); - } -} - IGnss* HIDL_FETCH_IGnss(const char* hal) { ENTRY_LOG_CALLFLOW(); IGnss* iface = nullptr; @@ -446,7 +337,7 @@ IGnss* HIDL_FETCH_IGnss(const char* hal) { } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/Gnss.h b/gps/android/Gnss.h index 4c0c8b0..03ef170 100644 --- a/gps/android/Gnss.h +++ b/gps/android/Gnss.h @@ -18,8 +18,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSS_H -#define ANDROID_HARDWARE_GNSS_V1_1_GNSS_H +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSS_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSS_H #include #include @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include @@ -40,7 +40,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::hidl_array; @@ -95,16 +95,6 @@ struct Gnss : public IGnss { Return> getExtensionGnssDebug() override; - // Methods from ::android::hardware::gnss::V1_1::IGnss follow. - Return setCallback_1_1(const sp& callback) override; - Return setPositionMode_1_1(V1_0::IGnss::GnssPositionMode mode, - V1_0::IGnss::GnssPositionRecurrence recurrence, - uint32_t minIntervalMs, uint32_t preferredAccuracyMeters, - uint32_t preferredTimeMs, bool lowPowerMode) override; - Return> getExtensionGnssMeasurement_1_1() override; - Return> getExtensionGnssConfiguration_1_1() override; - Return injectBestLocation(const GnssLocation& location) override; - // These methods are not part of the IGnss base class. GnssAPIClient* getApi(); Return setGnssNiCb(const sp& niCb); @@ -137,7 +127,6 @@ struct Gnss : public IGnss { GnssAPIClient* mApi = nullptr; sp mGnssCbIface = nullptr; - sp mGnssCbIface_1_1 = nullptr; sp mGnssNiCbIface = nullptr; GnssConfig mPendingConfig; GnssInterface* mGnssInterface = nullptr; @@ -146,9 +135,9 @@ struct Gnss : public IGnss { extern "C" IGnss* HIDL_FETCH_IGnss(const char* name); } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSS_H +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSS_H diff --git a/gps/android/GnssBatching.cpp b/gps/android/GnssBatching.cpp index 9701aff..3e5a9f4 100644 --- a/gps/android/GnssBatching.cpp +++ b/gps/android/GnssBatching.cpp @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { void GnssBatching::GnssBatchingDeathRecipient::serviceDied( @@ -124,7 +124,7 @@ Return GnssBatching::cleanup() { } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/GnssBatching.h b/gps/android/GnssBatching.h index 8e235d8..8fab857 100644 --- a/gps/android/GnssBatching.h +++ b/gps/android/GnssBatching.h @@ -18,8 +18,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H -#define ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H #include #include @@ -28,7 +28,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssBatching; @@ -72,9 +72,9 @@ struct GnssBatching : public IGnssBatching { }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSBATCHING_H +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSBATCHING_H diff --git a/gps/android/GnssConfiguration.cpp b/gps/android/GnssConfiguration.cpp index 9eeceac..15153dd 100644 --- a/gps/android/GnssConfiguration.cpp +++ b/gps/android/GnssConfiguration.cpp @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { GnssConfiguration::GnssConfiguration(Gnss* gnss) : mGnss(gnss) { @@ -220,16 +220,8 @@ Return GnssConfiguration::setEmergencySuplPdn(bool enabled) { return mGnss->updateConfiguration(config); } -// Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. -Return GnssConfiguration::setBlacklist( - const hidl_vec& /*blacklist*/) { - - ENTRY_LOG_CALLFLOW(); - return true; -} - } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/GnssConfiguration.h b/gps/android/GnssConfiguration.h index f46f607..1629e06 100644 --- a/gps/android/GnssConfiguration.h +++ b/gps/android/GnssConfiguration.h @@ -19,19 +19,19 @@ */ -#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H -#define ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H -#include +#include #include namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { -using ::android::hardware::gnss::V1_1::IGnssConfiguration; +using ::android::hardware::gnss::V1_0::IGnssConfiguration; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -58,18 +58,14 @@ struct GnssConfiguration : public IGnssConfiguration { Return setEmergencySuplPdn(bool enable) override; Return setGpsLock(uint8_t lock) override; - // Methods from ::android::hardware::gnss::V1_1::IGnssConfiguration follow. - Return setBlacklist( - const hidl_vec& blacklist) override; - private: Gnss* mGnss = nullptr; }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSCONFIGURATION_H +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSCONFIGURATION_H diff --git a/gps/android/GnssDebug.cpp b/gps/android/GnssDebug.cpp index 94238ab..3d8e055 100644 --- a/gps/android/GnssDebug.cpp +++ b/gps/android/GnssDebug.cpp @@ -25,7 +25,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::hidl_vec; @@ -184,7 +184,7 @@ Return GnssDebug::getDebugData(getDebugData_cb _hidl_cb) } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/GnssDebug.h b/gps/android/GnssDebug.h index cb818ac..a7116cb 100644 --- a/gps/android/GnssDebug.h +++ b/gps/android/GnssDebug.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H -#define ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H #include @@ -24,7 +24,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssDebug; @@ -51,9 +51,9 @@ private: }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSDEBUG_H +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSDEBUG_H diff --git a/gps/android/GnssGeofencing.cpp b/gps/android/GnssGeofencing.cpp index 5c11afe..2a8ff88 100644 --- a/gps/android/GnssGeofencing.cpp +++ b/gps/android/GnssGeofencing.cpp @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { void GnssGeofencing::GnssGeofencingDeathRecipient::serviceDied( @@ -135,7 +135,7 @@ Return GnssGeofencing::removeAllGeofences() { } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/GnssGeofencing.h b/gps/android/GnssGeofencing.h index 94a73de..db5f9d2 100644 --- a/gps/android/GnssGeofencing.h +++ b/gps/android/GnssGeofencing.h @@ -18,8 +18,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H -#define ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H #include #include @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssGeofenceCallback; @@ -83,9 +83,9 @@ struct GnssGeofencing : public IGnssGeofencing { }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSGEOFENCING_H +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSGEOFENCING_H diff --git a/gps/android/GnssMeasurement.cpp b/gps/android/GnssMeasurement.cpp index 2578a85..1c65bd6 100644 --- a/gps/android/GnssMeasurement.cpp +++ b/gps/android/GnssMeasurement.cpp @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { void GnssMeasurement::GnssMeasurementDeathRecipient::serviceDied( @@ -89,43 +89,13 @@ Return GnssMeasurement::close() { mGnssMeasurementCbIface->unlinkToDeath(mGnssMeasurementDeathRecipient); mGnssMeasurementCbIface = nullptr; } - if (mGnssMeasurementCbIface_1_1 != nullptr) { - mGnssMeasurementCbIface_1_1->unlinkToDeath(mGnssMeasurementDeathRecipient); - mGnssMeasurementCbIface_1_1 = nullptr; - } mApi->measurementClose(); return Void(); } -// Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow. -Return GnssMeasurement::setCallback_1_1( - const sp& callback, bool /*enableFullTracking*/) { - - Return ret = - IGnssMeasurement::GnssMeasurementStatus::ERROR_GENERIC; - if (mGnssMeasurementCbIface_1_1 != nullptr) { - LOC_LOGE("%s]: GnssMeasurementCallback is already set", __FUNCTION__); - return IGnssMeasurement::GnssMeasurementStatus::ERROR_ALREADY_INIT; - } - - if (callback == nullptr) { - LOC_LOGE("%s]: callback is nullptr", __FUNCTION__); - return ret; - } - if (mApi == nullptr) { - LOC_LOGE("%s]: mApi is nullptr", __FUNCTION__); - return ret; - } - - mGnssMeasurementCbIface_1_1 = callback; - mGnssMeasurementCbIface_1_1->linkToDeath(mGnssMeasurementDeathRecipient, 0); - - return mApi->measurementSetCallback_1_1(callback); -} - } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/GnssMeasurement.h b/gps/android/GnssMeasurement.h index 373f0d0..4247dbf 100644 --- a/gps/android/GnssMeasurement.h +++ b/gps/android/GnssMeasurement.h @@ -18,21 +18,21 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H -#define ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H -#include +#include #include #include namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { -using ::android::hardware::gnss::V1_1::IGnssMeasurement; -using ::android::hardware::gnss::V1_1::IGnssMeasurementCallback; +using ::android::hardware::gnss::V1_0::IGnssMeasurement; +using ::android::hardware::gnss::V1_0::IGnssMeasurementCallback; using ::android::hardware::Return; using ::android::hardware::Void; using ::android::hardware::hidl_vec; @@ -52,11 +52,6 @@ struct GnssMeasurement : public IGnssMeasurement { const sp& callback) override; Return close() override; - // Methods from ::android::hardware::gnss::V1_1::IGnssMeasurement follow. - Return setCallback_1_1( - const sp& callback, - bool enableFullTracking) override; - private: struct GnssMeasurementDeathRecipient : hidl_death_recipient { GnssMeasurementDeathRecipient(sp gnssMeasurement) : @@ -70,14 +65,13 @@ struct GnssMeasurement : public IGnssMeasurement { private: sp mGnssMeasurementDeathRecipient = nullptr; sp mGnssMeasurementCbIface = nullptr; - sp mGnssMeasurementCbIface_1_1 = nullptr; MeasurementAPIClient* mApi; }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSMEASUREMENT_H +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSMEASUREMENT_H diff --git a/gps/android/GnssNi.cpp b/gps/android/GnssNi.cpp index 5ce9569..d06cc20 100644 --- a/gps/android/GnssNi.cpp +++ b/gps/android/GnssNi.cpp @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { void GnssNi::GnssNiDeathRecipient::serviceDied(uint64_t cookie, const wp& who) { @@ -79,7 +79,7 @@ Return GnssNi::respond(int32_t notifId, IGnssNiCallback::GnssUserResponseT } } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/GnssNi.h b/gps/android/GnssNi.h index 6733e5b..90f62d5 100644 --- a/gps/android/GnssNi.h +++ b/gps/android/GnssNi.h @@ -18,8 +18,8 @@ * limitations under the License. */ -#ifndef ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H -#define ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H +#ifndef ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H +#define ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H #include #include @@ -27,7 +27,7 @@ namespace android { namespace hardware { namespace gnss { -namespace V1_1 { +namespace V1_0 { namespace implementation { using ::android::hardware::gnss::V1_0::IGnssNi; @@ -67,9 +67,9 @@ struct GnssNi : public IGnssNi { }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android -#endif // ANDROID_HARDWARE_GNSS_V1_1_GNSSNI_H +#endif // ANDROID_HARDWARE_GNSS_V1_0_GNSSNI_H diff --git a/gps/android/android.hardware.gnss@1.1-service-qti.rc b/gps/android/android.hardware.gnss@1.1-service-qti.rc index 41b105b..b5da6f9 100644 --- a/gps/android/android.hardware.gnss@1.1-service-qti.rc +++ b/gps/android/android.hardware.gnss@1.1-service-qti.rc @@ -1,4 +1,4 @@ -service gnss_service /vendor/bin/hw/android.hardware.gnss@1.1-service-qti +service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti class hal user gps group system gps radio 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 -#include -#include +#include +#include #include #include 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__); @@ -79,18 +76,6 @@ MeasurementAPIClient::measurementSetCallback(const sp -MeasurementAPIClient::measurementSetCallback_1_1(const sp& callback) -{ - LOC_LOGD("%s]: (%p)", __FUNCTION__, &callback); - - mMutex.lock(); - mGnssMeasurementCbIface_1_1 = callback; - mMutex.unlock(); - - return startTracking(); -} - Return MeasurementAPIClient::startTracking() { @@ -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 gnssMeasurementCbIface = nullptr; - sp 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 -#include -#include +#include +#include #include #include 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 measurementSetCallback( const sp& callback); - Return measurementSetCallback_1_1( - const sp& callback); void measurementClose(); Return startTracking(); @@ -66,13 +64,12 @@ public: private: std::mutex mMutex; sp mGnssMeasurementCbIface; - sp mGnssMeasurementCbIface_1_1; bool mTracking; }; } // namespace implementation -} // namespace V1_1 +} // namespace V1_0 } // namespace gnss } // namespace hardware } // namespace android diff --git a/gps/android/service.cpp b/gps/android/service.cpp index 72cb4e9..c03b7ea 100644 --- a/gps/android/service.cpp +++ b/gps/android/service.cpp @@ -23,7 +23,7 @@ #include #include -using android::hardware::gnss::V1_1::IGnss; +using android::hardware::gnss::V1_0::IGnss; using android::hardware::defaultPassthroughServiceImplementation; int main() { diff --git a/gps/gnss/GnssAdapter.cpp b/gps/gnss/GnssAdapter.cpp index 751c148..6df8e12 100644 --- a/gps/gnss/GnssAdapter.cpp +++ b/gps/gnss/GnssAdapter.cpp @@ -766,8 +766,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = mApi.setGpsLock(mConfig.gpsLock); } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) { uint32_t newSuplVersion = mAdapter.convertSuplVersion(mConfig.suplVersion); @@ -779,8 +780,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) { if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) { @@ -808,8 +810,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_INVALID_PARAMETER; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) { uint32_t newLppProfile = mAdapter.convertLppProfile(mConfig.lppProfile); @@ -821,8 +824,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) { uint32_t newLppeControlPlaneMask = @@ -834,8 +838,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) { uint32_t newLppeUserPlaneMask = @@ -847,8 +852,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) { uint32_t newAGloProtMask = @@ -861,8 +867,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) err = LOCATION_ERROR_SUCCESS; } if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) { uint32_t newEP4ES = mAdapter.convertEP4ES(mConfig.emergencyPdnForEmergencySupl); @@ -871,8 +878,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } err = LOCATION_ERROR_SUCCESS; if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) { uint32_t newSuplEs = mAdapter.convertSuplEs(mConfig.suplEmergencyServices); @@ -881,8 +889,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } err = LOCATION_ERROR_SUCCESS; if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) { uint32_t newSuplMode = mAdapter.convertSuplMode(mConfig.suplModeMask); @@ -894,8 +903,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config) } err = LOCATION_ERROR_SUCCESS; if (index < mCount) { - errs[index++] = err; + errs[index] = err; } + index++; } mAdapter.reportResponse(index, errs, mIds); @@ -1957,7 +1967,6 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) } else if (powerVoteId > 0) { err = LOCATION_ERROR_ALREADY_STARTED; } else { - mContext.modemPowerVote(true); mAdapter.setPowerVoteId(mSessionId); mApi.setGpsLock(GNSS_CONFIG_GPS_LOCK_NONE); mAdapter.mXtraObserver.updateLockStatus( @@ -1969,6 +1978,7 @@ GnssAdapter::enableCommand(LocationTechnologyType techType) if (mContext != NULL) { sendMsg(new MsgEnableGnss(*this, *mLocApi, *mContext, sessionId, techType)); + mContext->modemPowerVote(true); } else { LOC_LOGE("%s]: Context is NULL", __func__); } @@ -2001,7 +2011,6 @@ GnssAdapter::disableCommand(uint32_t id) if (powerVoteId != mSessionId) { err = LOCATION_ERROR_ID_UNKNOWN; } else { - mContext.modemPowerVote(false); mAdapter.setPowerVoteId(0); mApi.setGpsLock(mAdapter.convertGpsLock(ContextBase::mGps_conf.GPS_LOCK)); mAdapter.mXtraObserver.updateLockStatus( @@ -2013,6 +2022,7 @@ GnssAdapter::disableCommand(uint32_t id) if (mContext != NULL) { sendMsg(new MsgDisableGnss(*this, *mLocApi, *mContext, id)); + mContext->modemPowerVote(false); } } -- cgit v1.2.3