Apply consistent log messages.
[platform/core/system/system-popup.git] / src / common / popup-common.c
old mode 100755 (executable)
new mode 100644 (file)
index f3cfdae..dc82434
 
 static E_DBus_Connection *edbus_conn = NULL;
 
-/* Terminate popup */
+/* Terminate window */
 static Eina_Bool exit_idler_cb(void *data)
 {
        elm_exit();
        return ECORE_CALLBACK_CANCEL;
 }
 
-void popup_terminate(void)
+void window_terminate(void)
 {
        if (ecore_idler_add(exit_idler_cb, NULL))
                return;
@@ -48,7 +48,7 @@ void play_feedback(int type, int pattern)
 
        ret = feedback_initialize();
        if (ret != FEEDBACK_ERROR_NONE) {
-               _E("Cannot initialize feedback");
+               _E("Cannot initialize feedback.");
                return;
        }
 
@@ -61,15 +61,42 @@ void play_feedback(int type, int pattern)
                ret = feedback_play(pattern);
                break;
        default:
-               _E("Play type is unknown");
+               _E("Play type is unknown.");
                ret = 0;
        }
        if (ret != FEEDBACK_ERROR_NONE)
-               _E("Cannot play feedback: %d", pattern);
+               _E("Cannot play feedback(%d).", pattern);
 
        ret = feedback_deinitialize();
        if (ret != FEEDBACK_ERROR_NONE)
-               _E("Cannot deinitialize feedback");
+               _E("Cannot deinitialize feedback.");
+}
+
+void init_multi_feedback(void)
+{
+       int ret;
+
+       ret = feedback_initialize();
+       if (ret != FEEDBACK_ERROR_NONE)
+               _E("Cannot initialize feedback.");
+}
+
+void play_multi_feedback(int pattern)
+{
+       int ret;
+
+       ret = feedback_play(pattern);
+       if (ret != FEEDBACK_ERROR_NONE)
+               _E("Cannot play feedback(%d).", pattern);
+}
+
+void stop_multi_feedback(void)
+{
+       int ret;
+
+       ret = feedback_deinitialize();
+       if (ret != FEEDBACK_ERROR_NONE)
+               _E("Cannot deinitialize feedback.");
 }
 
 static void *thread_feedback(void* data)
@@ -84,7 +111,7 @@ static void *thread_feedback(void* data)
 static void *thread_display(void* data)
 {
        if (display_change_state(LCD_NORMAL) < 0)
-               _E("FAIL: display_change_state()");
+               _E("Failed to display_change_state().");
        return NULL;
 }
 
@@ -95,7 +122,7 @@ static void start_thread(void *(*operation)(void *), void *data)
 
        ret = pthread_create(&th, NULL, operation, data);
        if (ret < 0) {
-               _E("Failed to create pthread(%d)", ret);
+               _E("Failed to create pthread: %d", ret);
                return;
        }
        pthread_detach(th);
@@ -128,7 +155,7 @@ int set_dbus_connection(void)
 
        edbus_conn = e_dbus_bus_get(DBUS_BUS_SYSTEM);
        if (!edbus_conn) {
-               _E("Failed to get dbus bus");
+               _E("Failed to get dbus bus.");
                e_dbus_shutdown();
                return -ENOMEM;
        }
@@ -189,26 +216,26 @@ int broadcast_dbus_signal(const char *path, const char *interface,
 
        conn = get_dbus_connection();
        if (!conn) {
-               _E("Failed to get dbus connection");
+               _E("Failed to get dbus connection.");
                return -ENOMEM;
        }
 
        msg = dbus_message_new_signal(path, interface, name);
        if (!msg) {
-               _E("FAIL: dbus_message_new_signal()");
+               _E("Failed to dbus_message_new_signal().");
                return -ENOMEM;
        }
 
        dbus_message_iter_init_append(msg, &iter);
        ret = append_variant(&iter, sig, param);
        if (ret < 0) {
-               _E("append_variant error(%d)", ret);
+               _E("Failed to append_variant: %d", ret);
                goto out;
        }
 
        pc = e_dbus_message_send(conn, msg, NULL, -1, NULL);
        if (!pc) {
-               _E("FAIL: e_dbus_message_send()");
+               _E("Failed to e_dbus_message_send().");
                ret = -ECONNREFUSED;
                goto out;
        }
@@ -233,13 +260,13 @@ int popup_dbus_method_sync(const char *dest, const char *path,
 
        conn = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
        if (!conn) {
-               _E("dbus_bus_get error");
+               _E("Failed to dbus_bus_get.");
                return -EPERM;
        }
 
        msg = dbus_message_new_method_call(dest, path, interface, method);
        if (!msg) {
-               _E("dbus_message_new_method_call(%s:%s-%s)",
+               _E("dbus_message_new_method_call(%s:%s-%s).",
                                path, interface, method);
                ret = -EBADMSG;
                goto out;
@@ -248,7 +275,7 @@ int popup_dbus_method_sync(const char *dest, const char *path,
        dbus_message_iter_init_append(msg, &iter);
        ret = append_variant(&iter, sig, param);
        if (ret < 0) {
-               _E("append_variant error(%d)", ret);
+               _E("Failed to append_variant: %d", ret);
                goto out;
        }
 
@@ -266,7 +293,7 @@ int popup_dbus_method_sync(const char *dest, const char *path,
        ret = dbus_message_get_args(reply, &err,
                        DBUS_TYPE_INT32, &result, DBUS_TYPE_INVALID);
        if (!ret) {
-               _E("no message : [%s:%s]", err.name, err.message);
+               _E("No message. err.name=%s: %s", err.name, err.message);
                dbus_error_free(&err);
                ret = -ENOMSG;
                goto out;
@@ -293,7 +320,7 @@ void unregister_dbus_signal_handler(E_DBus_Signal_Handler *handler)
 
        conn = get_dbus_connection();
        if (!conn) {
-               _E("Failed to get dbus connection");
+               _E("Failed to get dbus connection.");
                return;
        }
 
@@ -316,7 +343,7 @@ int register_dbus_signal_handler(
 
        conn = get_dbus_connection();
        if (!conn) {
-               _E("Failed to get dbus connection");
+               _E("Failed to get dbus connection.");
                return -ENOMEM;
        }