From 802e89fcdfedb55e317ad1464db9d30d79edd63f Mon Sep 17 00:00:00 2001 From: Kevin Tang Date: Fri, 11 May 2018 10:03:33 -0700 Subject: [PATCH] fixed data items for service and cell info which right now are not keeping any data into the SSOO's table, therefore it is not able to determine if the new data arrives is different than the current one. This results in not passing the following data updates to the clients. Change-Id: Ieb94e959228d9a9f8d43b090f3328208387d864f CRs-Fixed: 2239616 --- core/SystemStatus.h | 10 ++++--- core/data-items/DataItemConcreteTypesBase.h | 30 ++++++++++++++++----- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/core/SystemStatus.h b/core/SystemStatus.h index 657720d4..b2f4fb6a 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -514,8 +514,9 @@ public: RilServiceInfoDataItemBase() {} inline SystemStatusServiceInfo(const RilServiceInfoDataItemBase& itemBase) : RilServiceInfoDataItemBase(itemBase) {} - inline bool equals(const SystemStatusServiceInfo& /*peer*/) { - return true; + inline bool equals(const SystemStatusServiceInfo& peer) { + return static_cast(peer) == + static_cast(*this); } }; @@ -527,8 +528,9 @@ public: RilCellInfoDataItemBase() {} inline SystemStatusRilCellInfo(const RilCellInfoDataItemBase& itemBase) : RilCellInfoDataItemBase(itemBase) {} - inline bool equals(const SystemStatusRilCellInfo& /*peer*/) { - return true; + inline bool equals(const SystemStatusRilCellInfo& peer) { + return static_cast(peer) == + static_cast(*this); } }; diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h index 45cd3253..bcb8d725 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -314,24 +314,42 @@ protected: class RilServiceInfoDataItemBase : public IDataItemCore { public: - RilServiceInfoDataItemBase() : - mId(RILSERVICEINFO_DATA_ITEM_ID) {} - virtual ~RilServiceInfoDataItemBase() {} + inline RilServiceInfoDataItemBase() : + mData(nullptr), mId(RILSERVICEINFO_DATA_ITEM_ID) {} + inline virtual ~RilServiceInfoDataItemBase() { if (nullptr != mData) free(mData); } inline virtual DataItemId getId() { return mId; } virtual void stringify(string& /*valueStr*/) {} virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} + inline RilServiceInfoDataItemBase(const RilServiceInfoDataItemBase& peer) : + RilServiceInfoDataItemBase() { + peer.setPeerData(*this); + } + inline virtual bool operator==(const RilServiceInfoDataItemBase& other) const { + return other.mData == mData; + } + inline virtual void setPeerData(RilServiceInfoDataItemBase& /*peer*/) const {} + void* mData; protected: DataItemId mId; }; class RilCellInfoDataItemBase : public IDataItemCore { public: - RilCellInfoDataItemBase() : - mId(RILCELLINFO_DATA_ITEM_ID) {} - virtual ~RilCellInfoDataItemBase() {} + inline RilCellInfoDataItemBase() : + mData(nullptr), mId(RILCELLINFO_DATA_ITEM_ID) {} + inline virtual ~RilCellInfoDataItemBase() { if (nullptr != mData) free(mData); } inline virtual DataItemId getId() { return mId; } virtual void stringify(string& /*valueStr*/) {} virtual int32_t copy(IDataItemCore* /*src*/, bool* /*dataItemCopied = NULL*/) {return 1;} + inline RilCellInfoDataItemBase(const RilCellInfoDataItemBase& peer) : + RilCellInfoDataItemBase() { + peer.setPeerData(*this); + } + inline virtual bool operator==(const RilCellInfoDataItemBase& other) const { + return other.mData == mData; + } + inline virtual void setPeerData(RilCellInfoDataItemBase& /*peer*/) const {} + void* mData; protected: DataItemId mId; };