DCM-1571 : fix local launching issue
authorYoung Ik Cho <youngik.cho@samsung.com>
Wed, 8 May 2013 12:35:44 +0000 (21:35 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Wed, 8 May 2013 12:35:44 +0000 (21:35 +0900)
Change-Id: I596da35ae0ee2bde4a5f80d881a065b540e38316
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/app/FApp_AppControlManager.cpp

index e9a3837..2928230 100755 (executable)
@@ -594,7 +594,7 @@ _AppControlManager::LaunchApp(const AppId& appId, _AppArg* pArg, int req)
        kb = pArg->GetBundle();
        
        pid = appsvc_run_service(kb, req, LaunchResultCb, this);
-       if (pid > 0)
+       if (pid >= 0)
        {
                SysLog(NID_APP, "Submode launch successful");
                return E_SUCCESS;
@@ -610,7 +610,7 @@ _AppControlManager::LaunchApp(const AppId& appId, _AppArg* pArg, int req)
        {
                kb = pArg->GetBundle();
                pid = appsvc_run_service(kb, req, LaunchResultCb, this);
-               if (pid > 0)
+               if (pid >= 0)
                {
                        SysLog(NID_APP, "Application(%d) launched with reqId(%d) and arg(0x%x).", pid, req, pArg);
                        return E_SUCCESS;
@@ -727,7 +727,7 @@ _AppControlManager::Launch(const AppId& appId, _AppArg* pArg, AppSvcResFn pCb, v
                kb = pArg->GetBundle();
 
                pid = appsvc_run_service(kb, req, reinterpret_cast<appsvc_res_fn>(pCb), pData);
-               if (pid > 0)
+               if (pid >= 0)
                {
                        SysLog(NID_APP, "Submode launch successful");
                        return pid;
@@ -744,13 +744,13 @@ _AppControlManager::Launch(const AppId& appId, _AppArg* pArg, AppSvcResFn pCb, v
        {
                kb = pArg->GetBundle();
                pid = appsvc_run_service(kb, req, reinterpret_cast<appsvc_res_fn>(pCb), pData);
-               if (pid > 0)
+               if (pid >= 0)
                {
                        SysLog(NID_APP, "Application(%d) launched with reqId(%d) and arg(0x%x).", pid, req, pArg);
                        return pid;
                }
                count++;
-               SysLog(NID_APP, "Waiting %dth time.", count);
+               SysLog(NID_APP, "Waiting %dth time with %d.", count, pid);
                Thread::Sleep(TRY_SLEEP_TIME);
        }
        while (count < TRY_COUNT);
@@ -794,8 +794,14 @@ _AppControlManager::LaunchAppImplicit(_AppArg* pArg, int req)
        }
 
        int pid = appsvc_run_service(kb, req, LaunchResultCb, this);
-       if (pid > 0)
+       if (pid >= 0)
        {
+               if (pid == 0)
+               {
+                       SysLog(NID_APP, "Sending local process again.");
+                       pid = getpid();
+               }
+
                char pkgname[255] = {0, };
                aul_app_get_pkgname_bypid(pid, pkgname, 255);