Inherit proloaded property. 2.1b_release accepted/tizen_2.1/20130426.150450 submit/tizen_2.1/20130426.145948
authorDuyoung Jang <duyoung.jang@samsung.com>
Fri, 26 Apr 2013 06:40:04 +0000 (15:40 +0900)
committerDuyoung Jang <duyoung.jang@samsung.com>
Fri, 26 Apr 2013 06:40:04 +0000 (15:40 +0900)
Change-Id: Iebb5e074ce4a995c3b271e1f04ebe529904e2179
Signed-off-by: Duyoung Jang <duyoung.jang@samsung.com>
.cproject
CMakeLists.txt
inc/InstallerDefs.h
src/Manager/ConfigurationManager.cpp
src/Manager/ConfigurationManager.h

index 9e7631d..56968f8 100755 (executable)
--- a/.cproject
+++ b/.cproject
                                                                </option>
                                                                <option id="gnu.cpp.link.option.libs.850444138" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
                                                                        <listOptionValue builtIn="false" value="pkgmgr_parser"/>
+                                                                       <listOptionValue builtIn="false" value="pkgmgr-info"/>
+                                                                       <listOptionValue builtIn="false" value="appcore-common"/>
                                                                        <listOptionValue builtIn="false" value="capi-system-info"/>
                                                                        <listOptionValue builtIn="false" value="cert-svc"/>
                                                                        <listOptionValue builtIn="false" value="cert-svc-vcore"/>
index b8b0e4e..fc37b27 100755 (executable)
@@ -81,7 +81,7 @@ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions -fvisibility=hidden")
 SET(CMAKE_CXX_FLAGS "${OSP_DEBUG_FLAGS} ${OSP_OPT_FLAGS} ${CMAKE_CXX_FLAGS} ${EXTRA_CFLAGS} ${OSP_COMPILER_FLAGS}")
 
 TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib/osp -losp-appfw -lxml2 -lpkgmgr_installer -lpkgmgr_parser -lglib-2.0 -lapp2ext -ldl" -Wl,--allow-shlib-undefined)
-TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib -lcert-svc-vcore -ldpl-efl -lcert-svc -lcapi-system-info -lappcore-common")
+TARGET_LINK_LIBRARIES(${this_target} "-L/usr/lib -lcert-svc-vcore -ldpl-efl -lcert-svc -lcapi-system-info -lappcore-common -lpkgmgr-info")
 
 ADD_SUBDIRECTORY(plugin)
 
index e710368..bce564f 100755 (executable)
@@ -23,7 +23,7 @@
 
 #include "InstallerUtil.h"
 
-#define OSP_INSTALLER_VERSION "version=[20130425.4]"
+#define OSP_INSTALLER_VERSION "version=[20130426.1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
index a50c995..7e314c8 100755 (executable)
@@ -26,6 +26,7 @@
 
 #include <pkgmgr_parser.h>
 #include <pkgmgr_installer.h>
+#include <pkgmgr-info.h>
 #include <app2ext_interface.h>
 
 #include <FBaseUtilStringUtil.h>
@@ -360,6 +361,14 @@ ConfigurationManager::PostInstall(InstallationContext* pContext, bool error) con
                AppLog("pkgmgr_parser_parse_manifest_for_installation() - END");
                AppLog("------------------------------------------");
 
+               String roXmlPath;
+               roXmlPath.Format(1024, DIR_RO_PACKAGE_SYSTEM_MANIFEST, pContext->__packageId.GetPointer());
+
+               if ((File::IsFileExist(roXmlPath) == true) && (pContext->__isHybridService == false))
+               {
+                       SetPreloadedProperty(packageId);
+               }
+
                SmackManager smackManager;
                smackManager.Construct(pContext);
                smackManager.EnablePermissions(packageId);
@@ -726,3 +735,35 @@ ConfigurationManager::FindPrivilege(InstallationContext* pContext, const String&
 
        return ret;
 }
+
+bool
+ConfigurationManager::SetPreloadedProperty(const PackageId& packageId) const
+{
+       TryReturn(packageId.IsEmpty() == false, false, "packageId is empty.");
+
+       std::unique_ptr<char[]> pPackageId(_StringConverter::CopyToCharArrayN(packageId));
+       TryReturn(pPackageId, false, "pPackageId is null.");
+
+       bool ret = true;
+       int res = PMINFO_R_OK;
+       pkgmgrinfo_pkgdbinfo_h handle = null;
+
+       res = pkgmgrinfo_create_pkgdbinfo(pPackageId.get(), &handle);
+       TryCatch(res == PMINFO_R_OK, ret = false, "pkgmgrinfo_create_pkgdbinfo() failed. [%d]", res);
+
+       res = pkgmgrinfo_set_preload_to_pkgdbinfo(handle, 1);
+       TryCatch(res == PMINFO_R_OK, ret = false, "pkgmgrinfo_set_preload_to_pkgdbinfo() failed. [%d]", res);
+
+       res = pkgmgrinfo_save_pkgdbinfo(handle);
+       TryCatch(res == PMINFO_R_OK, ret = false, "pkgmgrinfo_save_pkgdbinfo() failed. [%d]", res);
+
+       AppLog("Preloaded property is set. [%ls] ", packageId.GetPointer());
+
+CATCH:
+       if (handle)
+       {
+               pkgmgrinfo_destroy_pkgdbinfo(handle);
+       }
+
+       return ret;
+}
index 38e1eee..83692c9 100755 (executable)
@@ -53,6 +53,7 @@ private:
 
        bool CreateImeSymlink(const Tizen::Base::String& binaryPath, const Tizen::Base::String& packageName);
        bool FindPrivilege(InstallationContext* pContext, const Tizen::Base::String& privilege) const;
+       bool SetPreloadedProperty(const Tizen::App::PackageId& packageId) const;
 
 }; // ConfigurationManager