X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FApplication%2FApplicationManager.cpp;h=cd62762aad078491d934f4b168c3cecf39af2469;hb=d26c636c86aac2adf415e78c4e34631ee4ab4fb0;hp=231e45ebf5385edab4dadb64608e9e2ad9b44745;hpb=7aa3ed0566b6a0a95effc8c0b61a406540a02977;p=platform%2Fframework%2Fweb%2Fwrt-plugins-tizen.git diff --git a/src/Application/ApplicationManager.cpp b/src/Application/ApplicationManager.cpp index 231e45e..cd62762 100644 --- a/src/Application/ApplicationManager.cpp +++ b/src/Application/ApplicationManager.cpp @@ -257,54 +257,6 @@ namespace { return true; } -#if 0 - // @20130125-wscho: current pkgmanager has a problem while db operation. - // So, if enable below code, foreach callback of "pkgmgrinfo_appinfo_get_installed_list" - // is not running. - // So, temporally, we get version, total size, installed time on first access for that attribute. - // See JSApplicationInformation.cpp - static void set_additional_app_info(ApplicationInformationPtr &appInfo, const char* packageId) - { - int ret = 0; - char *version = NULL; - int total_size = 0; - int installed_time = 0; - pkgmgrinfo_pkginfo_h pkginfo_h; - - ret = pkgmgrinfo_pkginfo_get_pkginfo(packageId, &pkginfo_h); - if (ret != PMINFO_R_OK) { - LoggerD("Fail to get package info. skip getting info"); - return; - } - - ret = pkgmgrinfo_pkginfo_get_version(pkginfo_h, &version); - if ((ret != PMINFO_R_OK) || (version == NULL)) { - LoggerD("Fail to get version"); - } else { - appInfo->setVersion(version); - } - - ret = pkgmgrinfo_pkginfo_get_total_size(pkginfo_h, &total_size); - if (ret != PMINFO_R_OK) { - LoggerD("Fail to get total size"); - } else { - appInfo->setInstallSize(total_size); - } - - ret = pkgmgrinfo_pkginfo_get_installed_time(pkginfo_h, &installed_time); - if (ret != PMINFO_R_OK) { - LoggerD("Fail to get installed time"); - } else { - appInfo->setInstallDate(installed_time); - } - - ret = pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo_h); - if (ret != PMINFO_R_OK) { - LoggerD("Fail to get destroy pkginfo"); - } - } -#endif - static ApplicationInformationPtr create_app_info(pkgmgrinfo_appinfo_h handle) { char* appId = NULL; @@ -355,25 +307,33 @@ namespace { appInfo->setPackageId(pkgId); } + char *version = NULL; + int installed_time = 0; + pkgmgrinfo_pkginfo_h pkginfo_h; -// @20130125-wscho: current pkgmanager has a problem while db operation. -// So, if enable below code, foreach callback of "pkgmgrinfo_appinfo_get_installed_list" -// is not running. -// So, temporally, we get version, total size, installed time on first access for that attribute. -// See JSApplicationInformation.cpp -#if 0 - ret = pkgmgrinfo_appinfo_get_pkgname(handle, &packageId); - if (ret != PMINFO_R_OK) - { - LoggerD("Fail to get package id"); - return appInfo; - } + ret = pkgmgrinfo_pkginfo_get_pkginfo(pkgId, &pkginfo_h); + if (ret != PMINFO_R_OK) { + LoggerE("Fail to get package info"); + } else { + ret = pkgmgrinfo_pkginfo_get_version(pkginfo_h, &version); + if (ret != PMINFO_R_OK) { + LoggerE("Fail to get version"); + } else { + appInfo->setVersion(version); + } - set_additional_app_info(appInfo, packageId); -#endif + ret = pkgmgrinfo_pkginfo_get_installed_time(pkginfo_h, &installed_time); + if (ret != PMINFO_R_OK) { + LoggerE("Fail to get installed date"); + } else { + appInfo->setInstallDate(installed_time); + } + pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo_h); + } + + // remark : attribute "total size" is set at first attribute access time for performance. return appInfo; - } @@ -439,6 +399,9 @@ ApplicationManager::~ApplicationManager() } gLaunchAppControlPendingEventMap.eraseKey(this); + + // unset context event callback which is registered by kill(). + app_manager_unset_app_context_event_cb(); } void ApplicationManager::launch(const EventApplicationLaunchPtr& event) @@ -829,7 +792,7 @@ ApplicationCertArrayPtr ApplicationManager::getAppCerts(const std::string id) TIME_TRACER_ITEM_BEGIN("(getAppCerts)package_info_foreach_cert_info", 0); result = package_info_foreach_cert_info(pkg_info, package_cert_cb, (void*)certArray.Get()); TIME_TRACER_ITEM_END("(getAppCerts)package_info_foreach_cert_info", 0); - if (result != PACKAGE_MANAGER_ERROR_NONE) + if ((result != PACKAGE_MANAGER_ERROR_NONE) && (result != PACKAGE_MANAGER_ERROR_IO_ERROR)) { ThrowMsg(UnknownException, "Can not get package cert info"); }