diff options
author | MyungKi Lee <mk5004.lee@samsung.com> | 2020-05-21 00:40:10 +0000 |
---|---|---|
committer | jusung son <jusung07.son@samsung.com> | 2020-05-26 05:12:16 +0000 |
commit | 4d4b971c114ce15e4487f9eaca9f08912161a7ae (patch) | |
tree | abe8b93e43067ba1f7d5cbcf01b2612fb078de82 /notification-ex/stub.cc | |
parent | e34aa5f6064f6983c7e2ca40e73d0ced09ce907a (diff) | |
download | notification-4d4b971c114ce15e4487f9eaca9f08912161a7ae.tar.gz notification-4d4b971c114ce15e4487f9eaca9f08912161a7ae.tar.bz2 notification-4d4b971c114ce15e4487f9eaca9f08912161a7ae.zip |
Revert "Revert "Add get_count api for reporter""
This reverts commit 0afc4c5514e475b98b5dcdda915ab856a1a50c70.
Change-Id: I53a4c9b6aac18d272b69da45903ad15d4b500d40
Diffstat (limited to 'notification-ex/stub.cc')
-rw-r--r-- | notification-ex/stub.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc index dd8f1f0..4f6fb0c 100644 --- a/notification-ex/stub.cc +++ b/notification-ex/stub.cc @@ -3332,6 +3332,24 @@ extern "C" EXPORT_API int noti_ex_reporter_find_all(noti_ex_reporter_h handle, return NOTI_EX_ERROR_NONE; } +extern "C" EXPORT_API int noti_ex_reporter_get_count_by_channel( + noti_ex_reporter_h handle, const char *channel, int *count) { + if (handle == nullptr || channel == nullptr || count == nullptr) { + LOGE("Invalid parameter"); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + try { + ReporterStub* stub = static_cast<ReporterStub*>(handle); + *count = stub->GetCount(channel); + } catch (Exception &ex) { + LOGE("%s %d", ex.what(), ex.GetErrorCode()); + return NOTI_EX_ERROR_IO_ERROR; + } + + return NOTI_EX_ERROR_NONE; +} + extern "C" EXPORT_API int noti_ex_item_text_create(noti_ex_item_h *handle, const char *id, const char *text, const char *hyperlink) { if (handle == nullptr || text == nullptr) { |