Support app group instance launch 10/111510/2
authorHawnkyu Jhun <h.jhun@samsung.com>
Sat, 21 Jan 2017 03:02:47 +0000 (12:02 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 23 Jan 2017 04:31:33 +0000 (13:31 +0900)
The caller app can get the instance id of the callee app in
the reply callback.

Change-Id: I0950f63d30e560e5f1fe53bf80f9dde98efc63cd
Signed-off-by: Hawnkyu Jhun <h.jhun@samsung.com>
app_control/app_control.c

index 5a3f983..b63d7fc 100755 (executable)
@@ -28,6 +28,7 @@
 #include <dlog.h>
 
 #include <app_control.h>
+#include <app_control_internal.h>
 
 #ifdef LOG_TAG
 #undef LOG_TAG
@@ -655,7 +656,8 @@ static void __handle_launch_result(int launched_pid, void *data)
        app_control_reply_cb reply_cb;
        void *user_data;
        char callee[255] = {0, };
-       int ret = 0;
+       char instance_id[256] = {0,};
+       int ret;
 
        if (data == NULL)
                return;
@@ -674,6 +676,13 @@ static void __handle_launch_result(int launched_pid, void *data)
        app_control_set_app_id(reply, callee);
        LOGI("app control async result callback callee pid:%d", launched_pid);
 
+       ret = aul_app_get_instance_id_bypid(launched_pid, instance_id,
+                       sizeof(instance_id));
+       if (ret == AUL_R_OK) {
+               app_control_set_instance_id(reply, instance_id);
+               LOGI("instance id(%s)", instance_id);
+       }
+
        result = APP_CONTROL_RESULT_APP_STARTED;
        request = request_context->app_control;
        user_data = request_context->user_data;