otter: gps/location: Update to LA.UM.9.14.1.r1-13200-QCM6490.QSSI14.0
Change-Id: I5165374321f12d7fc260c2c261582daab10bd3d9
diff --git a/gps/android/1.1/Gnss.cpp b/gps/android/1.1/Gnss.cpp
index 537f6a6..b5ce11a 100644
--- a/gps/android/1.1/Gnss.cpp
+++ b/gps/android/1.1/Gnss.cpp
@@ -380,7 +380,8 @@
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
- gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
+ gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
+ (EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
}
return setCallback(callback);
}
diff --git a/gps/android/2.0/Gnss.cpp b/gps/android/2.0/Gnss.cpp
index 823ef6e..8fad5d6 100644
--- a/gps/android/2.0/Gnss.cpp
+++ b/gps/android/2.0/Gnss.cpp
@@ -446,7 +446,8 @@
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
- gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
+ gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
+ (EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
}
GnssAPIClient* api = getApi();
@@ -579,7 +580,8 @@
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
- gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
+ gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
+ (EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
}
GnssAPIClient* api = getApi();
diff --git a/gps/android/2.1/Gnss.cpp b/gps/android/2.1/Gnss.cpp
index e24c81e..6eed280 100644
--- a/gps/android/2.1/Gnss.cpp
+++ b/gps/android/2.1/Gnss.cpp
@@ -459,7 +459,8 @@
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
- gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
+ gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
+ (EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
}
GnssAPIClient* api = getApi();
@@ -610,7 +611,8 @@
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
- gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
+ gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
+ (EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
}
GnssAPIClient* api = getApi();
@@ -748,7 +750,8 @@
OdcpiRequestCallback cb = [this](const OdcpiRequestInfo& odcpiRequest) {
odcpiRequestCb(odcpiRequest);
};
- gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW);
+ gnssInterface->odcpiInit(cb, OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW,
+ (EMERGENCY_ODCPI | NON_EMERGENCY_ODCPI));
}
GnssAPIClient* api = getApi();
diff --git a/gps/android/2.1/android.hardware.gnss@2.1-service-qti.rc b/gps/android/2.1/android.hardware.gnss@2.1-service-qti.rc
index 19e32c4..4f0a02f 100644
--- a/gps/android/2.1/android.hardware.gnss@2.1-service-qti.rc
+++ b/gps/android/2.1/android.hardware.gnss@2.1-service-qti.rc
@@ -1,4 +1,4 @@
service gnss_service /vendor/bin/hw/android.hardware.gnss@2.1-service-qti
class hal
user gps
- group system gps radio vendor_qti_diag
+ group system gps radio vendor_qti_diag inet
diff --git a/gps/core/ContextBase.cpp b/gps/core/ContextBase.cpp
index 87e98dc..fa457dc 100644
--- a/gps/core/ContextBase.cpp
+++ b/gps/core/ContextBase.cpp
@@ -26,6 +26,43 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
+/*
+Changes from Qualcomm Innovation Center are provided under the following license:
+
+Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted (subject to the limitations in the
+disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
+*/
+
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_CtxBase"
@@ -51,6 +88,7 @@
uint8_t ContextBase::sFeaturesSupported[MAX_FEATURE_LENGTH];
GnssNMEARptRate ContextBase::sNmeaReportRate = GNSS_NMEA_REPORT_RATE_NHZ;
LocationCapabilitiesMask ContextBase::sQwesFeatureMask = 0;
+LocationCapabilitiesMask ContextBase::sHwCapabilitiesMask = 0;
const loc_param_s_type ContextBase::mGps_conf_table[] =
{
diff --git a/gps/core/ContextBase.h b/gps/core/ContextBase.h
index 34cad60..c902598 100644
--- a/gps/core/ContextBase.h
+++ b/gps/core/ContextBase.h
@@ -26,6 +26,42 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
+/*
+Changes from Qualcomm Innovation Center are provided under the following license:
+
+Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted (subject to the limitations in the
+disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 __LOC_CONTEXT_BASE__
#define __LOC_CONTEXT_BASE__
@@ -158,7 +194,10 @@
return mLBSProxy->getIzatDevId();
}
inline void sendMsg(const LocMsg *msg) { getMsgTask()->sendMsg(msg); }
-
+ inline bool checkFeatureStatus(int* fids,
+ LocFeatureStatus* status, uint32_t idCount, bool directQwesCall = false) const {
+ return mLocApiProxy->checkFeatureStatus(fids, status, idCount, directQwesCall);
+ }
static loc_gps_cfg_s_type mGps_conf;
static loc_sap_cfg_s_type mSap_conf;
static bool sIsEngineCapabilitiesKnown;
@@ -167,6 +206,7 @@
static bool sGnssMeasurementSupported;
static GnssNMEARptRate sNmeaReportRate;
static LocationCapabilitiesMask sQwesFeatureMask;
+ static LocationHwCapabilitiesMask sHwCapabilitiesMask;
void readConfig();
static uint32_t getCarrierCapabilities();
@@ -273,6 +313,27 @@
sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_VPE;
}
break;
+ case LOCATION_QWES_FEATURE_TYPE_DGNSS:
+ if (itr->second) {
+ sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_DGNSS;
+ } else {
+ sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_DGNSS;
+ }
+ break;
+ case LOCATION_QWES_FEATURE_TYPE_RSSI_POSITIONING:
+ if (itr->second) {
+ sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_WIFI_RSSI_POSITIONING;
+ } else {
+ sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_WIFI_RSSI_POSITIONING;
+ }
+ break;
+ case LOCATION_QWES_FEATURE_TYPE_RTT_POSITIONING:
+ if (itr->second) {
+ sQwesFeatureMask |= LOCATION_CAPABILITIES_QWES_WIFI_RTT_POSITIONING;
+ } else {
+ sQwesFeatureMask &= ~LOCATION_CAPABILITIES_QWES_WIFI_RTT_POSITIONING;
+ }
+ break;
}
}
@@ -310,7 +371,19 @@
return (ContextBase::sQwesFeatureMask);
}
+ /*
+ set HW feature status info
+ */
+ static inline void setHwCapabilities(const LocationHwCapabilitiesMask& mask) {
+ sHwCapabilitiesMask |= mask;
+ }
+ /*
+ get HW feature status info
+ */
+ static inline LocationHwCapabilitiesMask getHwCapabilitiesMask() {
+ return (ContextBase::sHwCapabilitiesMask);
+ }
};
struct LocApiResponse: LocMsg {
diff --git a/gps/core/EngineHubProxyBase.h b/gps/core/EngineHubProxyBase.h
index 468a8f0..47a2835 100644
--- a/gps/core/EngineHubProxyBase.h
+++ b/gps/core/EngineHubProxyBase.h
@@ -33,6 +33,7 @@
#else
#include <unordered_map>
#endif
+#include <ContextBase.h>
namespace loc_core {
@@ -148,6 +149,7 @@
// callback function to report back dr and ppe position and sv report
typedef EngineHubProxyBase* (getEngHubProxyFn)(
const MsgTask * msgTask,
+ const ContextBase * context,
IOsObserver* osObserver,
GnssAdapterReportEnginePositionsEventCb positionEventCb,
GnssAdapterReportSvEventCb svEventCb,
diff --git a/gps/core/LocAdapterBase.cpp b/gps/core/LocAdapterBase.cpp
index 62d4aa8..94edd58 100644
--- a/gps/core/LocAdapterBase.cpp
+++ b/gps/core/LocAdapterBase.cpp
@@ -26,6 +26,43 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
+/*
+Changes from Qualcomm Innovation Center are provided under the following license:
+
+Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted (subject to the limitations in the
+disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
+*/
+
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_LocAdapterBase"
@@ -322,6 +359,19 @@
if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_EDGNSS)) {
mask |= LOCATION_CAPABILITIES_EDGNSS_BIT;
}
+ if ((ContextBase::getQwesFeatureStatus() & LOCATION_CAPABILITIES_QWES_PPE)) {
+ mask |= LOCATION_CAPABILITIES_QWES_PPE;
+ }
+ //Get QWES feature status mask
+ mask |= ContextBase::getQwesFeatureStatus();
+ //Get HW feature status mask
+ LocationHwCapabilitiesMask hwMask = ContextBase::getHwCapabilitiesMask();
+ if ((hwMask & LOCATION_WIFI_CAPABILITY_RTT) != 0) {
+ mask |= LOCATION_CAPABILITIES_WIFI_RTT_POSITIONING;
+ }
+ if ((hwMask & LOCATION_WIFI_CAPABILITY_RSSI) != 0) {
+ mask |= LOCATION_CAPABILITIES_WIFI_RSSI_POSITIONING;
+ }
} else {
LOC_LOGE("%s]: attempt to get capabilities before they are known.", __func__);
}
diff --git a/gps/core/LocApiBase.cpp b/gps/core/LocApiBase.cpp
index b1d4b1b..70f6670 100644
--- a/gps/core/LocApiBase.cpp
+++ b/gps/core/LocApiBase.cpp
@@ -489,6 +489,8 @@
const std::unordered_map<LocationQwesFeatureType, bool> &featureMap
)
{
+ //Set Qwes feature status map in ContextBase
+ ContextBase::setQwesFeatureStatus(featureMap);
// loop through adapters, and deliver to all adapters.
TO_ALL_LOCADAPTERS(mLocAdapters[i]->reportQwesCapabilities(featureMap));
}
@@ -1034,7 +1036,7 @@
struct timespec sinceBootTime;
struct timespec sinceBootTimeTest;
bool clockGetTimeSuccess = false;
- const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 15000;
+ const uint32_t MAX_TIME_DELTA_VALUE_NANOS = 2000000; // 2 milli-seconds
const uint32_t MAX_GET_TIME_COUNT = 20;
/* Attempt to get CLOCK_REALTIME and CLOCK_BOOTIME in succession without an interruption
or context switch (for up to MAX_GET_TIME_COUNT times) to avoid errors in the calculation */
diff --git a/gps/core/LocApiBase.h b/gps/core/LocApiBase.h
index 08dfbe4..68a93a6 100644
--- a/gps/core/LocApiBase.h
+++ b/gps/core/LocApiBase.h
@@ -26,6 +26,44 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
+ /*
+ Changes from Qualcomm Innovation Center are provided under the following license:
+
+ Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted (subject to the limitations in the
+ disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+ NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+ GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+ HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 LOC_API_BASE_H
#define LOC_API_BASE_H
@@ -102,6 +140,8 @@
inline virtual double getGloRfLoss(uint32_t left __unused,
uint32_t center __unused, uint32_t right __unused, uint8_t gloFrequency __unused) { return 0.0; }
inline virtual float getGeoidalSeparation(double latitude __unused, double longitude __unused) { return 0.0; }
+ inline virtual bool checkFeatureStatus(int* fids __unused, LocFeatureStatus* status __unused,
+ uint32_t idCount __unused, bool directQwesCall __unused = false) {return false;}
};
class LocApiBase {
@@ -136,14 +176,17 @@
}
bool isInSession();
const LOC_API_ADAPTER_EVENT_MASK_T mExcludedMask;
- bool isMaster();
public:
+ bool isMaster();
inline void sendMsg(const LocMsg* msg) const {
if (nullptr != mMsgTask) {
mMsgTask->sendMsg(msg);
}
}
+ inline MsgTask* getMsgTask() const {
+ return mMsgTask;
+ }
inline void destroy() {
close();
struct LocKillMsg : public LocMsg {
diff --git a/gps/core/SystemStatus.cpp b/gps/core/SystemStatus.cpp
index 236d2b7..7c9789a 100644
--- a/gps/core/SystemStatus.cpp
+++ b/gps/core/SystemStatus.cpp
@@ -1575,6 +1575,11 @@
ret = setIteminReport(mCache.mManufacturer,
SystemStatusManufacturer(*(static_cast<ManufacturerDataItem*>(dataitem))));
break;
+ case IN_EMERGENCY_CALL_DATA_ITEM_ID:
+ ret = setIteminReport(mCache.mInEmergencyCall,
+ SystemStatusInEmergencyCall(
+ *(static_cast<InEmergencyCallDataItem*>(dataitem))));
+ break;
case ASSISTED_GPS_DATA_ITEM_ID:
ret = setIteminReport(mCache.mAssistedGps,
SystemStatusAssistedGps(*(static_cast<AssistedGpsDataItem*>(dataitem))));
@@ -1619,6 +1624,11 @@
ret = setIteminReport(mCache.mBtLeDeviceScanDetail, SystemStatusBtleDeviceScanDetail(
*(static_cast<BtLeDeviceScanDetailsDataItem*>(dataitem))));
break;
+ case LOC_FEATURE_STATUS_DATA_ITEM_ID:
+ ret = setIteminReport(mCache.mLocFeatureStatus,
+ SystemStatusLocFeatureStatus(
+ *(static_cast<LocFeatureStatusDataItem*>(dataitem))));
+ break;
default:
break;
}
@@ -1822,5 +1832,32 @@
mSysStatusObsvr.notify({&s.mDataItem});
return true;
}
+
+/******************************************************************************
+@brief API to update Location feature QWES status
+
+@param[In] Location feature QWES status
+
+@return true when successfully done
+******************************************************************************/
+bool SystemStatus::eventLocFeatureStatus(std::unordered_set<int> fids) {
+ SystemStatusLocFeatureStatus s(fids);
+ mSysStatusObsvr.notify({&s.mDataItem});
+ return true;
+}
+
+/******************************************************************************
+@brief API to notify emergency call
+
+@param[In] is emergency call
+
+@return true when successfully done
+******************************************************************************/
+bool SystemStatus::eventInEmergencyCall(bool isEmergency)
+{
+ SystemStatusInEmergencyCall s(isEmergency);
+ mSysStatusObsvr.notify({&s.mDataItem});
+ return true;
+}
} // namespace loc_core
diff --git a/gps/core/SystemStatus.h b/gps/core/SystemStatus.h
index 158bd99..587a104 100644
--- a/gps/core/SystemStatus.h
+++ b/gps/core/SystemStatus.h
@@ -824,6 +824,38 @@
}
};
+class SystemStatusLocFeatureStatus : public SystemStatusItemBase {
+public:
+ LocFeatureStatusDataItem mDataItem;
+ inline SystemStatusLocFeatureStatus(std::unordered_set<int> fids) : mDataItem(fids) {}
+ inline SystemStatusLocFeatureStatus(const LocFeatureStatusDataItem& itemBase):
+ mDataItem(itemBase) {}
+ inline bool equals(const SystemStatusItemBase& peer) override {
+ return mDataItem.mFids ==
+ ((const SystemStatusLocFeatureStatus&)peer).mDataItem.mFids;
+ }
+ inline void dump(void) override {
+ string str;
+ mDataItem.stringify(str);
+ LOC_LOGd("Location feature qwes status: %s", str.c_str());
+ }
+};
+
+class SystemStatusInEmergencyCall : public SystemStatusItemBase {
+public:
+ InEmergencyCallDataItem mDataItem;
+ inline SystemStatusInEmergencyCall(bool value = false): mDataItem(value) {}
+ inline SystemStatusInEmergencyCall(const InEmergencyCallDataItem& itemBase):
+ mDataItem(itemBase) {}
+ inline bool equals(const SystemStatusItemBase& peer) override {
+ return mDataItem.mIsEmergency ==
+ ((const SystemStatusInEmergencyCall&)peer).mDataItem.mIsEmergency;
+ }
+ inline void dump(void) override {
+ LOC_LOGd("In Emergency Call: %d", mDataItem.mIsEmergency);
+ }
+};
+
/******************************************************************************
SystemStatusReports
******************************************************************************/
@@ -863,6 +895,7 @@
std::vector<SystemStatusServiceStatus> mServiceStatus;
std::vector<SystemStatusModel> mModel;
std::vector<SystemStatusManufacturer> mManufacturer;
+ std::vector<SystemStatusInEmergencyCall> mInEmergencyCall;
std::vector<SystemStatusAssistedGps> mAssistedGps;
std::vector<SystemStatusScreenState> mScreenState;
std::vector<SystemStatusPowerConnectState> mPowerConnectState;
@@ -874,6 +907,7 @@
std::vector<SystemStatusMccMnc> mMccMnc;
std::vector<SystemStatusBtDeviceScanDetail> mBtDeviceScanDetail;
std::vector<SystemStatusBtleDeviceScanDetail> mBtLeDeviceScanDetail;
+ std::vector<SystemStatusLocFeatureStatus> mLocFeatureStatus;
};
/******************************************************************************
@@ -921,6 +955,8 @@
void resetNetworkInfo();
bool eventOptInStatus(bool userConsent);
bool eventRegionStatus(bool region);
+ bool eventLocFeatureStatus(std::unordered_set<int> fids);
+ bool eventInEmergencyCall(bool isEmergency);
};
} // namespace loc_core
diff --git a/gps/core/data-items/DataItemConcreteTypes.cpp b/gps/core/data-items/DataItemConcreteTypes.cpp
index 6267366..6ea3905 100644
--- a/gps/core/data-items/DataItemConcreteTypes.cpp
+++ b/gps/core/data-items/DataItemConcreteTypes.cpp
@@ -126,6 +126,9 @@
#define OEM_GTP_UPLAOD_TRIGGER_READY_FIELD_NAME "OEM-GTP-UPLOAD-TRIGGER-READY"
#define BATTERYLEVEL_FIELD_BATTERY_PCT "BATTERY_PCT"
+#define IN_EMERGENCY_CALL_FIELD_NAME "IS_EMERGENCY"
+#define LOC_FEATURE_STATUS_FIELD_NAME "LOC_FEATURE_STATUS"
+
namespace loc_core
{
// stringify
@@ -577,6 +580,19 @@
EXIT_LOG_WITH_ERROR("%d", result);
return result;
}
+void InEmergencyCallDataItem::stringify(string& valueStr) {
+ int32_t result = 0;
+ ENTRY_LOG();
+ do {
+ STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(
+ InEmergencyCallDataItem, IN_EMERGENCY_CALL_DATA_ITEM_ID);
+ valueStr.clear ();
+ valueStr += IN_EMERGENCY_CALL_FIELD_NAME;
+ valueStr += ": ";
+ valueStr += (d->mIsEmergency) ? ("true") : ("false");
+ } while (0);
+ EXIT_LOG_WITH_ERROR("%d", result);
+}
int32_t ENHDataItem::copyFrom(IDataItemCore* src) {
int32_t result = -1;
ENTRY_LOG();
@@ -921,4 +937,47 @@
EXIT_LOG("%d", result);
return result;
}
+
+void LocFeatureStatusDataItem::stringify(string& valueStr) {
+ int32_t result = 0;
+ ENTRY_LOG();
+ do {
+ STRINGIFY_ERROR_CHECK_AND_DOWN_CAST(
+ LocFeatureStatusDataItem, LOC_FEATURE_STATUS_DATA_ITEM_ID);
+ valueStr.clear ();
+ valueStr += LOC_FEATURE_STATUS_FIELD_NAME;
+ valueStr += ": {";
+ for (int item : d->mFids) {
+ valueStr += std::to_string(item) + ", ";
+ }
+ valueStr += "}";
+ } while (0);
+ EXIT_LOG_WITH_ERROR("%d", result);
+}
+
+int32_t LocFeatureStatusDataItem::copyFrom(IDataItemCore* src) {
+ int32_t result = -1;
+ ENTRY_LOG();
+ do {
+ COPIER_ERROR_CHECK_AND_DOWN_CAST(
+ LocFeatureStatusDataItem, LOC_FEATURE_STATUS_DATA_ITEM_ID);
+ s->mFids = d->mFids;
+ result = 0;
+ } while (0);
+ EXIT_LOG("%d", result);
+ return result;
+}
+
+int32_t InEmergencyCallDataItem::copyFrom(IDataItemCore* src) {
+ int32_t result = -1;
+ ENTRY_LOG();
+ do {
+ COPIER_ERROR_CHECK_AND_DOWN_CAST(
+ InEmergencyCallDataItem, IN_EMERGENCY_CALL_DATA_ITEM_ID);
+ s->mIsEmergency = d->mIsEmergency;
+ result = 0;
+ } while (0);
+ EXIT_LOG("%d", result);
+ return result;
+}
} //namespace loc_core
diff --git a/gps/core/data-items/DataItemConcreteTypes.h b/gps/core/data-items/DataItemConcreteTypes.h
index b42c1f6..17254e2 100644
--- a/gps/core/data-items/DataItemConcreteTypes.h
+++ b/gps/core/data-items/DataItemConcreteTypes.h
@@ -43,7 +43,7 @@
#include <IDataItemCore.h>
#include <gps_extended_c.h>
#include <inttypes.h>
-
+#include <unordered_set>
#define MAC_ADDRESS_LENGTH 6
// MAC address length in bytes
// QMI_LOC_SRN_MAC_ADDR_LENGTH_V02
@@ -629,6 +629,28 @@
uint8_t mBatteryPct;
};
+class LocFeatureStatusDataItem: public IDataItemCore {
+ public:
+ LocFeatureStatusDataItem(std::unordered_set<int> fids) :
+ mFids(fids) {mId = LOC_FEATURE_STATUS_DATA_ITEM_ID;}
+ virtual ~LocFeatureStatusDataItem() {}
+ virtual void stringify(string& /*valueStr*/) override;
+ virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
+ // Data members
+ std::unordered_set<int> mFids;
+};
+
+class InEmergencyCallDataItem: public IDataItemCore {
+public:
+ InEmergencyCallDataItem(bool isEmergency = false) :
+ mIsEmergency(isEmergency) {mId = IN_EMERGENCY_CALL_DATA_ITEM_ID;}
+ virtual ~InEmergencyCallDataItem() {}
+ virtual void stringify(string& /*valueStr*/) override;
+ virtual int32_t copyFrom(IDataItemCore* /*src*/) override;
+ // Data members
+ bool mIsEmergency;
+};
+
} // namespace loc_core
#endif //DATAITEM_CONCRETETYPES_H
diff --git a/gps/core/data-items/DataItemId.h b/gps/core/data-items/DataItemId.h
index 1661be6..00d6998 100644
--- a/gps/core/data-items/DataItemId.h
+++ b/gps/core/data-items/DataItemId.h
@@ -72,6 +72,8 @@
// 26 -
BATTERY_LEVEL_DATA_ITEM_ID,
+ IN_EMERGENCY_CALL_DATA_ITEM_ID,
+ LOC_FEATURE_STATUS_DATA_ITEM_ID,
MAX_DATA_ITEM_ID_1_1,
} DataItemId;
diff --git a/gps/core/data-items/DataItemsFactoryProxy.cpp b/gps/core/data-items/DataItemsFactoryProxy.cpp
index 6ffb997..86c3d34 100644
--- a/gps/core/data-items/DataItemsFactoryProxy.cpp
+++ b/gps/core/data-items/DataItemsFactoryProxy.cpp
@@ -77,6 +77,9 @@
case MANUFACTURER_DATA_ITEM_ID:
mydi = new ManufacturerDataItem(*((ManufacturerDataItem*)dataItem));
break;
+ case IN_EMERGENCY_CALL_DATA_ITEM_ID:
+ mydi = new InEmergencyCallDataItem(*((InEmergencyCallDataItem*)dataItem));
+ break;
case ASSISTED_GPS_DATA_ITEM_ID:
mydi = new AssistedGpsDataItem(*((AssistedGpsDataItem*)dataItem));
break;
@@ -113,6 +116,9 @@
case BATTERY_LEVEL_DATA_ITEM_ID:
mydi = new BatteryLevelDataItem(*((BatteryLevelDataItem*)dataItem));
break;
+ case LOC_FEATURE_STATUS_DATA_ITEM_ID:
+ mydi = new LocFeatureStatusDataItem(*((LocFeatureStatusDataItem*)dataItem));
+ break;
case INVALID_DATA_ITEM_ID:
case MAX_DATA_ITEM_ID:
default:
diff --git a/gps/etc/Android.bp b/gps/etc/Android.bp
index 8f8d493..00cc8af 100644
--- a/gps/etc/Android.bp
+++ b/gps/etc/Android.bp
@@ -43,9 +43,3 @@
src: "seccomp_policy/gnss@2.0-xtwifi-client.policy",
}
-prebuilt_etc {
- name: "gnss@2.0-xtwifi-inet-agent.policy",
- vendor: true,
- sub_dir: "seccomp_policy",
- src: "seccomp_policy/gnss@2.0-xtwifi-inet-agent.policy",
-}
diff --git a/gps/etc/seccomp_policy/gnss@2.0-xtwifi-inet-agent.policy b/gps/etc/seccomp_policy/gnss@2.0-xtwifi-inet-agent.policy
deleted file mode 100644
index 024600a..0000000
--- a/gps/etc/seccomp_policy/gnss@2.0-xtwifi-inet-agent.policy
+++ /dev/null
@@ -1,43 +0,0 @@
-
-#*******************************************************************************
-# Copyright (c) 2020 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.
-#
-#******************************************************************************
-
-unlinkat: 1
-sched_getaffinity: 1
-newfstatat: 1
-fchmodat: 1
-madvise: 1
-mmap: 1
-getuid: 1
-getuid32: 1
-fstat64: 1
-fstatat64: 1
-gettimeofday: 1
-getdents64: 1
diff --git a/gps/gnss/GnssAdapter.cpp b/gps/gnss/GnssAdapter.cpp
index 90d93db..fbc22be 100644
--- a/gps/gnss/GnssAdapter.cpp
+++ b/gps/gnss/GnssAdapter.cpp
@@ -125,6 +125,7 @@
mCallbackPriority(OdcpiPrioritytype::ODCPI_HANDLER_PRIORITY_LOW),
mOdcpiTimer(this),
mOdcpiRequest(),
+ mOdcpiStateMask(0),
mLastDeleteAidingDataTime(0),
mSystemStatus(SystemStatus::getInstance(mMsgTask)),
mServerUrl(":"),
@@ -176,8 +177,7 @@
doneInit();
}
-void
-GnssAdapter::setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks)
+void GnssAdapter::setControlCallbacksCommand(LocationControlCallbacks& controlCallbacks)
{
struct MsgSetControlCallbacks : public LocMsg {
GnssAdapter& mAdapter;
@@ -2690,48 +2690,6 @@
}
}
-LocationCapabilitiesMask
-GnssAdapter::getCapabilities()
-{
- LocationCapabilitiesMask mask = 0;
- uint32_t carrierCapabilities = ContextBase::getCarrierCapabilities();
- // time based tracking always supported
- mask |= LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT;
- // geofence always supported
- mask |= LOCATION_CAPABILITIES_GEOFENCE_BIT;
- if (carrierCapabilities & LOC_GPS_CAPABILITY_MSB) {
- mask |= LOCATION_CAPABILITIES_GNSS_MSB_BIT;
- }
- if (LOC_GPS_CAPABILITY_MSA & carrierCapabilities) {
- mask |= LOCATION_CAPABILITIES_GNSS_MSA_BIT;
- }
- if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_LOCATION_BATCHING)) {
- mask |= LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT |
- LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT;
- }
- if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_DISTANCE_BASE_TRACKING)) {
- mask |= LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT;
- }
- if (ContextBase::isMessageSupported(LOC_API_ADAPTER_MESSAGE_OUTDOOR_TRIP_BATCHING)) {
- mask |= LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT;
- }
- if (ContextBase::gnssConstellationConfig()) {
- mask |= LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT;
- }
- if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_DEBUG_NMEA_V02)) {
- mask |= LOCATION_CAPABILITIES_DEBUG_NMEA_BIT;
- }
- if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_CONSTELLATION_ENABLEMENT_V02)) {
- mask |= LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT;
- }
- if (ContextBase::isFeatureSupported(LOC_SUPPORTED_FEATURE_AGPM_V02)) {
- mask |= LOCATION_CAPABILITIES_AGPM_BIT;
- }
- //Get QWES feature status mask
- mask |= ContextBase::getQwesFeatureStatus();
- return mask;
-}
-
void
GnssAdapter::notifyClientOfCachedLocationSystemInfo(
LocationAPI* client, const LocationCallbacks& callbacks) {
@@ -4822,6 +4780,7 @@
void GnssAdapter::requestOdcpi(const OdcpiRequestInfo& request)
{
if (nullptr != mOdcpiRequestCb) {
+ bool sendEmergencyCallStatusEvent = false;
LOC_LOGd("request: type %d, tbf %d, isEmergency %d"
" requestActive: %d timerActive: %d",
request.type, request.tbfMillis, request.isEmergencyMode,
@@ -4829,23 +4788,26 @@
// ODCPI START and ODCPI STOP from modem can come in quick succession
// so the mOdcpiTimer helps avoid spamming the framework as well as
// extending the odcpi session past 30 seconds if needed
+
if (ODCPI_REQUEST_TYPE_START == request.type) {
- if (false == mOdcpiRequestActive && false == mOdcpiTimer.isActive()) {
- mOdcpiRequestCb(request);
- mOdcpiRequestActive = true;
+ if (!(mOdcpiStateMask & ODCPI_REQ_ACTIVE) && false == mOdcpiTimer.isActive()) {
+ fireOdcpiRequest(request);
+ mOdcpiStateMask |= ODCPI_REQ_ACTIVE;
mOdcpiTimer.start();
+ sendEmergencyCallStatusEvent = true;
// if the current active odcpi session is non-emergency, and the new
// odcpi request is emergency, replace the odcpi request with new request
// and restart the timer
} else if (false == mOdcpiRequest.isEmergencyMode &&
true == request.isEmergencyMode) {
- mOdcpiRequestCb(request);
- mOdcpiRequestActive = true;
+ fireOdcpiRequest(request);
+ mOdcpiStateMask |= ODCPI_REQ_ACTIVE;
if (true == mOdcpiTimer.isActive()) {
mOdcpiTimer.restart();
} else {
mOdcpiTimer.start();
}
+ sendEmergencyCallStatusEvent = true;
// if ODCPI request is not active but the timer is active, then
// just update the active state and wait for timer to expire
// before requesting new ODCPI to avoid spamming ODCPI requests
@@ -4858,11 +4820,22 @@
// to avoid spamming more odcpi requests to the framework
} else if (ODCPI_REQUEST_TYPE_STOP == request.type) {
LOC_LOGd("request: type %d, isEmergency %d", request.type, request.isEmergencyMode);
- mOdcpiRequestCb(request);
- mOdcpiRequestActive = false;
+ fireOdcpiRequest(request);
+ mOdcpiStateMask = 0;
+ sendEmergencyCallStatusEvent = true;
} else {
LOC_LOGE("Invalid ODCPI request type..");
}
+
+ // Raise InEmergencyCall event
+ if (sendEmergencyCallStatusEvent && request.isEmergencyMode) {
+ SystemStatus* systemstatus = getSystemStatus();
+ if (nullptr != systemstatus) {
+ systemstatus->eventInEmergencyCall(0 != mOdcpiStateMask);
+ } else {
+ LOC_LOGe("Failed to get system status instance.");
+ }
+ }
} else {
LOC_LOGw("ODCPI request not supported");
}
@@ -4902,9 +4875,6 @@
mAdapter(adapter),
mFeatureMap(std::move(featureMap)) {}
inline virtual void proc() const {
- LOC_LOGi("ReportQwesFeatureStatus before caps %" PRIx64 " ",
- mAdapter.getCapabilities());
- ContextBase::setQwesFeatureStatus(mFeatureMap);
LOC_LOGi("ReportQwesFeatureStatus After caps %" PRIx64 " ",
mAdapter.getCapabilities());
mAdapter.broadcastCapabilities(mAdapter.getCapabilities());
@@ -4916,36 +4886,84 @@
}
void GnssAdapter::initOdcpiCommand(const OdcpiRequestCallback& callback,
- OdcpiPrioritytype priority)
+ OdcpiPrioritytype priority,
+ OdcpiCallbackTypeMask typeMask)
{
struct MsgInitOdcpi : public LocMsg {
GnssAdapter& mAdapter;
OdcpiRequestCallback mOdcpiCb;
OdcpiPrioritytype mPriority;
+ OdcpiCallbackTypeMask mTypeMask;
inline MsgInitOdcpi(GnssAdapter& adapter,
const OdcpiRequestCallback& callback,
- OdcpiPrioritytype priority) :
+ OdcpiPrioritytype priority,
+ OdcpiCallbackTypeMask typeMask) :
LocMsg(),
mAdapter(adapter),
- mOdcpiCb(callback), mPriority(priority){}
+ mOdcpiCb(callback), mPriority(priority),
+ mTypeMask(typeMask) {}
inline virtual void proc() const {
- mAdapter.initOdcpi(mOdcpiCb, mPriority);
+ mAdapter.initOdcpi(mOdcpiCb, mPriority, mTypeMask);
}
};
- sendMsg(new MsgInitOdcpi(*this, callback, priority));
+ sendMsg(new MsgInitOdcpi(*this, callback, priority, typeMask));
+}
+
+void GnssAdapter::deRegisterOdcpiCommand(OdcpiPrioritytype priority,
+ OdcpiCallbackTypeMask typeMask) {
+ struct MsgDeRegisterNonEsOdcpi : public LocMsg {
+ GnssAdapter& mAdapter;
+ OdcpiPrioritytype mPriority;
+ OdcpiCallbackTypeMask mTypeMask;
+ inline MsgDeRegisterNonEsOdcpi(GnssAdapter& adapter,
+ OdcpiPrioritytype priority,
+ OdcpiCallbackTypeMask typeMask) :
+ LocMsg(),
+ mAdapter(adapter),
+ mPriority(priority),
+ mTypeMask(typeMask) {}
+ inline virtual void proc() const {
+ mAdapter.deRegisterOdcpi(mPriority, mTypeMask);
+ }
+ };
+
+ sendMsg(new MsgDeRegisterNonEsOdcpi(*this, priority, typeMask));
+}
+
+void GnssAdapter::fireOdcpiRequest(const OdcpiRequestInfo& request) {
+ if (request.isEmergencyMode) {
+ mOdcpiRequestCb(request);
+ } else {
+ std::unordered_map<OdcpiPrioritytype, OdcpiRequestCallback>::iterator iter;
+ for (int priority = ODCPI_HANDLER_PRIORITY_HIGH;
+ priority >= ODCPI_HANDLER_PRIORITY_LOW && iter == mNonEsOdcpiReqCbMap.end();
+ priority--) {
+ iter = mNonEsOdcpiReqCbMap.find((OdcpiPrioritytype)priority);
+ }
+ if (iter != mNonEsOdcpiReqCbMap.end()) {
+ iter->second(request);
+ }
+ }
}
void GnssAdapter::initOdcpi(const OdcpiRequestCallback& callback,
- OdcpiPrioritytype priority)
-{
- LOC_LOGd("In priority: %d, Curr priority: %d", priority, mCallbackPriority);
- if (priority >= mCallbackPriority) {
- mOdcpiRequestCb = callback;
- mCallbackPriority = priority;
- /* Register for WIFI request */
- updateEvtMask(LOC_API_ADAPTER_BIT_REQUEST_WIFI,
- LOC_REGISTRATION_MASK_ENABLED);
+ OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask) {
+ if (typeMask & EMERGENCY_ODCPI) {
+ LOC_LOGd("In priority: %d, Curr priority: %d", priority, mCallbackPriority);
+ if (priority >= mCallbackPriority) {
+ mOdcpiRequestCb = callback;
+ mCallbackPriority = priority;
+ /* Register for WIFI request */
+ updateEvtMask(LOC_API_ADAPTER_BIT_REQUEST_WIFI,
+ LOC_REGISTRATION_MASK_ENABLED);
+ }
+ }
+ if (typeMask & NON_EMERGENCY_ODCPI) {
+ //If this is for non emergency odcpi,
+ //Only set callback to mNonEsOdcpiReqCbMap according to its priority
+ //Will overwrite callback with same priority in this map
+ mNonEsOdcpiReqCbMap[priority] = callback;
}
}
@@ -5005,8 +5023,8 @@
// if ODCPI request is still active after timer
// expires, request again and restart timer
- if (mOdcpiRequestActive) {
- mOdcpiRequestCb(mOdcpiRequest);
+ if (mOdcpiStateMask & ODCPI_REQ_ACTIVE) {
+ fireOdcpiRequest(mOdcpiRequest);
mOdcpiTimer.restart();
} else {
mOdcpiTimer.stop();
@@ -5844,26 +5862,27 @@
mApi(api),
mEnable(enable) {}
inline virtual void proc() const {
- GnssConfigGpsLock gpsLock;
- gpsLock = ContextBase::mGps_conf.GPS_LOCK;
- if (mEnable) {
- gpsLock &= ~GNSS_CONFIG_GPS_LOCK_NI;
+ if (mAdapter.mSupportNfwControl) {
+ GnssConfigGpsLock gpsLock;
+
+ gpsLock = ContextBase::mGps_conf.GPS_LOCK;
+ if (mEnable) {
+ gpsLock &= ~GNSS_CONFIG_GPS_LOCK_NI;
+ } else {
+ gpsLock |= GNSS_CONFIG_GPS_LOCK_NI;
+ }
+ ContextBase::mGps_conf.GPS_LOCK = gpsLock;
+ mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() {
+ mApi.setGpsLockSync((GnssConfigGpsLock)gpsLock);
+ }));
} else {
- gpsLock |= GNSS_CONFIG_GPS_LOCK_NI;
+ LOC_LOGw("NFW control is not supported, do not use this for NFW");
}
- ContextBase::mGps_conf.GPS_LOCK = gpsLock;
- mApi.sendMsg(new LocApiMsg([&mApi = mApi, gpsLock]() {
- mApi.setGpsLockSync((GnssConfigGpsLock)gpsLock);
- }));
}
};
- if (mSupportNfwControl) {
- sendMsg(new MsgControlNfwLocationAccess(*this, *mLocApi, enable));
- } else {
- LOC_LOGw("NFW control is not supported, do not use this for NFW");
- }
+ sendMsg(new MsgControlNfwLocationAccess(*this, *mLocApi, enable));
}
// Set tunc constrained mode, use 0 session id to indicate
@@ -6518,8 +6537,7 @@
sendMsg(new MsgInitEngHubProxy(this));
}
-bool
-GnssAdapter::initEngHubProxy() {
+bool GnssAdapter::initEngHubProxy() {
static bool firstTime = true;
static bool engHubLoadSuccessful = false;
@@ -6616,16 +6634,19 @@
GnssAdapterUpdateQwesFeatureStatusCb updateQwesFeatureStatusCb =
[this] (const std::unordered_map<LocationQwesFeatureType, bool> &featureMap) {
+ ContextBase::setQwesFeatureStatus(featureMap);
reportQwesCapabilities(featureMap);
};
getEngHubProxyFn* getter = (getEngHubProxyFn*) dlsym(handle, "getEngHubProxy");
if(getter != nullptr) {
- EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mSystemStatus->getOsObserver(),
- reportPositionEventCb,
- reportSvEventCb, reqAidingDataCb,
- updateNHzRequirementCb,
- updateQwesFeatureStatusCb);
+ // Wait for the script(rootdir/etc/init.qcom.rc) to create socket folder
+
+ EngineHubProxyBase* hubProxy = (*getter) (mMsgTask, mContext,
+ mSystemStatus->getOsObserver(),
+ reportPositionEventCb, reportSvEventCb, reqAidingDataCb,
+ updateNHzRequirementCb, updateQwesFeatureStatusCb);
+
if (hubProxy != nullptr) {
mEngHubProxy = hubProxy;
engHubLoadSuccessful = true;
diff --git a/gps/gnss/GnssAdapter.h b/gps/gnss/GnssAdapter.h
index d7b4275..506cfb1 100644
--- a/gps/gnss/GnssAdapter.h
+++ b/gps/gnss/GnssAdapter.h
@@ -42,6 +42,7 @@
#include <loc_misc_utils.h>
#include <queue>
#include <NativeAgpsHandler.h>
+#include <unordered_map>
#define MAX_URL_LEN 256
#define NMEA_SENTENCE_MAX_LENGTH 200
@@ -258,10 +259,17 @@
OdcpiRequestCallback mOdcpiRequestCb;
bool mOdcpiRequestActive;
OdcpiPrioritytype mCallbackPriority;
+ typedef uint8_t OdcpiStateMask;
+ OdcpiStateMask mOdcpiStateMask;
+ typedef enum {
+ ODCPI_REQ_ACTIVE = (1<<0),
+ CIVIC_ADDRESS_REQ_ACTIVE = (1<<1)
+ } OdcpiStateBits;
OdcpiTimer mOdcpiTimer;
OdcpiRequestInfo mOdcpiRequest;
+ std::unordered_map<OdcpiPrioritytype, OdcpiRequestCallback> mNonEsOdcpiReqCbMap;
void odcpiTimerExpire();
-
+ std::function<void(const Location&)> mAddressRequestCb;
/* ==== DELETEAIDINGDATA =============================================================== */
int64_t mLastDeleteAidingDataTime;
@@ -300,8 +308,20 @@
int totalSvCntInThisConstellation);
/* ======== UTILITIES ================================================================== */
- inline void initOdcpi(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
+ inline void initOdcpi(const OdcpiRequestCallback& callback,
+ OdcpiPrioritytype priority,
+ OdcpiCallbackTypeMask typeMask);
+ inline void deRegisterOdcpi(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask) {
+ if (typeMask & NON_EMERGENCY_ODCPI) {
+ mNonEsOdcpiReqCbMap.erase(priority);
+ }
+ }
inline void injectOdcpi(const Location& location);
+ void fireOdcpiRequest(const OdcpiRequestInfo& request);
+ //inline void setAddressRequestCb(const std::function<void(const Location&)>& addressRequestCb)
+ //{ mAddressRequestCb = addressRequestCb;}
+ //inline void injectLocationAndAddr(const Location& location, const GnssCivicAddress& addr)
+ //{ mLocApi->injectPositionAndCivicAddress(location, addr);}
static bool isFlpClient(LocationCallbacks& locationCallbacks);
/*==== DGnss Ntrip Source ==========================================================*/
@@ -468,8 +488,12 @@
LocEngineRunState engState);
/* ========= ODCPI ===================================================================== */
+
/* ======== COMMANDS ====(Called from Client Thread)==================================== */
- void initOdcpiCommand(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
+ void initOdcpiCommand(const OdcpiRequestCallback& callback,
+ OdcpiPrioritytype priority,
+ OdcpiCallbackTypeMask typeMask);
+ void deRegisterOdcpiCommand(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask);
void injectOdcpiCommand(const Location& location);
/* ======== RESPONSES ================================================================== */
void reportResponse(LocationError err, uint32_t sessionId);
@@ -628,7 +652,6 @@
void setSuplHostServer(const char* server, int port, LocServerType type);
void notifyClientOfCachedLocationSystemInfo(LocationAPI* client,
const LocationCallbacks& callbacks);
- LocationCapabilitiesMask getCapabilities();
void updateSystemPowerStateCommand(PowerStateType systemPowerState);
/*==== DGnss Usable Report Flag ====================================================*/
diff --git a/gps/gnss/location_gnss.cpp b/gps/gnss/location_gnss.cpp
index 8f67369..e0c69a9 100644
--- a/gps/gnss/location_gnss.cpp
+++ b/gps/gnss/location_gnss.cpp
@@ -27,6 +27,42 @@
*
*/
+/*
+Changes from Qualcomm Innovation Center are provided under the following license:
+
+Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted (subject to the limitations in the
+disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 "GnssAdapter.h"
#include "location_interface.h"
@@ -73,7 +109,9 @@
static void nfwInit(const NfwCbInfo& cbInfo);
static void getPowerStateChanges(std::function<void(bool)> powerStateCb);
-static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
+static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority,
+ OdcpiCallbackTypeMask typeMask);
+static void deRegisterOdcpi(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask);
static void odcpiInject(const Location& location);
static void blockCPI(double latitude, double longitude, float accuracy,
@@ -135,6 +173,7 @@
getDebugReport,
updateConnectionStatus,
odcpiInit,
+ deRegisterOdcpi,
odcpiInject,
blockCPI,
getGnssEnergyConsumed,
@@ -379,10 +418,17 @@
}
}
-static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority)
+static void odcpiInit(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority,
+ OdcpiCallbackTypeMask typeMask)
{
if (NULL != gGnssAdapter) {
- gGnssAdapter->initOdcpiCommand(callback, priority);
+ gGnssAdapter->initOdcpiCommand(callback, priority, typeMask);
+ }
+}
+
+static void deRegisterOdcpi(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask) {
+ if (NULL != gGnssAdapter) {
+ gGnssAdapter->deRegisterOdcpiCommand(priority, typeMask);
}
}
diff --git a/gps/gps_vendor_product.mk b/gps/gps_vendor_product.mk
index cd35684..4ac9b89 100644
--- a/gps/gps_vendor_product.mk
+++ b/gps/gps_vendor_product.mk
@@ -30,7 +30,6 @@
PRODUCT_PACKAGES += gnss@2.0-base.policy
PRODUCT_PACKAGES += gnss@2.0-xtra-daemon.policy
PRODUCT_PACKAGES += gnss@2.0-xtwifi-client.policy
-PRODUCT_PACKAGES += gnss@2.0-xtwifi-inet-agent.policy
PRODUCT_PACKAGES += libloc_pla_headers
PRODUCT_PACKAGES += liblocation_api_headers
PRODUCT_PACKAGES += libgps.utils_headers
diff --git a/gps/location/LocationAPI.cpp b/gps/location/LocationAPI.cpp
index 3a50c46..0bb48e1 100644
--- a/gps/location/LocationAPI.cpp
+++ b/gps/location/LocationAPI.cpp
@@ -25,6 +25,42 @@
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+Changes from Qualcomm Innovation Center are provided under the following license:
+
+Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted (subject to the limitations in the
+disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER 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.
+*/
+
#define LOG_NDEBUG 0
#define LOG_TAG "LocSvc_LocationAPI"
diff --git a/gps/location/LocationDataTypes.h b/gps/location/LocationDataTypes.h
index b85464a..80511a2 100644
--- a/gps/location/LocationDataTypes.h
+++ b/gps/location/LocationDataTypes.h
@@ -26,6 +26,40 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+Changes from Qualcomm Innovation Center are provided under the following license:
+Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted (subject to the limitations in the
+disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 LOCATIONDATATYPES_H
#define LOCATIONDATATYPES_H
@@ -238,77 +272,91 @@
// Set of masks for Modem and QWES capabilities.
typedef uint64_t LocationCapabilitiesMask;
-typedef enum {
- // supports startTracking API with minInterval param
- LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT = (1<<0),
- // supports startBatching API with minInterval param
- LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT = (1<<1),
- // supports startTracking API with minDistance param
- LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT = (1<<2),
- // supports startBatching API with minDistance param
- LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT = (1<<3),
- // supports addGeofences API
- LOCATION_CAPABILITIES_GEOFENCE_BIT = (1<<4),
- // supports GnssMeasurementsCallback
- LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT = (1<<5),
- // supports startTracking/startBatching API with LocationOptions.mode of MSB (Ms Based)
- LOCATION_CAPABILITIES_GNSS_MSB_BIT = (1<<6),
- // supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted)
- LOCATION_CAPABILITIES_GNSS_MSA_BIT = (1<<7),
- // supports debug nmea sentences in the debugNmeaCallback
- LOCATION_CAPABILITIES_DEBUG_NMEA_BIT = (1<<8),
- // support outdoor trip batching
- LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT = (1<<9),
- // support constellation enablement
- LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT = (1<<10),
- // support agpm
- LOCATION_CAPABILITIES_AGPM_BIT = (1<<11),
- // support location privacy
- LOCATION_CAPABILITIES_PRIVACY_BIT = (1<<12),
- // support measurement corrections
- LOCATION_CAPABILITIES_MEASUREMENTS_CORRECTION_BIT = (1<<13),
- // support Robust Location
- LOCATION_CAPABILITIES_CONFORMITY_INDEX_BIT = (1<<14),
- // support precise location edgnss
- LOCATION_CAPABILITIES_EDGNSS_BIT = (1<<15),
- // Modem supports Carrier Phase for Precise Positioning
- // Measurement Engine (PPME).
- LOCATION_CAPABILITIES_QWES_CARRIER_PHASE_BIT = (1<<16),
- // Modem supports SV Polynomial for tightly coupled external
- // DR support. This is a Standalone Feature.
- LOCATION_CAPABILITIES_QWES_SV_POLYNOMIAL_BIT = (1<<17),
- // Modem supports SV Ephemeris for tightly coupled external
- // PPE engines. This is a Standalone Feature.
- LOCATION_CAPABILITIES_QWES_SV_EPHEMERIS_BIT = (1<<18),
- // Modem supports GNSS Single Frequency feature. This is a
- // Standalone Feature.
- LOCATION_CAPABILITIES_QWES_GNSS_SINGLE_FREQUENCY = (1<<19),
- // Modem supports GNSS Multi Frequency feature. Multi Frequency
- // enables Single frequency also.
- LOCATION_CAPABILITIES_QWES_GNSS_MULTI_FREQUENCY = (1<<20),
- // This mask indicates VPe license bundle is enabled. VEPP
- // bundle include Carrier Phase and SV Polynomial features.
- LOCATION_CAPABILITIES_QWES_VPE = (1<<21),
- // This mask indicates support for CV2X Location basic features.
- // This bundle includes features for GTS Time & Freq, C-TUNC
- // (Constrained Time uncertainity.
- LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_BASIC = (1<<22),
- // This mask indicates support for CV2X Location premium features.
- // This bundle includes features for CV2X Location Basic features,
- // QDR3 feature, and PACE. (Position Assisted Clock Estimator.
- LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_PREMIUM = (1<<23),
- // This mask indicates that PPE (Precise Positioning Engine)
- // library is enabled or Precise Positioning Framework (PPF)
- // is available. This bundle includes features for Carrier
- // Phase and SV Ephermeris.
- LOCATION_CAPABILITIES_QWES_PPE = (1<<24),
- // This mask indicates QDR2_C license bundle is enabled. This
- // bundle includes features for SV Polynomial.
- LOCATION_CAPABILITIES_QWES_QDR2 = (1<<25),
- // This mask indicates QDR3_C license bundle is enabled. This
- // bundle includes features for SV Polynomial.
- LOCATION_CAPABILITIES_QWES_QDR3 = (1<<26),
-} LocationCapabilitiesBits;
+// supports startTracking API with minInterval param
+#define LOCATION_CAPABILITIES_TIME_BASED_TRACKING_BIT (1<<0)
+// supports startBatching API with minInterval param
+#define LOCATION_CAPABILITIES_TIME_BASED_BATCHING_BIT (1<<1)
+// supports startTracking API with minDistance param
+#define LOCATION_CAPABILITIES_DISTANCE_BASED_TRACKING_BIT (1<<2)
+// supports startBatching API with minDistance param
+#define LOCATION_CAPABILITIES_DISTANCE_BASED_BATCHING_BIT (1<<3)
+// supports addGeofences API
+#define LOCATION_CAPABILITIES_GEOFENCE_BIT (1<<4)
+// supports GnssMeasurementsCallback
+#define LOCATION_CAPABILITIES_GNSS_MEASUREMENTS_BIT (1<<5)
+// supports startTracking/startBatching API with LocationOptions.mode of MSB (Ms Based)
+#define LOCATION_CAPABILITIES_GNSS_MSB_BIT (1<<6)
+// supports startTracking/startBatching API with LocationOptions.mode of MSA (MS Assisted)
+#define LOCATION_CAPABILITIES_GNSS_MSA_BIT (1<<7)
+// supports debug nmea sentences in the debugNmeaCallback
+#define LOCATION_CAPABILITIES_DEBUG_NMEA_BIT (1<<8)
+// support outdoor trip batching
+#define LOCATION_CAPABILITIES_OUTDOOR_TRIP_BATCHING_BIT (1<<9)
+// support constellation enablement
+#define LOCATION_CAPABILITIES_CONSTELLATION_ENABLEMENT_BIT (1<<10)
+// support agpm
+#define LOCATION_CAPABILITIES_AGPM_BIT (1<<11)
+// support location privacy
+#define LOCATION_CAPABILITIES_PRIVACY_BIT (1<<12)
+// support measurement corrections
+#define LOCATION_CAPABILITIES_MEASUREMENTS_CORRECTION_BIT (1<<13)
+// support Robust Location
+#define LOCATION_CAPABILITIES_CONFORMITY_INDEX_BIT (1<<14)
+// support precise location edgnss
+#define LOCATION_CAPABILITIES_EDGNSS_BIT (1<<15)
+// Modem supports Carrier Phase for Precise Positioning
+// Measurement Engine (PPME).
+#define LOCATION_CAPABILITIES_QWES_CARRIER_PHASE_BIT (1<<16)
+// Modem supports SV Polynomial for tightly coupled external
+// DR support. This is a Standalone Feature.
+#define LOCATION_CAPABILITIES_QWES_SV_POLYNOMIAL_BIT (1<<17)
+// Modem supports SV Ephemeris for tightly coupled external
+// PPE engines. This is a Standalone Feature.
+#define LOCATION_CAPABILITIES_QWES_SV_EPHEMERIS_BIT (1<<18)
+// Modem supports GNSS Single Frequency feature. This is a
+// Standalone Feature.
+#define LOCATION_CAPABILITIES_QWES_GNSS_SINGLE_FREQUENCY (1<<19)
+// Modem supports GNSS Multi Frequency feature. Multi Frequency
+// enables Single frequency also.
+#define LOCATION_CAPABILITIES_QWES_GNSS_MULTI_FREQUENCY (1<<20)
+// This mask indicates VPe license bundle is enabled. VEPP
+// bundle include Carrier Phase and SV Polynomial features.
+#define LOCATION_CAPABILITIES_QWES_VPE (1<<21)
+// This mask indicates support for CV2X Location basic features.
+// This bundle includes features for GTS Time & Freq, C-TUNC
+// (Constrained Time uncertainity.
+#define LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_BASIC (1<<22)
+// This mask indicates support for CV2X Location premium features.
+// This bundle includes features for CV2X Location Basic features,
+// QDR3 feature, and PACE. (Position Assisted Clock Estimator.
+#define LOCATION_CAPABILITIES_QWES_CV2X_LOCATION_PREMIUM (1<<23)
+// This mask indicates that PPE (Precise Positioning Engine)
+// library is enabled or Precise Positioning Framework (PPF)
+// is available. This bundle includes features for Carrier
+// Phase and SV Ephermeris.
+#define LOCATION_CAPABILITIES_QWES_PPE (1<<24)
+// This mask indicates QDR2_C license bundle is enabled. This
+// bundle includes features for SV Polynomial.
+#define LOCATION_CAPABILITIES_QWES_QDR2 (1<<25)
+// This mask indicates QDR3_C license bundle is enabled. This
+// bundle includes features for SV Polynomial.
+#define LOCATION_CAPABILITIES_QWES_QDR3 (1<<26)
+// This mask indicates DGNSS license bundle is enabled.
+#define LOCATION_CAPABILITIES_QWES_DGNSS (1<<27)
+// This mask indicates Antenna info is enabled.
+#define LOCATION_CAPABILITIES_ANTENNA_INFO (1<<28)
+// This mask indicates qppe or qfe library is presented.
+#define LOCATION_CAPABILITIES_PRECISE_LIB_PRESENT (1<<29)
+// This mask indicates wifi RSSI positioning is
+// enabled by QWES license.
+#define LOCATION_CAPABILITIES_QWES_WIFI_RSSI_POSITIONING (1ULL<<30)
+// This mask indicates wifi RTT positioning is
+// enabled by QWES license.
+#define LOCATION_CAPABILITIES_QWES_WIFI_RTT_POSITIONING (1ULL<<31)
+// This mask indicates wifi RSSI positioning is supported.
+#define LOCATION_CAPABILITIES_WIFI_RSSI_POSITIONING (1ULL<<32)
+// This mask indicates wifi RTT positioning is supported.
+#define LOCATION_CAPABILITIES_WIFI_RTT_POSITIONING (1ULL<<33)
typedef uint8_t LocationQwesFeatureType;
typedef enum {
@@ -347,10 +395,29 @@
// This indicates VEPP license bundle is enabled. VEPP
// bundle include Carrier Phase and SV Polynomial features.
LOCATION_QWES_FEATURE_TYPE_VPE,
+ // This indicates DGNSS license is enabled.
+ LOCATION_QWES_FEATURE_TYPE_DGNSS,
+ // This indicates DLP feature is enabled by QESDK APP
+ // license
+ LOCATION_QWES_FEATURE_TYPE_DLP_QESDK,
+ // This indicates wifi RSSI positioning is
+ // enabled by QWES license.
+ LOCATION_QWES_FEATURE_TYPE_RSSI_POSITIONING,
+ // This indicates wifi RTT positioning is
+ // enabled by QWES license.
+ LOCATION_QWES_FEATURE_TYPE_RTT_POSITIONING,
// Max value
LOCATION_QWES_FEATURE_TYPE_MAX
} LocationQwesFeatureTypes;
+typedef uint64_t LocationHwCapabilitiesMask;
+typedef enum {
+ // This indicates wifi HW has RSSI capability.
+ LOCATION_WIFI_CAPABILITY_RSSI = (1<<0),
+ // This indicates wifi HW has RTT capability.
+ LOCATION_WIFI_CAPABILITY_RTT = (1<<1)
+} LocationHwCapabilitiesBits;
+
typedef enum {
LOCATION_TECHNOLOGY_TYPE_GNSS = 0,
} LocationTechnologyType;
@@ -2067,4 +2134,11 @@
uint64_t hlosQtimer5;
} GnssLatencyInfo;
+enum {
+ NON_EMERGENCY_ODCPI = (1<<0),
+ EMERGENCY_ODCPI = (1<<1)
+} OdcpiCallbackTypeMaskBits;
+
+typedef uint16_t OdcpiCallbackTypeMask;
+
#endif /* LOCATIONDATATYPES_H */
diff --git a/gps/location/location_interface.h b/gps/location/location_interface.h
index 69d4f0c..b707901 100644
--- a/gps/location/location_interface.h
+++ b/gps/location/location_interface.h
@@ -26,6 +26,41 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+Changes from Qualcomm Innovation Center are provided under the following license:
+
+Copyright (c) 2022, 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted (subject to the limitations in the
+disclaimer below) 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 Qualcomm Innovation Center, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER 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 LOCATION_INTERFACE_H
#define LOCATION_INTERFACE_H
@@ -79,7 +114,9 @@
void (*getDebugReport)(GnssDebugReport& report);
void (*updateConnectionStatus)(bool connected, int8_t type, bool roaming,
NetworkHandle networkHandle, std::string& apn);
- void (*odcpiInit)(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority);
+ void (*odcpiInit)(const OdcpiRequestCallback& callback, OdcpiPrioritytype priority,
+ OdcpiCallbackTypeMask typeMask);
+ void (*deRegisterOdcpi)(OdcpiPrioritytype priority, OdcpiCallbackTypeMask typeMask);
void (*odcpiInject)(const Location& location);
void (*blockCPI)(double latitude, double longitude, float accuracy,
int blockDurationMsec, double latLonDiffThreshold);
diff --git a/gps/utils/gps_extended_c.h b/gps/utils/gps_extended_c.h
index f368975..af5b919 100644
--- a/gps/utils/gps_extended_c.h
+++ b/gps/utils/gps_extended_c.h
@@ -2341,10 +2341,17 @@
/* ODCPI callback priorities*/
enum OdcpiPrioritytype {
+ //ODCPI callback registered by AFW via IGNSS AIDL has LOW priority
ODCPI_HANDLER_PRIORITY_LOW,
+ ODCPI_HANDLER_PRIORITY_DEFAULT = ODCPI_HANDLER_PRIORITY_LOW,
+ //ODCPI callback registered by IzatProvider on LE/KaiOS has medium priority
+ ODCPI_HANDLER_PRIORITY_MEDIUM,
+ //Non emergency ODCPI callback registered by IzatManager for RTT position injection
+ //has high priority
ODCPI_HANDLER_PRIORITY_HIGH
};
+
/*
* Callback with AGNSS(IpV4) status information.
*
@@ -2422,6 +2429,13 @@
#define NETWORK_HANDLE_UNKNOWN ~0
#define MAX_NETWORK_HANDLES 10
+typedef enum {
+ LOC_FEATURE_STATUS_UNKNOWN = 0,
+ LOC_FEATURE_STATUS_NONE = 1,
+ LOC_FEATURE_STATUS_OK = 2,
+ LOC_FEATURE_STATUS_EXPIRED = 3
+} LocFeatureStatus;
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/location/Android.mk b/location/Android.mk
index fa0ff5d..888404c 100644
--- a/location/Android.mk
+++ b/location/Android.mk
@@ -1,5 +1,4 @@
LOCAL_PATH := $(call my-dir)
-
include $(call all-makefiles-under,$(LOCAL_PATH))