Fix intApp TC failure
authorKarthik Subas Chandra Bose <karthik.scb@samsung.com>
Mon, 21 Oct 2013 07:11:05 +0000 (16:11 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Tue, 22 Oct 2013 04:31:35 +0000 (13:31 +0900)
Change-Id: Id5abd5f4e62814e5549704277036e9ec73f8b313
Signed-off-by: Karthik Subas Chandra Bose <karthik.scb@samsung.com>
src/app/FApp_AppControlManager.cpp

index 15180e4..ee295bf 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);
        }
 }