diff options
author | mk5004.lee <mk5004.lee@samsung.com> | 2019-11-07 16:24:29 +0900 |
---|---|---|
committer | mk5004.lee <mk5004.lee@samsung.com> | 2020-01-22 11:44:01 +0900 |
commit | 5b09c12b983f830459d52968bbd3dcf2d472459a (patch) | |
tree | 7e0cb806eeeeb305e3491905027d64657d38efe0 /notification-ex/stub.cc | |
parent | 099863a502b510ccf1437289d33f00d83f281965 (diff) | |
download | notification-5b09c12b983f830459d52968bbd3dcf2d472459a.tar.gz notification-5b09c12b983f830459d52968bbd3dcf2d472459a.tar.bz2 notification-5b09c12b983f830459d52968bbd3dcf2d472459a.zip |
Add new func for extentsion data
Change-Id: I2f73802e9750ae027e029408d71c0ce76ad6a40e
Signed-off-by: mk5004.lee <mk5004.lee@samsung.com>
Diffstat (limited to 'notification-ex/stub.cc')
-rw-r--r-- | notification-ex/stub.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc index 0f0d6d6..b11bd92 100644 --- a/notification-ex/stub.cc +++ b/notification-ex/stub.cc @@ -2509,6 +2509,39 @@ extern "C" EXPORT_API int noti_ex_item_find_by_main_type(noti_ex_item_h handle, return NOTI_EX_ERROR_NONE; } +extern "C" EXPORT_API int noti_ex_item_get_extension_data(noti_ex_item_h handle, + const char *key, bundle **value) { + if (handle == nullptr || key == nullptr || value == nullptr) { + LOGE("Invalid handle type"); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + Handle* p = static_cast<Handle*>(handle); + + Bundle b = p->Get()->GetExtensionData(key); + if (b.GetCount() == 0) + *value = nullptr; + else + *value = b.GetHandle(); + + return NOTI_EX_ERROR_NONE; +} + +extern "C" EXPORT_API int noti_ex_item_set_extension_data(noti_ex_item_h handle, + const char *key, bundle *value) { + if (handle == nullptr || key == nullptr || value == nullptr) { + LOGE("Invalid handle type"); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + Bundle b = Bundle(value); + + Handle* p = static_cast<Handle*>(handle); + p->Get()->SetExtensionData(key, b); + + return NOTI_EX_ERROR_NONE; +} + extern "C" EXPORT_API int noti_ex_manager_create(noti_ex_manager_h *handle, const char *receiver_group, noti_ex_manager_events_s event_callbacks, void *data) { |