Merge "DataItem changes to fix incorrect NetworkInfo connect handling" into location.lnx.4.0

This commit is contained in:
Linux Build Service Account 2018-06-11 18:28:13 -07:00 committed by Gerrit - the friendly Code Review server
commit 7ebdafbe04
3 changed files with 7 additions and 15 deletions

View file

@ -1680,7 +1680,7 @@ bool SystemStatus::setDefaultGnssEngineStates(void)
bool SystemStatus::eventConnectionStatus(bool connected, int8_t type) bool SystemStatus::eventConnectionStatus(bool connected, int8_t type)
{ {
// send networkinof dataitem to systemstatus observer clients // send networkinof dataitem to systemstatus observer clients
SystemStatusNetworkInfo s(type, "", "", false, connected, false); SystemStatusNetworkInfo s(type, "", "", connected);
mSysStatusObsvr.notify({&s}); mSysStatusObsvr.notify({&s});
return true; return true;

View file

@ -466,7 +466,6 @@ public:
int32_t type=0, int32_t type=0,
std::string typeName="", std::string typeName="",
string subTypeName="", string subTypeName="",
bool available=false,
bool connected=false, bool connected=false,
bool roaming=false) : bool roaming=false) :
NetworkInfoDataItemBase( NetworkInfoDataItemBase(
@ -474,7 +473,7 @@ public:
type, type,
typeName, typeName,
subTypeName, subTypeName,
available, connected && (!roaming),
connected, connected,
roaming), roaming),
mSrcObjPtr(nullptr) {} mSrcObjPtr(nullptr) {}
@ -484,15 +483,7 @@ public:
mType = itemBase.getType(); mType = itemBase.getType();
} }
inline bool equals(const SystemStatusNetworkInfo& peer) { inline bool equals(const SystemStatusNetworkInfo& peer) {
if ((mAllTypes == peer.mAllTypes) && return (mAllTypes == peer.mAllTypes);
(mTypeName == peer.mTypeName) &&
(mSubTypeName == peer.mSubTypeName) &&
(mAvailable == peer.mAvailable) &&
(mConnected == peer.mConnected) &&
(mRoaming == peer.mRoaming)) {
return true;
}
return false;
} }
inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) { inline virtual SystemStatusItemBase& collate(SystemStatusItemBase& curInfo) {
uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mAllTypes; uint64_t allTypes = (static_cast<SystemStatusNetworkInfo&>(curInfo)).mAllTypes;

View file

@ -236,8 +236,7 @@ public:
NetworkInfoDataItemBase( NetworkInfoDataItemBase(
NetworkType initialType, int32_t type, string typeName, string subTypeName, NetworkType initialType, int32_t type, string typeName, string subTypeName,
bool available, bool connected, bool roaming ): bool available, bool connected, bool roaming ):
mAllTypes((initialType >= TYPE_UNKNOWN || initialType < TYPE_MOBILE) ? mAllTypes(typeToAllTypes(initialType)),
0 : (1<<initialType)),
mType(type), mType(type),
mTypeName(typeName), mTypeName(typeName),
mSubTypeName(subTypeName), mSubTypeName(subTypeName),
@ -263,7 +262,9 @@ public:
bool mRoaming; bool mRoaming;
protected: protected:
DataItemId mId; DataItemId mId;
inline uint64_t typeToAllTypes(NetworkType type) {
return (type >= TYPE_UNKNOWN || type < TYPE_MOBILE) ? 0 : (1<<type);
}
}; };
class ServiceStatusDataItemBase : public IDataItemCore { class ServiceStatusDataItemBase : public IDataItemCore {