fix DCM-930 : add response for implicit AppControl start
authorYoung Ik Cho <youngik.cho@samsung.com>
Fri, 29 Mar 2013 11:29:22 +0000 (20:29 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Fri, 29 Mar 2013 11:32:56 +0000 (20:32 +0900)
Change-Id: I38b9d5d3a0e7d27ef002d06aaba3763f994964f4
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/app/FApp_AppControlManager.cpp

index c47a88a..626a97e 100755 (executable)
@@ -652,24 +652,41 @@ _AppControlManager::LaunchAppImplicit(_AppArg* pArg, int req)
        }
 
        int pid = appsvc_run_service(kb, req, LaunchResultCb, this);
-       switch (pid)
+       if (pid > 0)
        {
-       case APPSVC_RET_EINVAL:
-               r = E_OBJ_NOT_FOUND;
-               break;
-       case APPSVC_RET_ENOMATCH:
-               r = E_OBJ_NOT_FOUND;
-               break;
-       case APPSVC_RET_ERROR:
-               // fall through
-       case APPSVC_RET_ELAUNCH:
-               r = E_SYSTEM;
-               break;
-       case APPSVC_RET_EILLACC:
-               r = E_ILLEGAL_ACCESS;
-               break;
-       default:
-               break;
+               char pkgname[255] = {0, };
+               aul_app_get_pkgname_bypid(pid, pkgname, 255);
+
+               if (strncmp(pkgname, APP_SELECTOR, strlen(APP_SELECTOR)) != 0)
+               {
+                       const char* pOperation = appsvc_get_operation(kb);
+
+                       SysLog(NID_APP, "Starting application without selector : (%s, %s).", pkgname, pOperation);
+
+                       SendAppControlStartResponse(req, pkgname, pOperation);
+               }
+       }
+       else
+       {
+               switch (pid)
+               {
+                       case APPSVC_RET_EINVAL:
+                               r = E_OBJ_NOT_FOUND;
+                               break;
+                       case APPSVC_RET_ENOMATCH:
+                               r = E_OBJ_NOT_FOUND;
+                               break;
+                       case APPSVC_RET_EILLACC:
+                               r = E_ILLEGAL_ACCESS;
+                               break;
+                       case APPSVC_RET_ERROR:
+                               // fall through
+                       case APPSVC_RET_ELAUNCH:
+                               // fall through
+                       default:
+                               r = E_SYSTEM;
+                               break;
+               }
        }
 
        SysLog(NID_APP, "[%s] Application(%d) launched with reqId(%d) and arg(0x%x).", GetErrorMessage(r), pid, req, pArg);