summaryrefslogtreecommitdiff
path: root/notification-ex/stub.cc
diff options
context:
space:
mode:
Diffstat (limited to 'notification-ex/stub.cc')
-rw-r--r--notification-ex/stub.cc47
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;
+}
+