X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fapp%2FFApp_AppControlProviderManagerImpl.cpp;h=1bc79a9681e17349d8476915491846cedd299a87;hb=a808e19371d52296de3e0f8b2df334dba1707946;hp=71aa878a4daf555c1008ca5483d2ee0869778627;hpb=f0b4d984b5d29a81ae54a1f310fd8baf3ac822d5;p=platform%2Fframework%2Fnative%2Fappfw.git diff --git a/src/app/FApp_AppControlProviderManagerImpl.cpp b/src/app/FApp_AppControlProviderManagerImpl.cpp index 71aa878..1bc79a9 100644 --- a/src/app/FApp_AppControlProviderManagerImpl.cpp +++ b/src/app/FApp_AppControlProviderManagerImpl.cpp @@ -78,15 +78,14 @@ _AppControlProviderManagerImpl::SendAppControlResult(RequestId reqId, const ILis result r = resArg.ConstructResult(arg, pResultList); if (IsFailed(r)) { + // erase _AppArg after sending the result back to the caller + pAppMgr->__resultManager.RemoveItem(reqId); + SysPropagate(NID_APP, r); return r; } - const bool isService = _AppInfo::GetAppType() & _APP_TYPE_SERVICE_APP; - - //resArg.Print(); - r = _Aul::SendResult(resArg.GetBundle(), static_cast(0), _AppInfo::IsSubMode(), isService); - SysLog(NID_APP, "Sent AppControl event for %d.", reqId); + r = SendAppControlResultPrimitive(reqId, resArg, 0); // erase _AppArg after sending the result back to the caller pAppMgr->__resultManager.RemoveItem(reqId); @@ -110,6 +109,9 @@ _AppControlProviderManagerImpl::SendAppControlResult(RequestId reqId, AppCtrlRes result r = resArg.ConstructResult(arg, pResultMap); if (IsFailed(r)) { + // erase _AppArg after sending the result back to the caller + pAppMgr->__resultManager.RemoveItem(reqId); + SysPropagate(NID_APP, r); return r; } @@ -138,11 +140,7 @@ _AppControlProviderManagerImpl::SendAppControlResult(RequestId reqId, AppCtrlRes break; } - const bool isService = _AppInfo::GetAppType() & _APP_TYPE_SERVICE_APP; - - //resArg.Print(); - r = _Aul::SendResult(resArg.GetBundle(), static_cast(res), _AppInfo::IsSubMode(), isService); - SysLog(NID_APP, "Sent AppControl event for %d.", reqId); + r = SendAppControlResultPrimitive(reqId, resArg, res); // erase _AppArg after sending the result back to the caller pAppMgr->__resultManager.RemoveItem(reqId); @@ -150,6 +148,36 @@ _AppControlProviderManagerImpl::SendAppControlResult(RequestId reqId, AppCtrlRes return r; } + +result +_AppControlProviderManagerImpl::SendAppControlResultPrimitive(RequestId reqId, _AppArg& arg, int ret) +{ + static bool firstRequestSent = false; + + if (reqId == 0 && firstRequestSent) + { + SysLog(NID_APP, "Sent main AppControl request already."); + + return E_SUCCESS; + } + else + { + if (reqId == 0) + { + firstRequestSent = true; + } + + const bool isService = _AppInfo::GetAppType() & _APP_TYPE_SERVICE_APP; + + //resArg.Print(); + result r = _Aul::SendResult(arg.GetBundle(), static_cast(ret), _AppInfo::IsSubMode(), isService); + SysLog(NID_APP, "Sent AppControl event for %d.", reqId); + + return r; + } +} + + AppId _AppControlProviderManagerImpl::GetClientAppId(RequestId reqId) const {