From 50b4ba4f2f958eeea456d04ffdc4bf714702b10f Mon Sep 17 00:00:00 2001 From: Duyoung Jang Date: Thu, 22 Aug 2013 10:09:25 +0900 Subject: [PATCH] Add type parameter for performance Change-Id: I3fdda2163a320e83b6e8a981ac0797bfdcd189ac Signed-off-by: Duyoung Jang --- src/app/package/FAppPkg_PackageInfoImpl.cpp | 16 +++++++++---- src/app/package/FAppPkg_PackageManagerImpl.cpp | 33 ++++++++++++++++++++------ src/app/package/FAppPkg_PackageParser.cpp | 4 ++-- 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/app/package/FAppPkg_PackageInfoImpl.cpp b/src/app/package/FAppPkg_PackageInfoImpl.cpp index b55612b..0496213 100755 --- a/src/app/package/FAppPkg_PackageInfoImpl.cpp +++ b/src/app/package/FAppPkg_PackageInfoImpl.cpp @@ -227,15 +227,19 @@ _PackageInfoImpl::GetSize(void) const if (__fromDatabase) { SysTryReturn(NID_APP, __id.IsEmpty() == false, 0, E_SYSTEM, "id is IsEmpty."); + SysTryReturn(NID_APP, __type.IsEmpty() == false, 0, E_SYSTEM, "type is IsEmpty."); std::unique_ptr pPackage(_StringConverter::CopyToCharArrayN(__id)); SysTryReturn(NID_APP, pPackage, 0, E_OUT_OF_MEMORY, "pPackage is null."); + std::unique_ptr pType(_StringConverter::CopyToCharArrayN(__type)); + SysTryReturn(NID_APP, pType, 0, E_OUT_OF_MEMORY, "pType is null."); + void* pClient = pkgmgr_client_new(PC_REQUEST); SysTryReturn(NID_APP, pClient, 0, E_SYSTEM, "pkgmgr_client_new() failed."); - SysLog(NID_APP, "pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, %s)", pPackage.get()); - size = pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, 0, pClient, null, pPackage.get(), null, null, null); + SysLog(NID_APP, "pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, %s, %s)", pType.get(), pPackage.get()); + size = pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, 0, pClient, pType.get(), pPackage.get(), null, null, null); pkgmgr_client_free(pClient); } @@ -257,15 +261,19 @@ _PackageInfoImpl::GetDataSize(void) const if (__fromDatabase) { SysTryReturn(NID_APP, __id.IsEmpty() == false, 0, E_SYSTEM, "id is IsEmpty."); + SysTryReturn(NID_APP, __type.IsEmpty() == false, 0, E_SYSTEM, "type is IsEmpty."); std::unique_ptr pPackage(_StringConverter::CopyToCharArrayN(__id)); SysTryReturn(NID_APP, pPackage, 0, E_OUT_OF_MEMORY, "pPackage is null."); + std::unique_ptr pType(_StringConverter::CopyToCharArrayN(__type)); + SysTryReturn(NID_APP, pType, 0, E_OUT_OF_MEMORY, "pType is null."); + void* pClient = pkgmgr_client_new(PC_REQUEST); SysTryReturn(NID_APP, pClient, 0, E_SYSTEM, "pkgmgr_client_new() failed."); - SysLog(NID_APP, "pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, %s)", pPackage.get()); - dataSize = pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, 1, pClient, null, pPackage.get(), null, null, null); + SysLog(NID_APP, "pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, %s, %s)", pType.get(), pPackage.get()); + dataSize = pkgmgr_client_request_service(PM_REQUEST_GET_SIZE, 1, pClient, pType.get(), pPackage.get(), null, null, null); pkgmgr_client_free(pClient); } diff --git a/src/app/package/FAppPkg_PackageManagerImpl.cpp b/src/app/package/FAppPkg_PackageManagerImpl.cpp index 09ef6be..39cac0d 100755 --- a/src/app/package/FAppPkg_PackageManagerImpl.cpp +++ b/src/app/package/FAppPkg_PackageManagerImpl.cpp @@ -88,15 +88,26 @@ _PackageManagerEvent::FireImpl(IEventListener& listener, const IEventArg& arg) } else { - if (pArg->__install) + if (pArg->__install == false) { - SysLog(NID_APP, "Installation is Completed(Error). [Package = %ls]", pArg->__packageId.GetPointer()); - pListener->OnPackageInstallationCompleted(pArg->__packageId, PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE); + SysLog(NID_APP, "Uninstallation is Completed(Error). [Package = %ls]", pArg->__packageId.GetPointer()); + pListener->OnPackageUninstallationCompleted(pArg->__packageId, false); + } + } + } + else if (pArg->__eventKey == L"error") + { + if (pArg->__install) + { + if (pArg->__eventValue == L"62") + { + SysLog(NID_APP, "Installation is Completed(Error = STORAGE_FULL(62)). [Package = %ls]", pArg->__packageId.GetPointer()); + pListener->OnPackageInstallationCompleted(pArg->__packageId, PACKAGE_INSTALLATION_RESULT_STORAGE_FULL); } else { - SysLog(NID_APP, "Uninstallation is Completed(Error). [Package = %ls]", pArg->__packageId.GetPointer()); - pListener->OnPackageUninstallationCompleted(pArg->__packageId, false); + SysLog(NID_APP, "Installation is Completed(Error). [Package = %ls]", pArg->__packageId.GetPointer()); + pListener->OnPackageInstallationCompleted(pArg->__packageId, PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE); } } } @@ -668,13 +679,21 @@ _PackageManagerImpl::InstallationEventHandler(int reqId, const char* pType, cons pListener->OnPackageInstallationResponseReceived(pPackageId, PACKAGE_INSTALLATION_RESULT_SUCCESS); SysLog(NID_APP, "OnPackageInstallationResponseReceived(PACKAGE_INSTALLATION_RESULT_SUCCESS)"); } + + delete pListener; + } + else if (strcmp(pKey, "error") == 0) + { + if (strcmp(pVal, "62") == 0) + { + pListener->OnPackageInstallationResponseReceived(pPackageId, PACKAGE_INSTALLATION_RESULT_STORAGE_FULL); + SysLog(NID_APP, "OnPackageInstallationResponseReceived(PACKAGE_INSTALLATION_RESULT_STORAGE_FULL)"); + } else { pListener->OnPackageInstallationResponseReceived(pPackageId, PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE); SysLog(NID_APP, "OnPackageInstallationResponseReceived(PACKAGE_INSTALLATION_RESULT_INVALID_PACKAGE)"); } - - delete pListener; } else if (strcmp(pKey, "install_percent") == 0) { diff --git a/src/app/package/FAppPkg_PackageParser.cpp b/src/app/package/FAppPkg_PackageParser.cpp index 619f6a7..0fa1300 100755 --- a/src/app/package/FAppPkg_PackageParser.cpp +++ b/src/app/package/FAppPkg_PackageParser.cpp @@ -754,11 +754,11 @@ _PackageParser::OnIdValue(const char* pCharacters) PackageId packageId = pCharacters; if (regularExpression.Match(packageId, true) == true) { - AppLog("[%ls] is tizen native application.", packageId.GetPointer()); + SysLog(NID_APP, "[%ls] is tizen native application.", packageId.GetPointer()); } else { - AppLog("[%ls] is not tizen native application.", packageId.GetPointer()); + SysLog(NID_APP, "[%ls] is not tizen native application.", packageId.GetPointer()); __isEflTpk = true; } -- 2.7.4