fixed send result bug(callee appid)
authorJaeho Lee <jaeho81.lee@samsung.com>
Wed, 19 Jun 2013 05:51:17 +0000 (14:51 +0900)
committerJaeho Lee <jaeho81.lee@samsung.com>
Wed, 19 Jun 2013 05:51:17 +0000 (14:51 +0900)
Signed-off-by: Jaeho Lee <jaeho81.lee@samsung.com>
am_daemon/amd_request.c
src/launch_with_result.c

index 1f18e0e..98e22bd 100755 (executable)
@@ -104,7 +104,6 @@ static int __foward_cmd(int cmd, bundle *kb, int cr_pid)
        int datalen;
        bundle_raw *kb_data;
        int res;
-       char callee_appid[256];
 
        if ((pid = __get_caller_pid(kb)) < 0)
                        return AUL_R_ERROR;
@@ -114,13 +113,6 @@ static int __foward_cmd(int cmd, bundle *kb, int cr_pid)
 
        bundle_add(kb, AUL_K_CALLEE_PID, tmp_pid);
 
-       res = aul_app_get_appid_bypid(pgid, callee_appid, sizeof(callee_appid));
-       if(res == 0) {
-               bundle_add(kb, AUL_K_CALLEE_APPID, callee_appid);
-       } else {
-               _W("fail(%d) to get callee appid by pid", res);
-       }
-
        bundle_encode(kb, &kb_data, &datalen);
        if ((res = __app_send_raw_with_noreply(pid, cmd, kb_data, datalen)) < 0)
                res = AUL_R_ERROR;
index e052820..80cbadb 100755 (executable)
@@ -390,6 +390,7 @@ int aul_send_result(bundle *kb, int is_cancel)
 {
        int pid;
        int ret;
+       char callee_appid[256];
 
        if ((pid = __get_caller_pid(kb)) < 0)
                return AUL_R_EINVAL;
@@ -401,6 +402,13 @@ int aul_send_result(bundle *kb, int is_cancel)
                _D("original msg is not msg with result");
                return AUL_R_OK;
        }
+       
+       ret = aul_app_get_appid_bypid(getpid(), callee_appid, sizeof(callee_appid));
+       if(ret == 0) {
+               bundle_add(kb, AUL_K_CALLEE_APPID, callee_appid);
+       } else {
+               _W("fail(%d) to get callee appid by pid", ret);
+       }
 
        ret = app_send_cmd_with_noreply(AUL_UTIL_PID, (is_cancel==1)? APP_CANCEL : APP_RESULT, kb);