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/Gnss.cpp | 113 +-------------------------------------------------- 1 file changed, 2 insertions(+), 111 deletions(-) (limited to 'gps/android/Gnss.cpp') 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 -- cgit v1.2.3