fix AppControl result handling 99/10899/2
authorYoung Ik Cho <youngik.cho@samsung.com>
Mon, 14 Oct 2013 01:27:45 +0000 (10:27 +0900)
committerYoung Ik Cho <youngik.cho@samsung.com>
Thu, 17 Oct 2013 06:13:37 +0000 (15:13 +0900)
Change-Id: If016cd53bca8d7d51b106917895ba6786aa82012
Signed-off-by: Young Ik Cho <youngik.cho@samsung.com>
src/app/FApp_AppControlImpl.cpp
src/app/FApp_AppControlManager.cpp
src/app/FApp_AppControlRegistry.cpp
src/app/FApp_AppManagerImpl.cpp
src/app/FApp_AppMessageImpl.cpp

index 2e0aca6..8c0126e 100644 (file)
@@ -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);
index 0d15ee1..9ff5cbc 100644 (file)
@@ -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
                {
index ab02cf5..a4c7c03 100644 (file)
@@ -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);
 }
index 8ef7d29..5c95d58 100644 (file)
@@ -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;
        }
 
index 00bac76..c10a292 100644 (file)
@@ -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);
        }