Skip to content

Commit

Permalink
markw: Update GPS HAL
Browse files Browse the repository at this point in the history
* Tag LA.UM.6.6.r1-10500-89xx.0
  • Loading branch information
Hikari-no-Tenshi authored and Razziell committed Mar 7, 2019
1 parent 9416f9f commit 947840e
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 38 deletions.
2 changes: 1 addition & 1 deletion gps/core/SystemStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ bool SystemStatus::setDefaultReport(void)
bool SystemStatus::eventConnectionStatus(bool connected, int8_t type)
{
// send networkinof dataitem to systemstatus observer clients
SystemStatusNetworkInfo s(type, "", "", false, connected, false);
SystemStatusNetworkInfo s(type, "", "", connected);
mSysStatusObsvr.notify({&s});

return true;
Expand Down
13 changes: 2 additions & 11 deletions gps/core/SystemStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,14 @@ class SystemStatusNetworkInfo : public SystemStatusItemBase,
int32_t type=0,
std::string typeName="",
string subTypeName="",
bool available=false,
bool connected=false,
bool roaming=false) :
NetworkInfoDataItemBase(
(NetworkType)type,
type,
typeName,
subTypeName,
available,
connected && (!roaming),
connected,
roaming),
mSrcObjPtr(nullptr) {}
Expand All @@ -471,15 +470,7 @@ class SystemStatusNetworkInfo : public SystemStatusItemBase,
mType = itemBase.getType();
}
inline bool equals(const SystemStatusNetworkInfo& peer) {
if ((mAllTypes == peer.mAllTypes) &&
(mTypeName == peer.mTypeName) &&
(mSubTypeName == peer.mSubTypeName) &&
(mAvailable == peer.mAvailable) &&
(mConnected == peer.mConnected) &&
(mRoaming == peer.mRoaming)) {
return true;
}
return false;
return (mAllTypes == peer.mAllTypes);
}
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) {
uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mAllTypes;
Expand Down
26 changes: 14 additions & 12 deletions gps/core/SystemStatusOsObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ void SystemStatusOsObserver::subscribe(const list<DataItemId>& l, IDataItemObser
list<DataItemId>& l, IDataItemObserver* client, bool requestData) :
mParent(parent), mClient(client),
mDataItemSet(containerTransfer<list<DataItemId>, unordered_set<DataItemId>>(l)),
diItemlist(l),
mToRequestData(requestData) {}

void proc() const {
Expand All @@ -107,16 +108,13 @@ void SystemStatusOsObserver::subscribe(const list<DataItemId>& l, IDataItemObser
mParent->sendCachedDataItems(mDataItemSet, mClient);

// Send subscription set to framework
if (nullptr != mParent->mContext.mSubscriptionObj && !dataItemsToSubscribe.empty()) {
LOC_LOGD("Subscribe Request sent to framework for the following");
mParent->logMe(dataItemsToSubscribe);

if (nullptr != mParent->mContext.mSubscriptionObj) {
if (mToRequestData) {
mParent->mContext.mSubscriptionObj->requestData(
containerTransfer<unordered_set<DataItemId>, list<DataItemId>>(
std::move(dataItemsToSubscribe)),
mParent);
} else {
LOC_LOGD("Request Data sent to framework for the following");
mParent->mContext.mSubscriptionObj->requestData(diItemlist, mParent);
} else if (!dataItemsToSubscribe.empty()) {
LOC_LOGD("Subscribe Request sent to framework for the following");
mParent->logMe(dataItemsToSubscribe);
mParent->mContext.mSubscriptionObj->subscribe(
containerTransfer<unordered_set<DataItemId>, list<DataItemId>>(
std::move(dataItemsToSubscribe)),
Expand All @@ -127,6 +125,7 @@ void SystemStatusOsObserver::subscribe(const list<DataItemId>& l, IDataItemObser
mutable SystemStatusOsObserver* mParent;
IDataItemObserver* mClient;
const unordered_set<DataItemId> mDataItemSet;
const list<DataItemId> diItemlist;
bool mToRequestData;
};

Expand Down Expand Up @@ -328,9 +327,12 @@ void SystemStatusOsObserver::notify(const list<IDataItemCore*>& dlist)
for (auto client : clientSet) {
unordered_set<DataItemId> dataItemIdsForThisClient(
mParent->mClientToDataItems.getValSet(client));
for (auto id : dataItemIdsForThisClient) {
if (dataItemIdsToBeSent.find(id) == dataItemIdsToBeSent.end()) {
dataItemIdsForThisClient.erase(id);
for (auto itr = dataItemIdsForThisClient.begin();
itr != dataItemIdsForThisClient.end(); ) {
if (dataItemIdsToBeSent.find(*itr) == dataItemIdsToBeSent.end()) {
itr = dataItemIdsForThisClient.erase(itr);
} else {
itr++;
}
}

Expand Down
7 changes: 4 additions & 3 deletions gps/core/data-items/DataItemConcreteTypesBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ class NetworkInfoDataItemBase : public IDataItemCore {
NetworkInfoDataItemBase(
NetworkType initialType, int32_t type, string typeName, string subTypeName,
bool available, bool connected, bool roaming ):
mAllTypes((initialType >= TYPE_UNKNOWN || initialType < TYPE_MOBILE) ?
0 : (1<<initialType)),
mAllTypes(typeToAllTypes(initialType)),
mType(type),
mTypeName(typeName),
mSubTypeName(subTypeName),
Expand All @@ -263,7 +262,9 @@ class NetworkInfoDataItemBase : public IDataItemCore {
bool mRoaming;
protected:
DataItemId mId;

inline uint64_t typeToAllTypes(NetworkType type) {
return (type >= TYPE_UNKNOWN || type < TYPE_MOBILE) ? 0 : (1<<type);
}
};

class ServiceStatusDataItemBase : public IDataItemCore {
Expand Down
30 changes: 20 additions & 10 deletions gps/gnss/GnssAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
err = mApi.setGpsLock(mConfig.gpsLock);
}
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}
if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_VERSION_VALID_BIT) {
uint32_t newSuplVersion = mAdapter.convertSuplVersion(mConfig.suplVersion);
Expand All @@ -678,8 +679,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
err = LOCATION_ERROR_SUCCESS;
}
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}
if (mConfig.flags & GNSS_CONFIG_FLAGS_SET_ASSISTANCE_DATA_VALID_BIT) {
if (GNSS_ASSISTANCE_TYPE_SUPL == mConfig.assistanceServer.type) {
Expand Down Expand Up @@ -729,8 +731,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
err = LOCATION_ERROR_INVALID_PARAMETER;
}
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}
if (mConfig.flags & GNSS_CONFIG_FLAGS_LPP_PROFILE_VALID_BIT) {
uint32_t newLppProfile = mAdapter.convertLppProfile(mConfig.lppProfile);
Expand All @@ -742,8 +745,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
err = LOCATION_ERROR_SUCCESS;
}
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}
if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_CONTROL_PLANE_VALID_BIT) {
uint32_t newLppeControlPlaneMask =
Expand All @@ -755,8 +759,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
err = LOCATION_ERROR_SUCCESS;
}
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}
if (mConfig.flags & GNSS_CONFIG_FLAGS_LPPE_USER_PLANE_VALID_BIT) {
uint32_t newLppeUserPlaneMask =
Expand All @@ -768,8 +773,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
err = LOCATION_ERROR_SUCCESS;
}
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}
if (mConfig.flags & GNSS_CONFIG_FLAGS_AGLONASS_POSITION_PROTOCOL_VALID_BIT) {
uint32_t newAGloProtMask =
Expand All @@ -782,8 +788,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
err = LOCATION_ERROR_SUCCESS;
}
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}
if (mConfig.flags & GNSS_CONFIG_FLAGS_EM_PDN_FOR_EM_SUPL_VALID_BIT) {
uint32_t newEP4ES = mAdapter.convertEP4ES(mConfig.emergencyPdnForEmergencySupl);
Expand All @@ -792,8 +799,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
}
err = LOCATION_ERROR_SUCCESS;
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}
if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_EM_SERVICES_BIT) {
uint32_t newSuplEs = mAdapter.convertSuplEs(mConfig.suplEmergencyServices);
Expand All @@ -802,8 +810,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
}
err = LOCATION_ERROR_SUCCESS;
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}
if (mConfig.flags & GNSS_CONFIG_FLAGS_SUPL_MODE_BIT) {
uint32_t newSuplMode = mAdapter.convertSuplMode(mConfig.suplModeMask);
Expand All @@ -815,8 +824,9 @@ GnssAdapter::gnssUpdateConfigCommand(GnssConfig config)
}
err = LOCATION_ERROR_SUCCESS;
if (index < mCount) {
errs[index++] = err;
errs[index] = err;
}
index++;
}

mAdapter.reportResponse(index, errs, mIds);
Expand Down
1 change: 0 additions & 1 deletion gps/gnss/XtraSystemStatusObserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
#include <SystemStatus.h>
#include <vector>
#include <sstream>
#include <unistd.h>
#include <XtraSystemStatusObserver.h>
#include <LocAdapterBase.h>
#include <DataItemId.h>
Expand Down

0 comments on commit 947840e

Please sign in to comment.