summaryrefslogtreecommitdiff
path: root/loc_api/libloc_api_50001/LocEngAdapter.cpp
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2014-09-11 12:19:14 -0700
committerVineeta Srivastava <vsrivastava@google.com>2014-09-15 10:43:08 -0700
commit8aa503a872e8c8cf241061f6ffed4e9fba125ffe (patch)
tree0ac0a92be9be923b8f9bb879657c6656d0f4b468 /loc_api/libloc_api_50001/LocEngAdapter.cpp
parentdd587e5a9e781e6e9b0dc428770552ad7e3e00c1 (diff)
downloadgps-8aa503a872e8c8cf241061f6ffed4e9fba125ffe.tar.gz
GPS_LOCK configuration support
GPS_LOCK is defined as a bit mask in the higher layer defined in gps.conf. GPS HAL reads from gps.conf, yet this can be reconfigured by gps.h defined new API to a different value. The current value will be used at cleanup() time, to optionally lock gps modem to the configured mode. This changs also sets SUPL URL to NULL if hostname comes with set_server() API is a NULL string. Also optimized configuration_update() implementation so that no all items will go through the reconfigu scan. Bug: 16131208 Bug: 17288144 Change-Id: I12a89b12ff82b6efd7b5567d2fcd6a7e79414c71
Diffstat (limited to 'loc_api/libloc_api_50001/LocEngAdapter.cpp')
-rw-r--r--loc_api/libloc_api_50001/LocEngAdapter.cpp37
1 files changed, 21 insertions, 16 deletions
diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp
index 1e6e4e1..184f83d 100644
--- a/loc_api/libloc_api_50001/LocEngAdapter.cpp
+++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp
@@ -128,37 +128,42 @@ void LocEngAdapter::setUlpProxy(UlpProxyBase* ulp)
mUlp = ulp;
}
-void LocEngAdapter::requestPowerVote()
+int LocEngAdapter::setGpsLockMsg(LOC_GPS_LOCK_MASK lockMask)
{
- struct LocEngAdapterVotePower : public LocMsg {
+ struct LocEngAdapterGpsLock : public LocMsg {
LocEngAdapter* mAdapter;
- const bool mPowerUp;
- inline LocEngAdapterVotePower(LocEngAdapter* adapter, bool powerUp) :
- LocMsg(), mAdapter(adapter), mPowerUp(powerUp)
+ LOC_GPS_LOCK_MASK mLockMask;
+ inline LocEngAdapterGpsLock(LocEngAdapter* adapter, LOC_GPS_LOCK_MASK lockMask) :
+ LocMsg(), mAdapter(adapter), mLockMask(lockMask)
{
locallog();
}
inline virtual void proc() const {
- /* Power voting without engine lock:
- * 101: vote down, 102-104 - vote up
- * These codes are used not to confuse with actual engine lock
- * functionality, that can't be used in SSR scenario, as it
- * conflicts with initialization sequence.
- */
- int mode = mPowerUp ? 103 : 101;
- mAdapter->setGpsLock(mode);
+ mAdapter->setGpsLock(mLockMask);
}
inline void locallog() const {
- LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d",
- (int)mPowerUp);
+ LOC_LOGV("LocEngAdapterGpsLock - mLockMask: %x", mLockMask);
}
inline virtual void log() const {
locallog();
}
};
+ sendMsg(new LocEngAdapterGpsLock(this, lockMask));
+ return 0;
+}
+void LocEngAdapter::requestPowerVote()
+{
if (getPowerVoteRight()) {
- sendMsg(new LocEngAdapterVotePower(this, getPowerVote()));
+ /* Power voting without engine lock:
+ * 101: vote down, 102-104 - vote up
+ * These codes are used not to confuse with actual engine lock
+ * functionality, that can't be used in SSR scenario, as it
+ * conflicts with initialization sequence.
+ */
+ bool powerUp = getPowerVote();
+ LOC_LOGV("LocEngAdapterVotePower - Vote Power: %d", (int)powerUp);
+ setGpsLock(powerUp ? 103 : 101);
}
}