N_SE-36002 : fix submode for implicit resolution
[platform/framework/native/appfw.git] / src / app / FApp_AppControlManager.cpp
index deb13b1..79ea317 100755 (executable)
@@ -76,8 +76,6 @@ using namespace Tizen::Base::Runtime;
 using namespace Tizen::Base::Utility;
 using namespace Tizen::Io;
 
-//extern const char* _DATACONTROL_RESULTSET_DIR;
-
 namespace Tizen { namespace App
 {
 
@@ -200,7 +198,7 @@ _AppControlManager::OnAppControlEventReceivedN(int reqId, _AppArg* pAppArg, int
 void
 _AppControlManager::OnAppControlEventReceivedN(int reqId, const AppId& appId, const String& operationId)
 {
-       SysLog(NID_APP, "Received request Id %d, appId %ls, operationId %ls", reqId, appId.GetPointer(), operationId.GetPointer());
+       SysLog(NID_APP, "Received request Id %d, app %ls, operationId %ls", reqId, appId.GetPointer(), operationId.GetPointer());
 
        // get launch info from request Id
        _LaunchInfo* pInfo = __launchManager.FindItem(reqId);
@@ -305,7 +303,7 @@ _AppControlManager::OnAppControlEventReceivedN(int reqId, int res, const IMap* p
 
                                if (pResponseEvent != null)
                                {
-                                       _AppControlResponseEventArg* pResponseEventArg = new (std::nothrow) _AppControlResponseEventArg(pListener, _APPCONTROL_RESPONSETYPE_COMPLETE, aId, oId, E_SUCCESS, static_cast<AppCtrlResult>(res), pArgs, responseEventRequestId);
+                                       _AppControlResponseEventArg* pResponseEventArg = new (std::nothrow) _AppControlResponseEventArg(pListener, _APPCONTROL_RESPONSETYPE_COMPLETE, aId, oId, E_SUCCESS, static_cast<AppCtrlResult>(res), const_cast<IMap*> (pArgs), responseEventRequestId);
                                        if (pResponseEventArg != null)
                                        {
                                                pResponseEvent->Fire(*pResponseEventArg);
@@ -316,6 +314,8 @@ _AppControlManager::OnAppControlEventReceivedN(int reqId, int res, const IMap* p
                                {
                                        pListener->OnAppControlCompleteResponseReceived(aId, oId, ConvertAppControlResultCode(res), pArgs);
                                        SysLog(NID_APP, "OnAppControlCompleteResponseReceived called directly");
+                                       IMap* pMap = const_cast<IMap*> (pArgs);
+                                       delete pMap;
                                }
                        }
                        else
@@ -561,7 +561,7 @@ result
 _AppControlManager::LaunchApp(const AppId& appId, _AppArg* pArg, int req)
 {
        SysTryReturnResult(NID_APP, pArg != null, E_INVALID_ARG, "Invalid launch argument");
-       SysLog(NID_APP, "AppId: %ls.", appId.GetPointer());
+       SysLog(NID_APP, "App: %ls.", appId.GetPointer());
 
        String actualAppId = appId;
        if (appId.GetLength() == 10)
@@ -690,7 +690,7 @@ int
 _AppControlManager::Launch(const AppId& appId, _AppArg* pArg, AppSvcResFn pCb, void* pData, int req)
 {
        SysTryReturn(NID_APP, pArg != null, -1, E_INVALID_ARG, "[E_INVALID_ARG] Invalid launch argument");
-       SysLog(NID_APP, "AppId: %ls.", appId.GetPointer());
+       SysLog(NID_APP, "App: %ls.", appId.GetPointer());
 
        String actualAppId = appId;
        if (appId.GetLength() == 10)
@@ -788,6 +788,12 @@ _AppControlManager::LaunchAppImplicit(_AppArg* pArg, int req)
                _AppMessageImpl::AddData(kb, SELECTOR_NOTI_KEY, _AppInfo::GetApplicationId());
        }
 
+       if (_AppImpl::GetInstance() != null)
+       {
+               const long handle = _AppImpl::GetInstance()->GetWindowHandle();
+               _AppArg::UpdateWindowHandle(kb, handle);
+       }
+
        int pid = appsvc_run_service(kb, req, LaunchResultCb, this);
        if (pid > 0)
        {
@@ -879,7 +885,7 @@ _AppControlManager::RegisterRequest(service_s* service, int& req, _AppHandler& h
        bundle* b = _AppArg::GetBundleFromSvc(service);
 
        _AppArg* pArg = new (std::nothrow) _AppArg();
-       SysTryReturnResult(NID_APP, pArg != null, E_OUT_OF_MEMORY, "rrayList creation failure.");
+       SysTryReturnResult(NID_APP, pArg != null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
        pArg->Construct(b);
 
        result r = E_SUCCESS;