diff options
author | Thierry Strudel <tstrudel@google.com> | 2017-06-03 16:42:16 -0700 |
---|---|---|
committer | Thierry Strudel <tstrudel@google.com> | 2017-06-03 16:54:05 -0700 |
commit | 9303eecade933165393766fa4c5f86b1d33010bf (patch) | |
tree | 1bfbb7cc2e6a0c374d77d741e5fc3cdf973010f0 | |
parent | 6f47faba41757dbbc961d01dd30632509b70ae40 (diff) | |
download | gps-9303eecade933165393766fa4c5f86b1d33010bf.tar.gz |
msm8998: Update to 07.00.00.279.194
.: from hardware/qcom/gps/msm8998
e433f1f5 Merge "Fix intermittant crashes in location"
cdff2d1f Merge "remove inet group"
be823cc7 Fix intermittant crashes in location
8cae1270 remove inet group
7a79d425 Remove libandroid_runtime for treble compliance
fe731b68 Merge "Fix for incorrect SVids and timestamps in bugreport"
f7763211 Fix for incorrect SVids and timestamps in bugreport
Test: build, boot, sanity checks
Bug: 62319031
Change-Id: Ie63a1aafaa6467d70ed2adcef3cd664c2606b3dd
Signed-off-by: Thierry Strudel <tstrudel@google.com>
12 files changed, 35 insertions, 123 deletions
diff --git a/msm8998/CleanSpec.mk b/msm8998/CleanSpec.mk index b702a63..dd1849d 100644 --- a/msm8998/CleanSpec.mk +++ b/msm8998/CleanSpec.mk @@ -48,5 +48,3 @@ # NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST # ************************************************ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libloc_api*) - -$(call add-clean-step, rm -rf $(PRODUCT_OUT)/system/etc/init/android.hardware.gnss@1.0-service-qti.rc) diff --git a/msm8998/android/Android.mk b/msm8998/android/Android.mk index c7e7c5a..849fb95 100644 --- a/msm8998/android/Android.mk +++ b/msm8998/android/Android.mk @@ -2,9 +2,10 @@ LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-impl-qti +LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 LOCAL_MODULE_OWNER := qti LOCAL_MODULE_RELATIVE_PATH := hw -LOCAL_PROPRIETARY_MODULE := true LOCAL_SRC_FILES := \ AGnss.cpp \ Gnss.cpp \ @@ -49,10 +50,10 @@ include $(BUILD_SHARED_LIBRARY) include $(CLEAR_VARS) LOCAL_MODULE := android.hardware.gnss@1.0-service-qti +LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR_EXECUTABLES) LOCAL_MODULE_OWNER := qti LOCAL_MODULE_RELATIVE_PATH := hw LOCAL_INIT_RC := android.hardware.gnss@1.0-service-qti.rc -LOCAL_PROPRIETARY_MODULE := true LOCAL_SRC_FILES := \ service.cpp \ diff --git a/msm8998/android/GnssDebug.cpp b/msm8998/android/GnssDebug.cpp index e6f59df..ff467d3 100644 --- a/msm8998/android/GnssDebug.cpp +++ b/msm8998/android/GnssDebug.cpp @@ -30,7 +30,7 @@ namespace implementation { using ::android::hardware::hidl_vec; -#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800ULL) // 1/1/2017 00:00 GMT +#define GNSS_DEBUG_UNKNOWN_UTC_TIME (1483228800000ULL) // 1/1/2017 00:00 GMT #define GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC (1.57783680E17) // 5 years in ns GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) @@ -45,7 +45,7 @@ GnssDebug::GnssDebug(Gnss* gnss) : mGnss(gnss) */ Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb) { - LOC_LOGI("GnssDebug - 0426a"); + LOC_LOGD("%s]: ", __func__); DebugData data = { }; @@ -78,21 +78,14 @@ Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb) reports.mLocation.speedAccuracyMetersPerSecond; data.position.bearingAccuracyDegrees = reports.mLocation.bearingAccuracyDegrees; - LOC_LOGI("GnssDebug - lat=%f lon=%f", - data.position.latitudeDegrees, data.position.longitudeDegrees); timeval tv_now, tv_report; - tv_report.tv_sec = reports.mLocation.mLocation.timestamp / 1000ULL; - tv_report.tv_usec = - (reports.mLocation.mLocation.timestamp % 1000ULL) * 1000ULL; + tv_report.tv_sec = reports.mLocation.mUtcReported.tv_sec; + tv_report.tv_usec = reports.mLocation.mUtcReported.tv_nsec / 1000ULL; gettimeofday(&tv_now, NULL); data.position.ageSeconds = (tv_now.tv_sec - tv_report.tv_sec) + (float)((tv_now.tv_usec - tv_report.tv_usec)) / 1000000; - - LOC_LOGI("GnssDebug - time now=%lld:%lld", tv_now.tv_sec, tv_now.tv_usec); - LOC_LOGI("GnssDebug - time rep=%lld:%lld",tv_report.tv_sec, tv_report.tv_usec); - LOC_LOGI("GnssDebug - age=%f", data.position.ageSeconds); } else { data.position.valid = false; @@ -110,7 +103,6 @@ Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb) data.time.timeUncertaintyNs = (float)(GNSS_DEBUG_UNKNOWN_UTC_TIME_UNC); data.time.frequencyUncertaintyNsPerSec = 0; } - LOC_LOGI("GnssDebug - timeestimate=%lld", data.time.timeEstimate); // satellite data block SatelliteData s = { }; @@ -138,12 +130,9 @@ Return<void> GnssDebug::getDebugData(getDebugData_cb _hidl_cb) s_array.push_back(s); } data.satelliteDataArray = s_array; - LOC_LOGI("GnssDebug - satellite=%d", data.satelliteDataArray.size()); // callback HIDL with collected debug data _hidl_cb(data); - - LOC_LOGI("GnssDebug - done"); return Void(); } diff --git a/msm8998/android/android.hardware.gnss@1.0-service-qti.rc b/msm8998/android/android.hardware.gnss@1.0-service-qti.rc index a875ad6..b5da6f9 100644 --- a/msm8998/android/android.hardware.gnss@1.0-service-qti.rc +++ b/msm8998/android/android.hardware.gnss@1.0-service-qti.rc @@ -1,4 +1,4 @@ service gnss_service /vendor/bin/hw/android.hardware.gnss@1.0-service-qti class hal user gps - group system gps inet radio + group system gps radio diff --git a/msm8998/core/SystemStatus.cpp b/msm8998/core/SystemStatus.cpp index f4f07f2..80406f6 100644 --- a/msm8998/core/SystemStatus.cpp +++ b/msm8998/core/SystemStatus.cpp @@ -181,11 +181,12 @@ public: SystemStatusPQWM1parser(const char *str_in, uint32_t len_in) : SystemStatusNmeaBase(str_in, len_in) { + memset(&mM1, 0, sizeof(mM1)); if (mField.size() < eMax) { LOC_LOGE("PQWM1parser - invalid size=%d", mField.size()); + mM1.mTimeValid = 0; return; } - memset(&mM1, 0, sizeof(mM1)); mM1.mGpsWeek = atoi(mField[eGpsWeek].c_str()); mM1.mGpsTowMs = atoi(mField[eGpsTowMs].c_str()); mM1.mTimeValid = atoi(mField[eTimeValid].c_str()); diff --git a/msm8998/gnss/GnssAdapter.cpp b/msm8998/gnss/GnssAdapter.cpp index 472a5d3..3df4f64 100644 --- a/msm8998/gnss/GnssAdapter.cpp +++ b/msm8998/gnss/GnssAdapter.cpp @@ -1786,7 +1786,7 @@ GnssAdapter::reportPositionEvent(const UlpLocation& ulpLocation, inline virtual void proc() const { // extract bug report info - this returns true if consumed by systemstatus SystemStatus* s = LocDualContext::getSystemStatus(); - if (nullptr != s) { + if ((nullptr != s) && (LOC_SESS_SUCCESS == mStatus)){ s->eventPosition(mUlpLocation, mLocationExtended); } mAdapter.reportPosition(mUlpLocation, mLocationExtended, mStatus, mTechMask); @@ -2590,7 +2590,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector<GnssDebugSatelliteInfo>& out, // set constellationi based parameters switch (in_constellation) { case GNSS_SV_TYPE_GPS: - svid_min = GPS_MIN; + svid_min = GNSS_BUGREPORT_GPS_MIN; svid_num = GPS_NUM; svid_idx = 0; if (!in.mSvHealth.empty()) { @@ -2603,7 +2603,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector<GnssDebugSatelliteInfo>& out, } break; case GNSS_SV_TYPE_GLONASS: - svid_min = GLO_MIN; + svid_min = GNSS_BUGREPORT_GLO_MIN; svid_num = GLO_NUM; svid_idx = GPS_NUM; if (!in.mSvHealth.empty()) { @@ -2616,7 +2616,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector<GnssDebugSatelliteInfo>& out, } break; case GNSS_SV_TYPE_QZSS: - svid_min = QZSS_MIN; + svid_min = GNSS_BUGREPORT_QZSS_MIN; svid_num = QZSS_NUM; svid_idx = GPS_NUM+GLO_NUM; if (!in.mSvHealth.empty()) { @@ -2629,7 +2629,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector<GnssDebugSatelliteInfo>& out, } break; case GNSS_SV_TYPE_BEIDOU: - svid_min = BDS_MIN; + svid_min = GNSS_BUGREPORT_BDS_MIN; svid_num = BDS_NUM; svid_idx = GPS_NUM+GLO_NUM+QZSS_NUM; if (!in.mSvHealth.empty()) { @@ -2642,7 +2642,7 @@ void GnssAdapter::convertSatelliteInfo(std::vector<GnssDebugSatelliteInfo>& out, } break; case GNSS_SV_TYPE_GALILEO: - svid_min = GAL_MIN; + svid_min = GNSS_BUGREPORT_GAL_MIN; svid_num = GAL_NUM; svid_idx = GPS_NUM+GLO_NUM+QZSS_NUM+BDS_NUM; if (!in.mSvHealth.empty()) { @@ -2746,8 +2746,8 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) r.mLocation.bearingAccuracyDegrees = reports.mLocation.back().mLocationEx.bearing_unc; - r.mLocation.mLocation.timestamp = - reports.mLocation.back().mLocation.gpsLocation.timestamp; + r.mLocation.mUtcReported = + reports.mLocation.back().mUtcReported; } else if(!reports.mBestPosition.empty()) { r.mLocation.mValid = true; @@ -2776,11 +2776,11 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) // time block r.mTime.size = sizeof(r.mTime); - if(!reports.mTimeAndClock.empty()) { + if(!reports.mTimeAndClock.empty() && reports.mTimeAndClock.back().mTimeValid) { r.mTime.mValid = true; r.mTime.timeEstimate = (((int64_t)(reports.mTimeAndClock.back().mGpsWeek)*7 + - GNSS_UTC_TIME_OFFSET)*24*60*60 + + GNSS_UTC_TIME_OFFSET)*24*60*60 - (int64_t)(reports.mTimeAndClock.back().mLeapSeconds))*1000ULL + (int64_t)(reports.mTimeAndClock.back().mGpsTowMs); @@ -2789,7 +2789,9 @@ bool GnssAdapter::getDebugReport(GnssDebugReport& r) reports.mTimeAndClock.back().mLeapSecUnc)*1000); r.mTime.frequencyUncertaintyNsPerSec = (float)(reports.mTimeAndClock.back().mClockFreqBiasUnc); - LOC_LOGV("getDebugReport - timeestimate=%ld", r.mTime.timeEstimate); + LOC_LOGV("getDebugReport - timeestimate=%ld unc=%f frequnc=%f", + r.mTime.timeEstimate, + r.mTime.timeUncertaintyNs, r.mTime.frequencyUncertaintyNsPerSec); } else { r.mTime.mValid = false; diff --git a/msm8998/location/LocationAPI.h b/msm8998/location/LocationAPI.h index 29c05f2..d128d5e 100644 --- a/msm8998/location/LocationAPI.h +++ b/msm8998/location/LocationAPI.h @@ -39,6 +39,13 @@ #define GNSS_MEASUREMENTS_MAX 64 #define GNSS_UTC_TIME_OFFSET (3657) +#define GNSS_BUGREPORT_GPS_MIN (1) +#define GNSS_BUGREPORT_SBAS_MIN (120) +#define GNSS_BUGREPORT_GLO_MIN (1) +#define GNSS_BUGREPORT_QZSS_MIN (193) +#define GNSS_BUGREPORT_BDS_MIN (1) +#define GNSS_BUGREPORT_GAL_MIN (1) + typedef enum { LOCATION_ERROR_SUCCESS = 0, LOCATION_ERROR_GENERAL_FAILURE, @@ -584,6 +591,7 @@ typedef struct { double verticalAccuracyMeters; double speedAccuracyMetersPerSecond; double bearingAccuracyDegrees; + timespec mUtcReported; } GnssDebugLocation; typedef struct { diff --git a/msm8998/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h b/msm8998/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h deleted file mode 100644 index 9a954f0..0000000 --- a/msm8998/utils/platform_lib_abstractions/loc_pla/include/platform_lib_android_runtime.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __PLATFORM_LIB_ANDROID_RUNTIME_H__ -#define __PLATFORM_LIB_ANDROID_RUNTIME_H__ - -#include <pthread.h> - -#ifdef __cplusplus -extern "C" { -#endif - -pthread_t platform_lib_abstraction_createJavaThread(const char* name, void (*start)(void *), void* arg); -#define LOC_EXT_CREATE_THREAD_CB_PLATFORM_LIB_ABSTRACTION platform_lib_abstraction_createJavaThread - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /*__PLATFORM_LIB_ANDROID_RUNTIME_H__ */ diff --git a/msm8998/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h b/msm8998/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h index 47c37df..ebb7119 100644 --- a/msm8998/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h +++ b/msm8998/utils/platform_lib_abstractions/loc_pla/include/platform_lib_includes.h @@ -29,7 +29,6 @@ #ifndef __PLATFORM_LIB_INCLUDES_H__ #define __PLATFORM_LIB_INCLUDES_H__ -#include "platform_lib_android_runtime.h" #include "platform_lib_gettid.h" #include "platform_lib_log_util.h" #include "platform_lib_macros.h" diff --git a/msm8998/utils/platform_lib_abstractions/loc_pla/src/Android.mk b/msm8998/utils/platform_lib_abstractions/loc_pla/src/Android.mk index 488e613..3920139 100644 --- a/msm8998/utils/platform_lib_abstractions/loc_pla/src/Android.mk +++ b/msm8998/utils/platform_lib_abstractions/loc_pla/src/Android.mk @@ -11,11 +11,9 @@ LOCAL_SHARED_LIBRARIES := \ libutils \ libcutils \ liblog \ - libloc_stub \ - libandroid_runtime + libloc_stub LOCAL_SRC_FILES += \ - platform_lib_android_runtime.cpp \ platform_lib_gettid.cpp \ platform_lib_log_util.cpp \ platform_lib_property_service.cpp \ @@ -35,7 +33,6 @@ LOCAL_C_INCLUDES:= \ LOCAL_COPY_HEADERS_TO:= libloc_pla/ LOCAL_COPY_HEADERS:= \ - ../include/platform_lib_android_runtime.h \ ../include/platform_lib_gettid.h \ ../include/platform_lib_includes.h \ ../include/platform_lib_log_util.h \ diff --git a/msm8998/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp b/msm8998/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp deleted file mode 100644 index 090af13..0000000 --- a/msm8998/utils/platform_lib_abstractions/loc_pla/src/platform_lib_android_runtime.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright (c) 2014, The Linux Foundation. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of The Linux Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE - * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN - * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include "platform_lib_android_runtime.h" - -#ifdef USE_GLIB -#include <loc_stub_android_runtime.h> -#else -#include <android_runtime/AndroidRuntime.h> -#endif /* USE_GLIB */ - -pthread_t platform_lib_abstraction_createJavaThread(const char* name, void (*start)(void *), void* arg) -{ - return (pthread_t)android::AndroidRuntime::createJavaThread(name, start, arg); -} diff --git a/msm8998/utils/platform_lib_abstractions/loc_stub/src/Android.mk b/msm8998/utils/platform_lib_abstractions/loc_stub/src/Android.mk index 51e5f41..ab2ba4f 100644 --- a/msm8998/utils/platform_lib_abstractions/loc_stub/src/Android.mk +++ b/msm8998/utils/platform_lib_abstractions/loc_stub/src/Android.mk @@ -41,7 +41,9 @@ LOCAL_COPY_HEADERS:= \ ../include/loc_stub_time.h LOCAL_MODULE := libloc_stub -LOCAL_VENDOR_MODULE := true +LOCAL_MODULE_PATH_32 := $(TARGET_OUT_VENDOR)/lib +LOCAL_MODULE_PATH_64 := $(TARGET_OUT_VENDOR)/lib64 +LOCAL_MODULE_OWNER := qti LOCAL_MODULE_TAGS := optional LOCAL_PRELINK_MODULE := false |