From 546b161d9018abbf2f67877689ec482aad1fa8aa Mon Sep 17 00:00:00 2001 From: Young Ik Cho Date: Mon, 14 Oct 2013 10:27:45 +0900 Subject: [PATCH] fix AppControl result handling Change-Id: If016cd53bca8d7d51b106917895ba6786aa82012 Signed-off-by: Young Ik Cho --- src/app/FApp_AppControlImpl.cpp | 7 +++++-- src/app/FApp_AppControlManager.cpp | 4 ++-- src/app/FApp_AppControlRegistry.cpp | 1 - src/app/FApp_AppManagerImpl.cpp | 2 +- src/app/FApp_AppMessageImpl.cpp | 4 ++-- 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/app/FApp_AppControlImpl.cpp b/src/app/FApp_AppControlImpl.cpp index 2e0aca6..8c0126e 100644 --- a/src/app/FApp_AppControlImpl.cpp +++ b/src/app/FApp_AppControlImpl.cpp @@ -106,6 +106,11 @@ _AppControlImpl::CreateN(const String& path, const String& aId, const String& oI SysTryReturn(NID_APP, !aId.IsEmpty(), null, E_INVALID_ARG, "[E_INVALID_ARG] Provider Id is empty."); SysTryReturn(NID_APP, !oId.IsEmpty(), null, E_INVALID_ARG, "[E_INVALID_ARG] Operation Id is empty."); + const AppId& actualAppId = _AppControlRegistry::GetInstance()->GetAliasAppId(aId); + const bool isInstalled = _Aul::IsInstalled(actualAppId); + SysTryReturn(NID_APP, isInstalled, null, E_OBJ_NOT_FOUND, "[E_OBJ_NOT_FOUND] %ls not installed.", actualAppId.GetPointer()); + + AppControl* pAc = new (std::nothrow) AppControl; SysTryReturn(NID_APP, pAc != null, null, E_OUT_OF_MEMORY, "AppControl allocation failure."); @@ -296,7 +301,6 @@ _AppControlImpl::Start(const IList* pDataList, IAppControlEventListener* pListen pProvider->Release(); } - // after acquring request number, pLib should be managed from the list, not CATCH if (IsFailed(r)) { _AppControlManager::GetInstance()->__inAppManager.RemoveItem(req); @@ -366,7 +370,6 @@ _AppControlImpl::Start(const String* pUriData, const String* pMimeType, const IM pProvider->Release(); } - // after acquring request number, pLib should be managed from the list, not CATCH if (IsFailed(r)) { _AppControlManager::GetInstance()->__inAppManager.RemoveItem(req); diff --git a/src/app/FApp_AppControlManager.cpp b/src/app/FApp_AppControlManager.cpp index 0d15ee1..9ff5cbc 100644 --- a/src/app/FApp_AppControlManager.cpp +++ b/src/app/FApp_AppControlManager.cpp @@ -283,8 +283,8 @@ _AppControlManager::OnAppControlPluginEventReceivedN(int reqId, int res, const A if (optAppId.IsEmpty()) { - String aId = pInfo->providerId; - String oId = pInfo->operationId; + aId = pInfo->providerId; + oId = pInfo->operationId; } else { diff --git a/src/app/FApp_AppControlRegistry.cpp b/src/app/FApp_AppControlRegistry.cpp index ab02cf5..a4c7c03 100644 --- a/src/app/FApp_AppControlRegistry.cpp +++ b/src/app/FApp_AppControlRegistry.cpp @@ -268,7 +268,6 @@ _AppControlRegistry::GetTizenAppControlN(const String& aId, const String& oId) c SysLog(NID_APP, "Found matching AppControl (%ls, %ls)", pAppId->GetPointer(), pOperation->GetPointer()); const String& soName = GetTizenAppControlProvider(*pAppId, *pOperation); - SysAssert(!soName.IsEmpty()); return _AppControlImpl::CreateN(soName, *pAppId, *pOperation, _APPCONTROL_PROPERTY_PUBLIC); } diff --git a/src/app/FApp_AppManagerImpl.cpp b/src/app/FApp_AppManagerImpl.cpp index 8ef7d29..5c95d58 100644 --- a/src/app/FApp_AppManagerImpl.cpp +++ b/src/app/FApp_AppManagerImpl.cpp @@ -767,7 +767,7 @@ _AppLifecycleManager::TerminateCallback(int pid, void* pData) result r = pImpl->__map.GetValue(pid, tmp); if (r != E_SUCCESS) { - SysLog(NID_APP, "Cannot acquire app from pid %d.", pid); + SysLog(NID_APP, "[%s] Cannot acquire app from pid %d.", GetErrorMessage(r), pid); return -1; } diff --git a/src/app/FApp_AppMessageImpl.cpp b/src/app/FApp_AppMessageImpl.cpp index 00bac76..c10a292 100644 --- a/src/app/FApp_AppMessageImpl.cpp +++ b/src/app/FApp_AppMessageImpl.cpp @@ -69,12 +69,12 @@ _AppMessageImpl::_AppMessageImpl(const String& appId, const String& oId, const S SetOperation(__pBundle, oId); - if (pUri) + if (pUri && !pUri->IsEmpty()) { SetUri(__pBundle, *pUri); } - if (pMime) + if (pMime && !pMime->IsEmpty()) { SetMime(__pBundle, *pMime); } -- 2.7.4