diff options
author | Kevin Tang <zhikait@codeaurora.org> | 2014-09-11 12:19:14 -0700 |
---|---|---|
committer | Vineeta Srivastava <vsrivastava@google.com> | 2014-09-15 10:43:08 -0700 |
commit | 8aa503a872e8c8cf241061f6ffed4e9fba125ffe (patch) | |
tree | 0ac0a92be9be923b8f9bb879657c6656d0f4b468 /loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp | |
parent | dd587e5a9e781e6e9b0dc428770552ad7e3e00c1 (diff) | |
download | gps-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-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp')
-rw-r--r-- | loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp index e142292..87d6b7c 100644 --- a/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp +++ b/loc_api/libloc_api-rpc-50001/libloc_api-rpc-glue/src/LocApiRpc.cpp @@ -164,6 +164,20 @@ LocApiRpc::convertMask(LOC_API_ADAPTER_EVENT_MASK_T mask) return newMask; } +rpc_loc_lock_e_type +LocApiRpc::convertGpsLockMask(LOC_GPS_LOCK_MASK lockMask) +{ + if (isGpsLockAll(lockMask)) + return RPC_LOC_LOCK_ALL; + if (isGpsLockMO(lockMask)) + return RPC_LOC_LOCK_MI; + if (isGpsLockMT(lockMask)) + return RPC_LOC_LOCK_MT; + if (isGpsLockNone(lockMask)) + return RPC_LOC_LOCK_NONE; + return (rpc_loc_lock_e_type)lockMask; +} + enum loc_api_adapter_err LocApiRpc::convertErr(int rpcErr) { @@ -1400,12 +1414,12 @@ LocApiBase* getLocApi(const MsgTask* msgTask, 3 = Lock MT position sessions 4 = Lock all position sessions */ -int LocApiRpc::setGpsLock(unsigned int lock) +int LocApiRpc::setGpsLock(LOC_GPS_LOCK_MASK lockMask) { rpc_loc_ioctl_data_u_type ioctl_data; boolean ret_val; - LOC_LOGD("%s:%d]: lock: %d\n", __func__, __LINE__, lock); - ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = (rpc_loc_lock_e_type)lock; + LOC_LOGD("%s:%d]: lock: %x\n", __func__, __LINE__, lockMask); + ioctl_data.rpc_loc_ioctl_data_u_type_u.engine_lock = convertGpsLockMask(lockMask); ioctl_data.disc = RPC_LOC_IOCTL_SET_ENGINE_LOCK; ret_val = loc_eng_ioctl (loc_eng_data.client_handle, RPC_LOC_IOCTL_SET_ENGINE_LOCK, |