Revert "Fix intApp TC failure"
authorSunwook Bae <sunwook45.bae@samsung.com>
Thu, 24 Oct 2013 04:39:09 +0000 (13:39 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 24 Oct 2013 05:36:23 +0000 (05:36 +0000)
This reverts commit 52b76179fc2bc7cb07926acbf736ca0544c4cfc4.

Change-Id: Id051508ac2a5f0caba3167ea49478942b09f4be4
Signed-off-by: Sunwook Bae <sunwook45.bae@samsung.com>
src/app/FApp_AppControlManager.cpp

index c2b933d..40a69e6 100644 (file)
@@ -213,41 +213,45 @@ _AppControlManager::OnAppControlEventReceivedN(int reqId, const AppId& appId, co
        _InProcessInfo* pInfo = __inAppManager.FindItem(reqId);
        SysTryReturnVoidResult(NID_APP, pInfo != null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] request Id %d not found.", reqId);
 
+       // at least listener
        IAppControlResponseListener* pListener = dynamic_cast<IAppControlResponseListener*>(pInfo->pListener);
-       if (pListener == null)
-       {
-               SysLog(NID_APP, "Empty AppControl listener callback for req %d, app %ls.", reqId, appId.GetPointer());
-               return;
-       }
+       SysTryReturnVoidResult(NID_APP, pListener != null, E_SYSTEM, "[E_SYSTEM] Invalid result callback for req %d, app %ls.", reqId, appId.GetPointer());
 
        result r = E_SUCCESS;
 
-       AppId actualAppId = appId;
-       if (appId == L'c')
+       if (pListener)
        {
-               actualAppId.Clear();
-               r = E_OPERATION_CANCELED;
-       }
-       SysLog(NID_APP, "Invoking callback 0x%x.", pListener);
+               AppId actualAppId = appId;
+               if (appId == L'c')
+               {
+                       actualAppId.Clear();
+                       r = E_OPERATION_CANCELED;
+               }
+               SysLog(NID_APP, "Invoking callback 0x%x.", pListener);
 
-       _AppControlResponseEvent* pResponseEvent = null;
-       __appControlResponseEventContainer.GetValue(reqId, pResponseEvent);
-       SysLog(NID_APP, "StartResponseReceived Request Id(%d), ResponseEvent 0x%x.", reqId, pResponseEvent);
-       if (pResponseEvent != null)
-       {
-               String oId(operationId);
-               _AppControlResponseEventArg* pResponseEventArg = new (std::nothrow) _AppControlResponseEventArg(pListener, _APPCONTROL_RESPONSETYPE_START, actualAppId, oId, r, APP_CTRL_RESULT_SUCCEEDED, null, reqId, false);
+               _AppControlResponseEvent* pResponseEvent = null;
+               __appControlResponseEventContainer.GetValue(reqId, pResponseEvent);
+               SysLog(NID_APP, "StartResponseReceived Request Id(%d), ResponseEvent 0x%x.", reqId, pResponseEvent);
+               if (pResponseEvent != null)
+               {
+                       String oId(operationId);
+                       _AppControlResponseEventArg* pResponseEventArg = new (std::nothrow) _AppControlResponseEventArg(pListener, _APPCONTROL_RESPONSETYPE_START, actualAppId, oId, r, APP_CTRL_RESULT_SUCCEEDED, null, reqId, false);
 
-               if (pResponseEventArg != null)
+                       if (pResponseEventArg != null)
+                       {
+                               pResponseEvent->Fire(*pResponseEventArg);
+                               SysLog(NID_APP, "pResponseEvent is Fired");
+                       }
+               }
+               else
                {
-                       pResponseEvent->Fire(*pResponseEventArg);
-                       SysLog(NID_APP, "pResponseEvent is Fired");
+                       pListener->OnAppControlStartResponseReceived(actualAppId, operationId, r);
+                       SysLog(NID_APP, "OnAppControlStartResponseReceived called directly");
                }
        }
        else
        {
-               pListener->OnAppControlStartResponseReceived(actualAppId, operationId, r);
-               SysLog(NID_APP, "OnAppControlStartResponseReceived called directly");
+               SysLog(NID_APP, "No listener registered.");
        }
 
        if (r == E_OPERATION_CANCELED)
@@ -369,7 +373,7 @@ _AppControlManager::OnAppControlPluginEventReceivedN(int reqId, int res, const A
        }
        else
        {
-               SysLog(NID_APP, "Empty AppControl listener.");
+               SysLogException(NID_APP, E_SYSTEM, "Invalid AppControl listener.");
        }
 
 
@@ -405,7 +409,7 @@ _AppControlManager::StopAppControlResponseListener(IAppControlResponseListener*
        _InProcessInfo* pProcInfo = __inAppManager.FindItemWithListener(IsMatchingProcListener, pListener);
        if (pProcInfo)
        {
-               pProcInfo->pListener = null;
+               __inAppManager.RemoveItem(pProcInfo);
                SysLog(NID_APP, "Listener 0x%x is removed from in-process stub list.", pListener);
        }
 }