From 6645560ababa9f082880ba979f8cd122014b60fe Mon Sep 17 00:00:00 2001 From: Pandari Sabhapathi Date: Fri, 31 Jan 2014 12:08:32 -0800 Subject: [PATCH] Renaming class members for improved readability Renaming class members to reflect their true purpose CRs-fixed: 601353 Change-Id: I1eb2bc111a52845c515d1b9ca10fb800402c7c3d --- core/ContextBase.h | 6 ++-- core/LBSProxyBase.h | 6 ++-- loc_api/libloc_api_50001/LocEngAdapter.cpp | 38 +++++++++++----------- loc_api/libloc_api_50001/LocEngAdapter.h | 14 +++++--- loc_api/libloc_api_50001/loc.cpp | 4 +-- loc_api/libloc_api_50001/loc_eng.cpp | 4 +-- 6 files changed, 38 insertions(+), 34 deletions(-) diff --git a/core/ContextBase.h b/core/ContextBase.h index 85cbab7e..d7135875 100644 --- a/core/ContextBase.h +++ b/core/ContextBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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 @@ -56,8 +56,8 @@ public: inline const MsgTask* getMsgTask() { return mMsgTask; } inline LocApiBase* getLocApi() { return mLocApi; } inline LocApiProxyBase* getLocApiProxy() { return mLocApiProxy; } - inline bool hasAgpsExt() { return mLBSProxy->hasAgpsExt(); } - inline bool hasCPIExt() { return mLBSProxy->hasCPIExt(); } + inline bool hasAgpsExtendedCapabilities() { return mLBSProxy->hasAgpsExtendedCapabilities(); } + inline bool hasCPIExtendedCapabilities() { return mLBSProxy->hasCPIExtendedCapabilities(); } inline void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) { mLBSProxy->requestUlp(adapter, capabilities); diff --git a/core/LBSProxyBase.h b/core/LBSProxyBase.h index f0d1a329..99872eef 100644 --- a/core/LBSProxyBase.h +++ b/core/LBSProxyBase.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-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 @@ -49,8 +49,8 @@ public: inline virtual ~LBSProxyBase() {} inline virtual void requestUlp(LocAdapterBase* adapter, unsigned long capabilities) const {} - inline virtual bool hasAgpsExt() const { return false; } - inline virtual bool hasCPIExt() const { return false; } + inline virtual bool hasAgpsExtendedCapabilities() const { return false; } + inline virtual bool hasCPIExtendedCapabilities() const { return false; } }; typedef LBSProxyBase* (getLBSProxy_t)(); diff --git a/loc_api/libloc_api_50001/LocEngAdapter.cpp b/loc_api/libloc_api_50001/LocEngAdapter.cpp index 0b17b2c3..ba9ee5ec 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.cpp +++ b/loc_api/libloc_api_50001/LocEngAdapter.cpp @@ -65,7 +65,7 @@ LocEngAdapter::LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, :context), mOwner(owner), mInternalAdapter(new LocInternalAdapter(this)), mUlp(new UlpProxyBase()), mNavigating(false), - mAgpsEnabled(false), mCPIEnabled(false) + mSupportsAgpsExtendedCapabilities(false), mSupportsCPIExtendedCapabilities(false) { memset(&mFixCriteria, 0, sizeof(mFixCriteria)); mFixCriteria.mode = LOC_POSITION_MODE_INVALID; @@ -210,84 +210,84 @@ bool LocEngAdapter::reportXtraServer(const char* url1, const char* url3, const int maxlength) { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngReportXtraServer(mOwner, url1, url2, url3, maxlength)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestATL(int connHandle, AGpsType agps_type) { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngRequestATL(mOwner, connHandle, agps_type)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::releaseATL(int connHandle) { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngReleaseATL(mOwner, connHandle)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestXtraData() { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngRequestXtra(mOwner)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestTime() { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { sendMsg(new LocEngRequestTime(mOwner)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestNiNotify(GpsNiNotification ¬if, const void* data) { - if (mAgpsEnabled) { + if (mSupportsAgpsExtendedCapabilities) { notif.size = sizeof(notif); notif.timeout = LOC_NI_NO_RESPONSE_TIME; sendMsg(new LocEngRequestNi(mOwner, notif, data)); } - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::requestSuplES(int connHandle) { - if (mAgpsEnabled) + if (mSupportsAgpsExtendedCapabilities) sendMsg(new LocEngRequestSuplEs(mOwner, connHandle)); - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::reportDataCallOpened() { - if(mAgpsEnabled) + if(mSupportsAgpsExtendedCapabilities) sendMsg(new LocEngSuplEsOpened(mOwner)); - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline bool LocEngAdapter::reportDataCallClosed() { - if(mAgpsEnabled) + if(mSupportsAgpsExtendedCapabilities) sendMsg(new LocEngSuplEsClosed(mOwner)); - return mAgpsEnabled; + return mSupportsAgpsExtendedCapabilities; } inline diff --git a/loc_api/libloc_api_50001/LocEngAdapter.h b/loc_api/libloc_api_50001/LocEngAdapter.h index 6de663c0..fdc4c778 100644 --- a/loc_api/libloc_api_50001/LocEngAdapter.h +++ b/loc_api/libloc_api_50001/LocEngAdapter.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2011-2013, The Linux Foundation. All rights reserved. +/* Copyright (c) 2011-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 @@ -76,8 +76,8 @@ class LocEngAdapter : public LocAdapterBase { bool mNavigating; public: - bool mAgpsEnabled; - bool mCPIEnabled; + bool mSupportsAgpsExtendedCapabilities; + bool mSupportsCPIExtendedCapabilities; LocEngAdapter(LOC_API_ADAPTER_EVENT_MASK_T mask, void* owner,ContextBase* context, @@ -91,8 +91,12 @@ public: inline LocInternalAdapter* getInternalAdapter() { return mInternalAdapter; } inline UlpProxyBase* getUlpProxy() { return mUlp; } inline void* getOwner() { return mOwner; } - inline bool hasAgpsExt() { return mContext->hasAgpsExt(); } - inline bool hasCPIExt() { return mContext->hasCPIExt(); } + inline bool hasAgpsExtendedCapabilities() { + return mContext->hasAgpsExtendedCapabilities(); + } + inline bool hasCPIExtendedCapabilities() { + return mContext->hasCPIExtendedCapabilities(); + } inline const MsgTask* getMsgTask() { return mMsgTask; } inline enum loc_api_adapter_err diff --git a/loc_api/libloc_api_50001/loc.cpp b/loc_api/libloc_api_50001/loc.cpp index 8a4d6756..d98a80fa 100644 --- a/loc_api/libloc_api_50001/loc.cpp +++ b/loc_api/libloc_api_50001/loc.cpp @@ -286,8 +286,8 @@ static int loc_init(GpsCallbacks* callbacks) retVal = loc_eng_init(loc_afw_data, &clientCallbacks, event, NULL); loc_afw_data.adapter->requestUlp(gps_conf.CAPABILITIES); - loc_afw_data.adapter->mAgpsEnabled = !loc_afw_data.adapter->hasAgpsExt(); - loc_afw_data.adapter->mCPIEnabled = !loc_afw_data.adapter->hasCPIExt(); + loc_afw_data.adapter->mSupportsAgpsExtendedCapabilities = !loc_afw_data.adapter->hasAgpsExtendedCapabilities(); + loc_afw_data.adapter->mSupportsCPIExtendedCapabilities = !loc_afw_data.adapter->hasCPIExtendedCapabilities(); if(retVal) { LOC_LOGE("loc_eng_init() fail!"); diff --git a/loc_api/libloc_api_50001/loc_eng.cpp b/loc_api/libloc_api_50001/loc_eng.cpp index 5d8381e7..28b0874b 100644 --- a/loc_api/libloc_api_50001/loc_eng.cpp +++ b/loc_api/libloc_api_50001/loc_eng.cpp @@ -1877,7 +1877,7 @@ int loc_eng_inject_location(loc_eng_data_s_type &loc_eng_data, double latitude, ENTRY_LOG_CALLFLOW(); INIT_CHECK(loc_eng_data.adapter, return -1); LocEngAdapter* adapter = loc_eng_data.adapter; - if(!adapter->mCPIEnabled) + if(!adapter->mSupportsCPIExtendedCapabilities) { adapter->sendMsg(new LocEngInjectLocation(adapter, latitude, longitude, accuracy)); @@ -2093,7 +2093,7 @@ void loc_eng_agps_init(loc_eng_data_s_type &loc_eng_data, AGpsExtCallbacks* call AGPS_TYPE_SUPL, false); - if (adapter->mAgpsEnabled) { + if (adapter->mSupportsAgpsExtendedCapabilities) { loc_eng_data.adapter->sendMsg(new LocEngDataClientInit(&loc_eng_data)); loc_eng_dmn_conn_loc_api_server_launch(callbacks->create_thread_cb,