Support launch reqeust async API
[platform/core/appfw/aul-1.git] / src / launch.c
index 49794c9..6aa6462 100755 (executable)
@@ -67,12 +67,24 @@ static int __send_cmd_for_uid_opt(int pid, uid_t uid, int cmd, bundle *kb, int o
        return res;
 }
 
+static int __send_cmd_noreply_for_uid_opt(int pid, uid_t uid,
+               int cmd, bundle *kb, int opt)
+{
+       int res;
+
+       res = aul_sock_send_bundle(pid, uid, cmd, kb, opt | AUL_SOCK_NOREPLY);
+       if (res < 0)
+               res = aul_error_convert(res);
+
+       return res;
+}
+
 static int __send_cmd_async_for_uid_opt(int pid, uid_t uid,
-                                       int cmd, bundle *kb, int opt)
+               int cmd, bundle *kb, int opt)
 {
        int res;
 
-       res = aul_sock_send_bundle(pid, uid, cmd, kb, AUL_SOCK_NOREPLY);
+       res = aul_sock_send_bundle(pid, uid, cmd, kb, opt | AUL_SOCK_ASYNC);
        if (res < 0)
                res = aul_error_convert(res);
 
@@ -103,7 +115,7 @@ API int app_send_cmd_with_queue_for_uid(int pid, uid_t uid, int cmd, bundle *kb)
 API int app_send_cmd_with_queue_noreply_for_uid(int pid, uid_t uid,
                                        int cmd, bundle *kb)
 {
-       return __send_cmd_async_for_uid_opt(pid, uid, cmd, kb, AUL_SOCK_QUEUE);
+       return __send_cmd_noreply_for_uid_opt(pid, uid, cmd, kb, AUL_SOCK_QUEUE);
 }
 
 API int app_send_cmd_with_noreply(int pid, int cmd, bundle *kb)
@@ -213,6 +225,10 @@ int app_request_to_launchpad_for_uid(int cmd, const char *appid, bundle *kb, uid
                ret = app_send_cmd_with_queue_noreply_for_uid(AUL_UTIL_PID,
                                uid, cmd, kb);
                break;
+       case APP_SEND_LAUNCH_REQUEST:
+               ret = __send_cmd_async_for_uid_opt(AUL_UTIL_PID,
+                               uid, cmd, kb, AUL_SOCK_QUEUE);
+               break;
        default:
                ret = app_send_cmd_with_queue_for_uid(AUL_UTIL_PID, uid, cmd,
                                kb);
@@ -229,6 +245,7 @@ int app_request_to_launchpad_for_uid(int cmd, const char *appid, bundle *kb, uid
                case APP_START_ASYNC:
                case WIDGET_UPDATE:
                case APP_START_RES_ASYNC:
+               case APP_SEND_LAUNCH_REQUEST:
                        b = bundle_dup(kb);
                        ret = aul_launch_local(b);
                        break;