From f59841497ce72aaa068ab248033efa9142948485 Mon Sep 17 00:00:00 2001 From: Jusung Son Date: Fri, 23 Aug 2019 10:44:32 +0900 Subject: Apply API version Change-Id: I98a5fa33fc1772f868da91bc4c0ac3ef20f4e170 Signed-off-by: Jusung Son --- notification-ex/abstract_item.cc | 4 +- notification-ex/abstract_item.h | 6 +++ notification-ex/abstract_item_implementation.h | 2 +- notification-ex/api/notification_ex_internal.h | 10 +++++ notification-ex/db_manager.cc | 57 +++++++++++++++++--------- notification-ex/db_manager.h | 14 +++++-- notification-ex/event_info.cc | 12 ++++++ notification-ex/event_info_implementation.h | 2 + notification-ex/event_info_internal.h | 2 + notification-ex/ievent_info.h | 2 + notification-ex/ievent_info_internal.h | 2 + notification-ex/iitem_info_internal.h | 6 +-- notification-ex/item_info.cc | 9 ++-- notification-ex/item_info_internal.h | 6 +-- notification-ex/manager.cc | 25 +++++++++-- notification-ex/manager.h | 2 + notification-ex/manager_implementation.h | 1 + notification-ex/stub.cc | 47 +++++++++++++++++++-- notification/src/notification_convert.c | 14 +++++-- unittest/src/test_abstract_item.cc | 10 ++--- 20 files changed, 181 insertions(+), 52 deletions(-) diff --git a/notification-ex/abstract_item.cc b/notification-ex/abstract_item.cc index f39331e..91d256f 100644 --- a/notification-ex/abstract_item.cc +++ b/notification-ex/abstract_item.cc @@ -141,7 +141,7 @@ Bundle AbstractItem::Serialize() const { b.Add(ABSTRACT_ITEM_ID_KEY, impl_->id_); b.Add(ABSTRACT_ITEM_SENDER_APPID_KEY, GetSenderAppId().c_str()); b.Add(ABSTRACT_ITEM_TYPE_KEY, to_string(GetType())); - b.Add(ABSTRACT_ITEM_VERSION_KEY, to_string(impl_->version_)); + b.Add(ABSTRACT_ITEM_VERSION_KEY, to_string(static_cast(impl_->version_))); b.Add(ABSTRACT_ITEM_HIDE_TIME_KEY, to_string(impl_->hide_time_)); b.Add(ABSTRACT_ITEM_DELETE_TIME_KEY, to_string(impl_->delete_time_)); b.Add(ABSTRACT_ITEM_UID_KEY, to_string(impl_->uid_)); @@ -246,7 +246,7 @@ void AbstractItem::Deserialize(Bundle b) { impl_->id_ = b.GetString(ABSTRACT_ITEM_ID_KEY); impl_->sender_appid_ = b.GetString(ABSTRACT_ITEM_SENDER_APPID_KEY); impl_->channel_ = b.GetString(ABSTRACT_ITEM_CHANNEL_KEY); - impl_->version_ = stoi(b.GetString(ABSTRACT_ITEM_VERSION_KEY)); + impl_->version_ = static_cast(stoi(b.GetString(ABSTRACT_ITEM_VERSION_KEY))); impl_->hide_time_ = stoi(b.GetString(ABSTRACT_ITEM_HIDE_TIME_KEY)); impl_->delete_time_ = stoi(b.GetString(ABSTRACT_ITEM_DELETE_TIME_KEY)); impl_->can_receive_ = b.GetString(ABSTRACT_ITEM_CAN_RECEIVE_KEY); diff --git a/notification-ex/abstract_item.h b/notification-ex/abstract_item.h index e9961a7..e2af2e8 100644 --- a/notification-ex/abstract_item.h +++ b/notification-ex/abstract_item.h @@ -375,6 +375,12 @@ class EXPORT_API AbstractItem { SimMode = 1 << 1, }; + enum Version { + Legacy = 1 << 0, + Extension = 1 << 1, + ALL = Legacy | Extension + }; + public: /** * @brief Constructor diff --git a/notification-ex/abstract_item_implementation.h b/notification-ex/abstract_item_implementation.h index 24a434b..92d851f 100644 --- a/notification-ex/abstract_item_implementation.h +++ b/notification-ex/abstract_item_implementation.h @@ -48,7 +48,7 @@ class AbstractItem::Impl { std::shared_ptr