Revert "Revert "Fix intApp TC failure""
authorSunwook Bae <sunwook45.bae@samsung.com>
Fri, 25 Oct 2013 06:08:09 +0000 (15:08 +0900)
committerSunwook Bae <sunwook45.bae@samsung.com>
Fri, 25 Oct 2013 06:08:26 +0000 (15:08 +0900)
This reverts commit a349eeafbb81f904423027ed083e660fdb134a30.

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

index 40a69e6..c2b933d 100644 (file)
@@ -213,45 +213,41 @@ _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);
-       SysTryReturnVoidResult(NID_APP, pListener != null, E_SYSTEM, "[E_SYSTEM] Invalid result callback for req %d, app %ls.", reqId, appId.GetPointer());
+       if (pListener == null)
+       {
+               SysLog(NID_APP, "Empty AppControl listener callback for req %d, app %ls.", reqId, appId.GetPointer());
+               return;
+       }
 
        result r = E_SUCCESS;
 
-       if (pListener)
+       AppId actualAppId = appId;
+       if (appId == L'c')
        {
-               AppId actualAppId = appId;
-               if (appId == L'c')
-               {
-                       actualAppId.Clear();
-                       r = E_OPERATION_CANCELED;
-               }
-               SysLog(NID_APP, "Invoking callback 0x%x.", pListener);
+               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)
-                       {
-                               pResponseEvent->Fire(*pResponseEventArg);
-                               SysLog(NID_APP, "pResponseEvent is Fired");
-                       }
-               }
-               else
+               if (pResponseEventArg != null)
                {
-                       pListener->OnAppControlStartResponseReceived(actualAppId, operationId, r);
-                       SysLog(NID_APP, "OnAppControlStartResponseReceived called directly");
+                       pResponseEvent->Fire(*pResponseEventArg);
+                       SysLog(NID_APP, "pResponseEvent is Fired");
                }
        }
        else
        {
-               SysLog(NID_APP, "No listener registered.");
+               pListener->OnAppControlStartResponseReceived(actualAppId, operationId, r);
+               SysLog(NID_APP, "OnAppControlStartResponseReceived called directly");
        }
 
        if (r == E_OPERATION_CANCELED)
@@ -373,7 +369,7 @@ _AppControlManager::OnAppControlPluginEventReceivedN(int reqId, int res, const A
        }
        else
        {
-               SysLogException(NID_APP, E_SYSTEM, "Invalid AppControl listener.");
+               SysLog(NID_APP, "Empty AppControl listener.");
        }
 
 
@@ -409,7 +405,7 @@ _AppControlManager::StopAppControlResponseListener(IAppControlResponseListener*
        _InProcessInfo* pProcInfo = __inAppManager.FindItemWithListener(IsMatchingProcListener, pListener);
        if (pProcInfo)
        {
-               __inAppManager.RemoveItem(pProcInfo);
+               pProcInfo->pListener = null;
                SysLog(NID_APP, "Listener 0x%x is removed from in-process stub list.", pListener);
        }
 }