summaryrefslogtreecommitdiff
path: root/core/data-items/DataItemConcreteTypesBase.h
diff options
context:
space:
mode:
authorKevin Tang <zhikait@codeaurora.org>2018-05-11 10:03:33 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-06-27 18:22:31 -0700
commit802e89fcdfedb55e317ad1464db9d30d79edd63f (patch)
tree4deb328303b738c22ed1fb1bdcc2cfcb3ca708c4 /core/data-items/DataItemConcreteTypesBase.h
parent309ff25859a3c016f09302586c6cf3ca80121e8e (diff)
downloadgps-802e89fcdfedb55e317ad1464db9d30d79edd63f.tar.gz
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
Diffstat (limited to 'core/data-items/DataItemConcreteTypesBase.h')
-rw-r--r--core/data-items/DataItemConcreteTypesBase.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/core/data-items/DataItemConcreteTypesBase.h b/core/data-items/DataItemConcreteTypesBase.h
index 45cd325..bcb8d72 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;
};