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/stub.cc | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) (limited to 'notification-ex/stub.cc') diff --git a/notification-ex/stub.cc b/notification-ex/stub.cc index 81aa458..1f3eca4 100644 --- a/notification-ex/stub.cc +++ b/notification-ex/stub.cc @@ -2641,8 +2641,9 @@ extern "C" EXPORT_API int noti_ex_item_get_version( } Handle* h = static_cast(item); - *version = - static_pointer_cast(h->Get()->GetInfo())->GetVersion(); + *version = static_cast( + static_pointer_cast(h->Get()->GetInfo()) + ->GetVersion()); return NOTI_EX_ERROR_NONE; } @@ -2655,7 +2656,8 @@ extern "C" EXPORT_API int noti_ex_item_set_version( } Handle* h = static_cast(item); - static_pointer_cast(h->Get()->GetInfo())->SetVersion(version); + static_pointer_cast(h->Get()->GetInfo()) + ->SetVersion(static_cast(version)); return NOTI_EX_ERROR_NONE; } @@ -2813,3 +2815,42 @@ extern "C" EXPORT_API int noti_ex_item_create( return NOTI_EX_ERROR_NONE; } + +extern "C" EXPORT_API int noti_ex_manager_set_unified_mode( + noti_ex_manager_h handle, bool mode) +{ + if (handle == nullptr) { + LOGE("Invalid parameter"); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + try { + ManagerStub* stub = static_cast(handle); + stub->SetUnifiedMode(mode); + } 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_manager_get_unified_mode( + noti_ex_manager_h handle, bool* mode) +{ + if (handle == nullptr || mode == nullptr) { + LOGE("Invalid parameter"); + return NOTI_EX_ERROR_INVALID_PARAMETER; + } + + try { + ManagerStub* stub = static_cast(handle); + *mode = stub->GetUnifiedMode(); + } catch (Exception &ex) { + LOGE("%s %d", ex.what(), ex.GetErrorCode()); + return NOTI_EX_ERROR_IO_ERROR; + } + + return NOTI_EX_ERROR_NONE; +} + -- cgit v1.2.3