diff options
author | Jusung Son <jusung07.son@samsung.com> | 2019-08-23 10:44:32 +0900 |
---|---|---|
committer | Jusung Son <jusung07.son@samsung.com> | 2019-10-08 15:55:42 +0900 |
commit | f59841497ce72aaa068ab248033efa9142948485 (patch) | |
tree | a4b18872066b05a99765dadd624bbf731de0b60e /notification-ex/stub.cc | |
parent | c74f15730cd40d853e3a54561a789634da6ad00e (diff) | |
download | notification-sandbox/noti_ex_porting.tar.gz notification-sandbox/noti_ex_porting.tar.bz2 notification-sandbox/noti_ex_porting.zip |
Apply API versionsandbox/noti_ex_porting
Change-Id: I98a5fa33fc1772f868da91bc4c0ac3ef20f4e170
Signed-off-by: Jusung Son <jusung07.son@samsung.com>
Diffstat (limited to 'notification-ex/stub.cc')
-rw-r--r-- | notification-ex/stub.cc | 47 |
1 files changed, 44 insertions, 3 deletions
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<Handle*>(item); - *version = - static_pointer_cast<IItemInfoInternal>(h->Get()->GetInfo())->GetVersion(); + *version = static_cast<int>( + static_pointer_cast<IItemInfoInternal>(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<Handle*>(item); - static_pointer_cast<IItemInfoInternal>(h->Get()->GetInfo())->SetVersion(version); + static_pointer_cast<IItemInfoInternal>(h->Get()->GetInfo()) + ->SetVersion(static_cast<AbstractItem::Version>(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<ManagerStub*>(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<ManagerStub*>(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; +} + |