From 4c4660c11be67a6b5ce60ab427ae3a07d0f3354c 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 ff5e7548..46e004a8 100644 --- a/core/SystemStatus.h +++ b/core/SystemStatus.h @@ -523,8 +523,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); } }; @@ -536,8 +537,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 065366d3..d35c5450 100644 --- a/core/data-items/DataItemConcreteTypesBase.h +++ b/core/data-items/DataItemConcreteTypesBase.h @@ -313,24 +313,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; };