./include/notification_error.h
./include/notification_type.h
./include/notification_list.h
+ ./include/notification_ongoing_flag.h
./include/notification_status.h
+ ./include/notification_status_internal.h
./include/notification_setting.h
./include/notification_setting_internal.h
)
*/
int notification_get_type(notification_h noti,
notification_type_e * type);
-
-/**
- * @internal
- * @brief Inserts a notification.
- * @details The notification will be inserted to the database and then it will appear in the notification area.
- * When notification_create() is called, if priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id returns the internally set priv_id.
- * @since_tizen 2.3
- * @privlevel public
- * @privilege %http://tizen.org/privilege/notification
- * @param[in] noti The notification handle
- * @param[out] priv_id The private ID
- * @return #NOTIFICATION_ERROR_NONE on success,
- * otherwise any other value on failure
- * @retval #NOTIFICATION_ERROR_NONE Success
- * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
- * @pre Notification handle should be created by notification_create().
- * @post notification_free().
- * @par Sample code:
- * @code
-#include <notification.h>
-...
- {
- int noti_err = NOTIFICATION_ERROR_NONE;
-
- noti_err = notification_insert(noti, NULL);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
- return;
- }
-}
- * @endcode
- */
-int notification_insert(notification_h noti,
- int *priv_id);
-
/**
* @brief Updates notification data.
* @details The updated notification will appear in the notification area.
int notification_update(notification_h noti);
/**
- * @internal
- * @brief Updates a notification, asynchronously.
- * @details The updated notification will appear in the notification area.
- * @since_tizen 2.3
- * @privlevel public
- * @privilege %http://tizen.org/privilege/notification
- * @remarks This function updates the notification asynchronously.
- * @param[in] noti The notification handle that is created by notification_create()
- * @param[in] result_cb The callback called when an update completed
- * @param[in] user_data The user data which you want to use in callback
- * @return #NOTIFICATION_ERROR_NONE on success,
- * otherwise any other value on failure
- * @retval #NOTIFICATION_ERROR_NONE Success
- * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
- * @retval #NOTIFICATION_ERROR_NOT_EXIST_ID Priv ID does not exist
- * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
- * @par Sample code:
- * @code
-#include <notification.h>
-...
- {
- int noti_err = NOTIFICATION_ERROR_NONE;
-
- noti_err = notification_update_async(NULL, result_cb, data);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
- return;
- }
-}
- * @endcode
- */
-int notification_update_async(notification_h noti,
- void (*result_cb)(int priv_id, int result, void *data), void *user_data);
-
-/**
* @brief Deletes a notification with the given handle.
* @details notification_delete() removes notification data from database and notification_free() releases memory of notification data.
* @since_tizen 2.3
*/
/**
- * @internal
- * @brief Registers a callback for all notification events.
- * @details The registered callback could be called for all notification events.
- * @since_tizen 2.3
- * @privlevel public
- * @privilege %http://tizen.org/privilege/notification
- * @param[in] changed_cb The callback function
- * @param[in] user_data The user data
- * @return #NOTIFICATION_ERROR_NONE on success,
- * otherwise any other value on failure
- * @retval #NOTIFICATION_ERROR_NONE Success
- * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
- * @see notification_unregister_detailed_changed_cb()
- * @par Sample code:
- * @code
-#include <notification.h>
-...
-{
- noti_err = notification_register_detailed_changed_cb(app_changed_cb, user_data);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
- return;
- }
-}
- * @endcode
- */
-int notification_register_detailed_changed_cb(
- void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
- void *user_data);
-
-/**
- * @internal
- * @brief Unregisters a callback for all notification events.
- * @since_tizen 2.3
- * @privlevel public
- * @privilege %http://tizen.org/privilege/notification
- * @param[in] changed_cb The callback function
- * @return #NOTIFICATION_ERROR_NONE on success,
- * otherwise any other value on failure
- * @retval #NOTIFICATION_ERROR_NONE Success
- * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
- * @see notification_register_detailed_changed_cb()
- * @par Sample code:
- * @code
-#include <notification.h>
-...
-{
- noti_err = notification_register_detailed_changed_cb(app_changed_cb, user_data);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
- return;
- }
-}
- * @endcode
- */
-int notification_unregister_detailed_changed_cb(
- void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
- void *user_data);
-
-/**
* @brief Sets the tag of the notification handle.
* @since_tizen 2.3
* @param[in] noti Notification handle
int notification_get_tag(notification_h noti, const char **tag);
/**
- * @internal
- * @brief Gets the package name of the notification
- * @remarks The pkgname must be released using free()
- * @since_tizen 2.4
- * @privlevel NP
- * @param[in] noti Notification handle
- * @param[out] pkgname package name of the notification
- * @return NOTIFICATION_ERROR_NONE on success, other value on failure
- * @retval NOTIFICATION_ERROR_NONE Success
- * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
- * @par Sample code:
- * @code
-#include <notification.h>
-...
-{
- notification_h noti = NULL;
- int noti_err = NOTIFICATION_ERROR_NONE;
- char *pkgname = NULL;
-
- noti_err = notification_get_pkgname(noti, &pkgname);
- if(noti_err != NOTIFICATION_ERROR_NONE) {
- return;
- }
-}
- * @endcode
- */
-int notification_get_pkgname(notification_h noti, char **pkgname);
-
-/**
* @brief Loads a notification from the notification's database with the tag.
* @since_tizen 2.3
* @privlevel public
*/
int notification_get_permission(notification_h handle, notification_permission_type_e *permission_type, const char **app_id);
+/**
+ * @brief Gets the package name of the notification
+ * @remarks The pkgname must be released using free()
+ * @since_tizen 2.4
+ * @param[in] noti Notification handle
+ * @param[out] pkgname The package name of the notification
+ * @return #NOTIFICATION_ERROR_NONE on success, otherwise a negative error value
+ * @retval NOTIFICATION_ERROR_NONE Success
+ * @retval NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ char *pkgname = NULL;
+
+ ...
+
+ noti_err = notification_get_pkgname(noti, &pkgname);
+
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ free(pkgname);
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_get_pkgname(notification_h noti, char **pkgname);
/**
* @}
const char **text,
bundle **service_handle);
-int notification_set_ongoing_flag(notification_h noti, bool ongoing_flag);
+/**
+ * @internal
+ * @brief Inserts a notification.
+ * @details The notification will be inserted to the database and then it will appear in the notification area.
+ * When notification_create() is called, if priv_id is #NOTIFICATION_PRIV_ID_NONE, priv_id returns the internally set priv_id.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/notification
+ * @param[in] noti The notification handle
+ * @param[out] priv_id The private ID
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @pre Notification handle should be created by notification_create().
+ * @post notification_free().
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+ {
+ int noti_err = NOTIFICATION_ERROR_NONE;
-int notification_get_ongoing_flag(notification_h noti, bool *ongoing_flag);
+ noti_err = notification_insert(noti, NULL);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_insert(notification_h noti,
+ int *priv_id);
/**
+ * @internal
+ * @brief Updates a notification, asynchronously.
+ * @details The updated notification will appear in the notification area.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/notification
+ * @remarks This function updates the notification asynchronously.
+ * @param[in] noti The notification handle that is created by notification_create()
+ * @param[in] result_cb The callback called when an update completed
+ * @param[in] user_data The user data which you want to use in callback
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
+ * @retval #NOTIFICATION_ERROR_NOT_EXIST_ID Priv ID does not exist
+ * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+ {
+ int noti_err = NOTIFICATION_ERROR_NONE;
+
+ noti_err = notification_update_async(NULL, result_cb, data);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_update_async(notification_h noti,
+ void (*result_cb)(int priv_id, int result, void *data), void *user_data);
+
+/**
+ * @internal
+ * @brief Registers a callback for all notification events.
+ * @details The registered callback could be called for all notification events.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/notification
+ * @param[in] changed_cb The callback function
+ * @param[in] user_data The user data
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @see notification_unregister_detailed_changed_cb()
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ noti_err = notification_register_detailed_changed_cb(app_changed_cb, user_data);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_register_detailed_changed_cb(
+ void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
+ void *user_data);
+
+/**
+ * @internal
+ * @brief Unregisters a callback for all notification events.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/notification
+ * @param[in] changed_cb The callback function
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @see notification_register_detailed_changed_cb()
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ noti_err = notification_register_detailed_changed_cb(app_changed_cb, user_data);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_unregister_detailed_changed_cb(
+ void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
+ void *user_data);
+/**
* @}
*/
--- /dev/null
+/*
+ * libnotification
+ *
+ * Copyright (c) 2015 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Kyuho Jo <kyuho.jo@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __NOTIFICATION_ONGOING_FLAG_H__
+#define __NOTIFICATION_ONGOING_FLAG_H__
+
+#include <notification.h>
+
+/**
+ * @brief Sets the ongoing flag of the notification
+ * @since_tizen 2.4
+ * @param[in] noti The notification handle
+ * @param[in] ongoing_flag The ongoing flag
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ bundle *b = NULL;
+
+ noti = notification_create(NOTIFICATION_TYPE_NOTI);
+ if(noti == NULL) {
+ return;
+ }
+
+ noti_err = notification_set_ongoing_flag(noti, true);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ notification_free(noti);
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_set_ongoing_flag(notification_h noti, bool ongoing_flag);
+
+/**
+ * @brief Gets the ongoing flag of the notification
+ * @since_tizen 2.4
+ * @param[in] noti The notification handle
+ * @param[out] ongoing_flag The ongoing flag
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid input value
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ notification_h noti = NULL;
+ int noti_err = NOTIFICATION_ERROR_NONE;
+ bool ongoing_flag = 0;
+
+ noti_err = notification_get_ongoing_flag(noti, &ongoing_flag);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_get_ongoing_flag(notification_h noti, bool *ongoing_flag);
+
+#endif /* __NOTIFICATION_ONGOING_H__ */
*/
/**
- * @internal
- * @brief Called when a new message is posted.
- * @since_tizen 2.3
- * @param[in] message The message posted
- * @param[in] data The user data
- * @pre notification_status_monitor_message_cb_set() used to register this callback.
- * @see notification_status_monitor_message_cb_set()
-*/
-typedef void (*notification_status_message_cb)(const char *message, void *data);
-
-/**
- * @internal
- * @brief Registers a callback to receive a message.
- * @since_tizen 2.3
- * @param[in] callback The callback function
- * @param[in] data The user_data
- * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
- * @retval #NOTIFICATION_ERROR_NONE Success
- * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #NOTIFICATION_ERROR_FROM_DBUS Error from DBus
- */
-int notification_status_monitor_message_cb_set(notification_status_message_cb callback, void *user_data);
-
-/**
- * @internal
- * @brief Unregisters a callback to receive a message.
- * @since_tizen 2.3
- * @param[in] callback The callback function
- * @param[in] data The user_data
- * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
- * @retval #NOTIFICATION_ERROR_NONE Success
- */
-int notification_status_monitor_message_cb_unset(void);
-
-/**
* @brief Sends a string (message) to the notification status monitor.
* @since_tizen 2.3
* @privlevel public
--- /dev/null
+/*
+ * libnotification
+ *
+ * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Seungtaek Chung <seungtaek.chung@samsung.com>, Mi-Ju Lee <miju52.lee@samsung.com>, Xi Zhichan <zhichan.xi@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+#ifndef __NOTIFICATION_STATUS_INTERNAL_DEF_H__
+#define __NOTIFICATION_STATUS_INTERNAL_DEF_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @file notification_status_internal.h
+ */
+
+/**
+ * @addtogroup NOTIFICATION_STATUS
+ * @{
+ */
+
+/**
+ * @internal
+ * @brief Unregisters a callback for all notification events.
+ * @since_tizen 2.3
+ * @privlevel public
+ * @privilege %http://tizen.org/privilege/notification
+ * @param[in] changed_cb The callback function
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_PERMISSION_DENIED The application does not have the privilege to call this method
+ * @see notification_register_detailed_changed_cb()
+ * @par Sample code:
+ * @code
+#include <notification.h>
+...
+{
+ noti_err = notification_register_detailed_changed_cb(app_changed_cb, user_data);
+ if(noti_err != NOTIFICATION_ERROR_NONE) {
+ return;
+ }
+}
+ * @endcode
+ */
+int notification_unregister_detailed_changed_cb(
+ void (*detailed_changed_cb)(void *data, notification_type_e type, notification_op *op_list, int num_op),
+ void *user_data);
+
+/**
+ * @internal
+ * @brief Called when a new message is posted.
+ * @since_tizen 2.3
+ * @param[in] message The message posted
+ * @param[in] data The user data
+ * @pre notification_status_monitor_message_cb_set() used to register this callback.
+ * @see notification_status_monitor_message_cb_set()
+*/
+typedef void (*notification_status_message_cb)(const char *message, void *data);
+
+/**
+ * @internal
+ * @brief Registers a callback to receive a message.
+ * @since_tizen 2.3
+ * @param[in] callback The callback function
+ * @param[in] data The user_data
+ * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_FROM_DBUS Error from DBus
+ */
+int notification_status_monitor_message_cb_set(notification_status_message_cb callback, void *user_data);
+
+/**
+ * @internal
+ * @brief Unregisters a callback to receive a message.
+ * @since_tizen 2.3
+ * @param[in] callback The callback function
+ * @param[in] data The user_data
+ * @return #NOTIFICATION_ERROR_NONE if success, other value if failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ */
+int notification_status_monitor_message_cb_unset(void);
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+#endif /* __NOTIFICATION_STATUS_INTERNAL_DEF_H__ */
Name: notification
Summary: notification library
-Version: 0.2.30
+Version: 0.2.31
Release: 1
Group: TBD
License: Apache
%{_includedir}/notification/notification_error.h
%{_includedir}/notification/notification_type.h
%{_includedir}/notification/notification_list.h
+%{_includedir}/notification/notification_ongoing_flag.h
%{_includedir}/notification/notification_status.h
+%{_includedir}/notification/notification_status_internal.h
%{_includedir}/notification/notification_setting.h
%{_includedir}/notification/notification_setting_internal.h
%{_libdir}/pkgconfig/notification.pc
return NOTIFICATION_ERROR_INVALID_PARAMETER;
}
- if ((ret = app_control_to_bundle(app_control, &b)) == APP_CONTROL_ERROR_NONE) {
+ if ((ret = app_control_export_as_bundle(app_control, &b)) == APP_CONTROL_ERROR_NONE) {
return notification_set_execute_option(noti,
NOTIFICATION_EXECUTE_TYPE_SINGLE_LAUNCH,
NULL, NULL,
goto out;
}
- if ((err = app_control_to_bundle(event_handler, &app_control_bundle)) != APP_CONTROL_ERROR_NONE) {
+ if ((err = app_control_export_as_bundle(event_handler, &app_control_bundle)) != APP_CONTROL_ERROR_NONE) {
NOTIFICATION_ERR("app_control_to_bundle failed [%d]", err);
goto out;
}
return err;
}
+
EXPORT_API int notification_setting_db_update_system_setting(int do_not_disturb, int visibility_class)
{
int err = NOTIFICATION_ERROR_NONE;
- sqlite3 *db = NULL;
- char *sqlbuf = NULL;
+ char *query_buffer = NULL;
int sqlret;
+ int field_index = 0;
+ sqlite3 *db = NULL;
+ sqlite3_stmt *db_statement = NULL;
sqlret = db_util_open(DBPATH, &db, 0);
+
if (sqlret != SQLITE_OK || db == NULL) {
- NOTIFICATION_ERR("db_util_open failed [%s][%d]", DBPATH, sqlret);
- return NOTIFICATION_ERROR_FROM_DB;
+ NOTIFICATION_ERR("db_util_open failed [%s][%d][%s]", DBPATH, sqlret, sqlite3_errmsg(db));
+ err = NOTIFICATION_ERROR_FROM_DB;
+ goto return_close_db;
}
- sqlbuf = sqlite3_mprintf("UPDATE %s SET do_not_disturb = %d, visibility_class = %d ",
- NOTIFICATION_SYSTEM_SETTING_DB_TABLE, do_not_disturb, visibility_class);
+ query_buffer = strdup("UPDATE ? SET do_not_disturb = ?, visibility_class = ? ");
- if (!sqlbuf) {
+ if (query_buffer == NULL) {
NOTIFICATION_ERR("fail to alloc query");
err = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto return_close_db;
}
- err = notification_db_exec(db, sqlbuf, NULL);
+ sqlret = sqlite3_prepare_v2(db, query_buffer, strlen(query_buffer), &db_statement, NULL);
- return_close_db:
- if (sqlbuf)
- sqlite3_free(sqlbuf);
+ if (sqlret != SQLITE_OK) {
+ NOTIFICATION_ERR("sqlite3_prepare_v2 failed [%d][%s]", sqlret, sqlite3_errmsg(db));
+ err = NOTIFICATION_ERROR_FROM_DB;
+ goto return_close_db;
+ }
+
+ sqlite3_bind_text(db_statement, field_index++, NOTIFICATION_SYSTEM_SETTING_DB_TABLE, -1, SQLITE_STATIC);
+ sqlite3_bind_int(db_statement, field_index++, do_not_disturb);
+ sqlite3_bind_int(db_statement, field_index++, visibility_class);
+
+ sqlret = sqlite3_step(db_statement);
+
+ if (sqlret != SQLITE_OK && sqlret != SQLITE_DONE) {
+ NOTIFICATION_ERR("sqlite3_step failed [%d][%s]", sqlret, sqlite3_errmsg(db));
+ err = NOTIFICATION_ERROR_FROM_DB;
+ goto return_close_db;
+ }
+
+ sqlret = sqlite3_changes(db);
+
+ if (sqlret != SQLITE_OK && sqlret != SQLITE_DONE) {
+ NOTIFICATION_ERR("sqlite3_changes failed [%d][%s]", sqlret, sqlite3_errmsg(db));
+ err = NOTIFICATION_ERROR_FROM_DB;
+ goto return_close_db;
+ }
+
+return_close_db:
+
+ if (query_buffer)
+ free(query_buffer);
+
+ if (db_statement)
+ sqlite3_finalize(db_statement);
+
+ if (db)
+ sqlret = db_util_close(db);
- sqlret = db_util_close(db);
if (sqlret != SQLITE_OK) {
NOTIFICATION_WARN("fail to db_util_close - [%d]", sqlret);
}
#include <notification_debug.h>
#include <notification_private.h>
#include <notification_status.h>
+#include <notification_status_internal.h>
#define PATH_NAME "/Org/Tizen/System/Notification/Status_message"
#define INTERFACE_NAME "org.tizen.system.notification.status_message"
goto FINISH_OFF;
}
- noti_err = notification_post(noti_handle);
-
app_control_destroy(app_control);
app_control = NULL;
+ noti_err = notification_post(noti_handle);
+
if (noti_err != NOTIFICATION_ERROR_NONE) {
testapp_print("notification_post failed[%d]", noti_err);
goto FINISH_OFF;
goto FINISH_OFF;
}
- /*
if (noti_handle)
notification_free(noti_handle);
noti_handle = NULL;
- */
noti_handle = notification_load(NULL, priv_id);
app_control_get_app_id(app_control, &app_id);
if (app_id) {
- testapp_print("result app_id [%s]", app_id);
+ testapp_print("result app_id [%s]\n", app_id);
free(app_id);
}