OspCompat
authorDongeup Ham <dongeup.ham@samsung.com>
Tue, 8 Jan 2013 07:07:58 +0000 (16:07 +0900)
committerDongeup Ham <dongeup.ham@samsung.com>
Tue, 8 Jan 2013 07:07:58 +0000 (16:07 +0900)
Change-Id: Iae9410917df4baab17d484a4e87bbedafa5febe5
Signed-off-by: Dongeup Ham <dongeup.ham@samsung.com>
inc/InstallerDefs.h
src/Context/InstallationContext.cpp
src/Context/InstallationContext.h
src/Manager/ConfigurationManager.cpp
src/XmlHandler/ManifestHandler.cpp

index f86f3ff..cc22d59 100755 (executable)
@@ -21,7 +21,7 @@
 #ifndef _INSTALLER_DEFS_H_
 #define _INSTALLER_DEFS_H_
 
-#define OSP_INSTALLER_VERSION "osp-installer version=20130107.3"
+#define OSP_INSTALLER_VERSION "osp-installer version=20130108.1"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
@@ -54,6 +54,7 @@
 
 #define FILE_EXT_INFO                          L"info"
 #define VERSION_INFO_FILE                      L"/info/version.info"
+#define COMPAT_INFO_FILE                       L"/info/compat.info"
 #define UISCALABILITY_INFO_FILE                L"/info/uiscalability.info"
 #define WEBSERVICE_INFO_FILE           L"/info/webservice.info"
 #define TYPE_INFO_FILE                         L"/info/type.info"
index 100bf34..bfa88b2 100755 (executable)
@@ -41,6 +41,7 @@ using namespace Tizen::App::Package;
 InstallationContext::InstallationContext(void)
 :__pAppDataList(null)
 ,__isSubMode(false)
+,__isOspCompat(false)
 ,__pStep(null)
 ,__pDrmLicense(null)
 ,__error(INSTALLER_ERROR_NONE)
index b3d29bf..97c609f 100755 (executable)
@@ -149,6 +149,8 @@ public:
        bool __isSubMode;
        Tizen::Base::String __subModeAppName;
 
+       bool  __isOspCompat;
+
 private:
        InstallationContext(const InstallationContext& value);
        InstallationContext& operator =(const InstallationContext& source);
index aac4779..c09240a 100755 (executable)
@@ -80,6 +80,15 @@ ConfigurationManager::CreateFile(InstallationContext* pContext)
        versionInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), VERSION_INFO_FILE);
        CreateInfoFile(versionInfoFile, &apiVersion);
 
+       if (pContext->__isOspCompat == true)
+       {
+               AppLogTag(OSP_INSTALLER, "[OspCompat] is detected");
+
+               String compatInfoFile;
+               compatInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), COMPAT_INFO_FILE);
+               CreateInfoFile(compatInfoFile, null);
+       }
+
        String webServicePrivilege(TIZEN_PRIVILEGE_WEB_SERVICE);
        if (FindPrivilege(pContext, webServicePrivilege) == true)
        {
index 049d93d..7628071 100755 (executable)
@@ -371,8 +371,6 @@ ManifestHandler::OnPrivilegesStartElement(void)
 bool
 ManifestHandler::OnUiAppStartElement(void)
 {
-       XmlAttribute *pAttr = null;
-
        __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl;
        TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null");
 
@@ -381,7 +379,7 @@ ManifestHandler::OnUiAppStartElement(void)
 
        AppLogTag(OSP_INSTALLER, "<UiApp>");
 
-       pAttr = GetAttribute();
+       XmlAttribute *pAttr = GetAttribute();
        TryReturn(pAttr, true, "[osp-installer] pAttr is null");
 
        ParseAppAttribute(pAttr, true);
@@ -392,8 +390,6 @@ ManifestHandler::OnUiAppStartElement(void)
 bool
 ManifestHandler::OnServiceAppStartElement(void)
 {
-       XmlAttribute *pAttr = null;
-
        __pPackageAppInfoImpl = new (std::nothrow) _PackageAppInfoImpl;
        TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null");
 
@@ -402,7 +398,7 @@ ManifestHandler::OnServiceAppStartElement(void)
 
        AppLogTag(OSP_INSTALLER, "<ServiceApp>");
 
-       pAttr = GetAttribute();
+       XmlAttribute *pAttr = GetAttribute();
        TryReturn(pAttr, true, "pAttr is null");
 
        ParseAppAttribute(pAttr, false);
@@ -935,6 +931,17 @@ ManifestHandler::OnApiVersionValue(const char *pCharacters)
        __pPackageInfoImpl->SetAppApiVersion(pCharacters);
        AppLogTag(OSP_INSTALLER, "<ApiVersion>%s</ApiVersion>", pCharacters);
 
+       XmlAttribute *pAttr = GetAttribute();
+       if (pAttr)
+       {
+               char* pOspCompat = pAttr->Find("OspCompat");
+               if (pOspCompat)
+               {
+                       AppLogTag(OSP_INSTALLER, " - OspCompat=%s", pOspCompat);
+                       __pContext->__isOspCompat = true;
+               }
+       }
+
        return true;
 }