summaryrefslogtreecommitdiff
path: root/gnss/GnssAdapter.cpp
diff options
context:
space:
mode:
authorWei Chen <weic@codeaurora.org>2019-02-22 17:55:39 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2019-05-01 09:45:04 -0700
commit3e62412eb0233619684ecdbc39b19cbc8ebbdc93 (patch)
treecf35fdee6917377f8fed369fc6e95fd7b378b8aa /gnss/GnssAdapter.cpp
parent0330e79d4a87db7e1ee358f0e87a49d34c8f3690 (diff)
downloadgps-3e62412eb0233619684ecdbc39b19cbc8ebbdc93.tar.gz
Gnss interface: add position injection for extended info
Add position injection interface with extended info, e.g.: GnssLocationInfoNotification Change-Id: I6ba8f1111d1511c7071fe358687a478b26e8f9a4 CRs-fixed: 2417450
Diffstat (limited to 'gnss/GnssAdapter.cpp')
-rw-r--r--gnss/GnssAdapter.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/gnss/GnssAdapter.cpp b/gnss/GnssAdapter.cpp
index edfc150..436681a 100644
--- a/gnss/GnssAdapter.cpp
+++ b/gnss/GnssAdapter.cpp
@@ -1820,6 +1820,33 @@ GnssAdapter::injectLocationCommand(double latitude, double longitude, float accu
}
void
+GnssAdapter::injectLocationExtCommand(const GnssLocationInfoNotification &locationInfo)
+{
+ LOC_LOGd("latitude %8.4f longitude %8.4f accuracy %8.4f, tech mask 0x%x",
+ locationInfo.location.latitude, locationInfo.location.longitude,
+ locationInfo.location.accuracy, locationInfo.location.techMask);
+
+ struct MsgInjectLocationExt : public LocMsg {
+ LocApiBase& mApi;
+ ContextBase& mContext;
+ GnssLocationInfoNotification mLocationInfo;
+ inline MsgInjectLocationExt(LocApiBase& api,
+ ContextBase& context,
+ GnssLocationInfoNotification locationInfo) :
+ LocMsg(),
+ mApi(api),
+ mContext(context),
+ mLocationInfo(locationInfo) {}
+ inline virtual void proc() const {
+ // false to indicate for none-ODCPI
+ mApi.injectPosition(mLocationInfo, false);
+ }
+ };
+
+ sendMsg(new MsgInjectLocationExt(*mLocApi, *mContext, locationInfo));
+}
+
+void
GnssAdapter::injectTimeCommand(int64_t time, int64_t timeReference, int32_t uncertainty)
{
LOC_LOGD("%s]: time %lld timeReference %lld uncertainty %d",