From 5e668b0b04f2277105aecee8b81b6d1afa77ca19 Mon Sep 17 00:00:00 2001 From: Kyuho Jo Date: Thu, 4 Jun 2015 15:16:28 +0900 Subject: [PATCH] Changes for using new notification API. Change-Id: I9b31bbe1bdfdfd4be10a7405721a75373ddece9b Signed-off-by: Kyuho Jo --- src/agent/ui/AskUINotificationBackend.cpp | 18 +++++++++--------- src/agent/ui/AskUINotificationBackend.h | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/agent/ui/AskUINotificationBackend.cpp b/src/agent/ui/AskUINotificationBackend.cpp index 99de50e..16df9d6 100644 --- a/src/agent/ui/AskUINotificationBackend.cpp +++ b/src/agent/ui/AskUINotificationBackend.cpp @@ -36,11 +36,11 @@ namespace { -const char *errorToString(notification_error_e error) { - if (error == NOTIFICATION_ERROR_INVALID_DATA) - return "NOTIFICATION_ERROR_INVALID_DATA"; - if (error == NOTIFICATION_ERROR_NO_MEMORY) - return "NOTIFICATION_ERROR_NO_MEMORY"; +const char *errorToString(int error) { + if (error == NOTIFICATION_ERROR_INVALID_PARAMETER) + return "NOTIFICATION_ERROR_INVALID_PARAMETER"; + if (error == NOTIFICATION_ERROR_OUT_OF_MEMORY) + return "NOTIFICATION_ERROR_OUT_OF_MEMORY"; if (error == NOTIFICATION_ERROR_FROM_DB) return "NOTIFICATION_ERROR_FROM_DB"; if (error == NOTIFICATION_ERROR_ALREADY_EXIST_ID) @@ -49,8 +49,8 @@ const char *errorToString(notification_error_e error) { return "NOTIFICATION_ERROR_FROM_DBUS"; if (error == NOTIFICATION_ERROR_NOT_EXIST_ID) return "NOTIFICATION_ERROR_NOT_EXIST_ID"; - if (error == NOTIFICATION_ERROR_IO) - return "NOTIFICATION_ERROR_IO"; + if (error == NOTIFICATION_ERROR_IO_ERROR) + return "NOTIFICATION_ERROR_IO_ERROR"; if (error == NOTIFICATION_ERROR_SERVICE_NOT_READY) return "NOTIFICATION_ERROR_SERVICE_NOT_READY"; if (error == NOTIFICATION_ERROR_NONE) @@ -95,7 +95,7 @@ bool AskUINotificationBackend::start(const std::string &client, const std::strin bool AskUINotificationBackend::createUI(const std::string &client, const std::string &user, const std::string &privilege) { - notification_error_e err; + int err; m_notification = notification_new(NOTIFICATION_TYPE_NOTI, NOTIFICATION_GROUP_ID_NONE, NOTIFICATION_PRIV_ID_NONE); @@ -223,7 +223,7 @@ void AskUINotificationBackend::run() { try { int buttonClicked = 0; - notification_error_e ret = notification_wait_response(m_notification, m_responseTimeout, + int ret = notification_wait_response(m_notification, m_responseTimeout, &buttonClicked, nullptr); ALOGD("notification_wait_response finished with ret code: [" << ret << "]"); diff --git a/src/agent/ui/AskUINotificationBackend.h b/src/agent/ui/AskUINotificationBackend.h index 1f77bd0..b57a11c 100644 --- a/src/agent/ui/AskUINotificationBackend.h +++ b/src/agent/ui/AskUINotificationBackend.h @@ -23,6 +23,8 @@ #include #include +#include +#include #include #include -- 2.7.4