SubMode Implementation
authorDongeup Ham <dongeup.ham@samsung.com>
Thu, 20 Dec 2012 01:53:41 +0000 (10:53 +0900)
committerDongeup Ham <dongeup.ham@samsung.com>
Thu, 20 Dec 2012 01:53:41 +0000 (10:53 +0900)
Change-Id: I684b31141ea7a4239adafc9c6fc35ade9fe1a5eb
Signed-off-by: Dongeup Ham <dongeup.ham@samsung.com>
inc/InstallerDefs.h
src/Context/InstallationContext.cpp [changed mode: 0644->0755]
src/Context/InstallationContext.h
src/XmlHandler/ManifestGenerator.cpp
src/XmlHandler/ManifestGenerator.h [changed mode: 0644->0755]
src/XmlHandler/ManifestHandler.cpp
src/XmlHandler/ManifestHandler.h

index 9909b1d..68a5ce9 100755 (executable)
@@ -21,7 +21,7 @@
 #ifndef _INSTALLER_DEFS_H_
 #define _INSTALLER_DEFS_H_
 
-#define OSP_INSTALLER_VERSION "osp-installer version = [2012/12/17]_RC[2]"
+#define OSP_INSTALLER_VERSION "osp-installer version = [2012/12/20]_RC[1]"
 
 #define DIR_BIN                                L"/bin"
 #define DIR_INFO                       L"/info"
@@ -67,6 +67,8 @@
 #define SYSTEMAPP_LOADER_PATH          "/usr/lib/osp/osp-system-service-loader"        // System Service
 #define IME_PATH                                       "/opt/apps/scim/lib/scim-1.0/1.4.0/Helper"
 
+#define SUB_MODE_APPCONTROL_NAME       L"_AppControl"
+
 #define APP_OWNER_ID           5000
 #define APP_GROUP_ID           5000
 
@@ -83,7 +85,7 @@
 
 #define DIR_MEMORYCARD_OSP_APPLICATIONS                        L"/opt/storage/sdcard/apps"
 #define DIR_MEMORYCARD_OSP_APPLICATIONS_TEMP   L"/opt/storage/sdcard/apps/__@@osp_tmp@@__"
-#define DIR_MEMORYCARD_INSTALLATION                                            L"/opt/storage/sdcard/installtosdcard"
+#define DIR_MEMORYCARD_INSTALLATION                            L"/opt/storage/sdcard/installtosdcard"
 
 static const int BLOCK_SIZE = 4096;
 
old mode 100644 (file)
new mode 100755 (executable)
index 09a2ba1..8b7ba76
@@ -39,6 +39,7 @@ using namespace Tizen::App::Package;
 
 InstallationContext::InstallationContext(void)
 :__pAppDataList(null)
+,__isSubMode(false)
 ,__pStep(null)
 ,__pDrmLicense(null)
 ,__error(INSTALLER_ERROR_NONE)
@@ -92,8 +93,11 @@ InstallationContext::~InstallationContext(void)
                __pLiveBoxList = null;
        }
 
-       __pAppDataList->RemoveAll();
-       __pAppDataList = null;
+       if (__pAppDataList)
+       {
+               __pAppDataList->RemoveAll();
+               delete __pAppDataList;
+       }
 }
 
 InstallerError
@@ -686,15 +690,30 @@ ContentInfo::GetNameList(void) const
        return __pNameList;
 }
 
+AppControlData::AppControlData()
+:__pOperationDataList(null)
+{
+       __pOperationDataList = new (std::nothrow) ArrayListT<OperationData*>;
+}
+
+AppControlData::~AppControlData()
+{
+       __pOperationDataList->RemoveAll();
+       delete __pOperationDataList;
+}
+
 AppData::AppData()
 :__pCategoryList(null)
+,__pAppControlData(null)
 {
        __pCategoryList = new (std::nothrow) ArrayListT<String*>;
-
+       __pAppControlData = new (std::nothrow) AppControlData;
 }
 
 AppData::~AppData()
 {
        __pCategoryList->RemoveAll();
        delete __pCategoryList;
+
+       delete __pAppControlData;
 }
index 99f00ee..c9d0ce9 100755 (executable)
 
 class IInstallationStep;
 
-class PackageData
+class OperationData
        : public Tizen::Base::Object
 {
 public:
-       PackageData(){};
-       virtual ~PackageData(){};
+       OperationData(){};
+       virtual ~OperationData(){};
+
+       Tizen::Base::String __id;
+       Tizen::Base::String __mimeType;
+       Tizen::Base::String __uri;
+};
 
+class AppControlData
+       : public Tizen::Base::Object
+{
+public:
+               AppControlData();
+               virtual ~AppControlData();
+
+               Tizen::Base::Collection::IListT<OperationData*>* __pOperationDataList;
 };
 
 class AppData
@@ -50,10 +63,22 @@ public:
        AppData();
        virtual ~AppData();
 
-       Tizen::Base::Collection::IListT<Tizen::Base::String *>* __pCategoryList;
+       Tizen::Base::Collection::IListT<Tizen::Base::String*>* __pCategoryList;
+       AppControlData* __pAppControlData;
+       Tizen::Base::String name;
 
 private:
 };
+
+class PackageData
+       : public Tizen::Base::Object
+{
+public:
+       PackageData(){};
+       virtual ~PackageData(){};
+
+};
+
 /**
  * @class              InstallationContext
  * @brief              This class represents the class of InstallationContext.
@@ -164,6 +189,8 @@ public:
        PackageData __packageData;
        Tizen::Base::Collection::IListT<AppData *>* __pAppDataList;
 
+       bool __isSubMode;
+
 private:
        InstallationContext(const InstallationContext& value);
        InstallationContext& operator =(const InstallationContext& source);
index 115d120..ede9ffc 100755 (executable)
  * @brief      This is the implementation file for %ManifestGenerator class.
  */
 
+#include <sys/stat.h>
+
 #include <FLclLocale.h>
 #include <FApp_Aul.h>
 #include <FAppPkg_PackageInfoImpl.h>
+#include <FIoFile.h>
 
 #include "ManifestGenerator.h"
 #include "InstallerUtil.h"
@@ -31,6 +34,7 @@ using namespace Tizen::Base::Collection;
 using namespace Tizen::App;
 using namespace Tizen::App::Package;
 using namespace Tizen::Locales;
+using namespace Tizen::Io;
 
 ManifestGenerator::ManifestGenerator(void)
 :__pContext(null)
@@ -75,8 +79,8 @@ ManifestGenerator::Write()
        //}
        //else
        //{
-               xmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, __pContext->GetAppId().GetPointer());
-               location = L"auto";
+       xmlPath.Format(1024, DIR_RW_PACKAGE_SYSTEM_MANIFEST, __pContext->GetAppId().GetPointer());
+       location = L"auto";
        //}
 
        package = __pContext->GetAppId();
@@ -104,148 +108,24 @@ ManifestGenerator::Write()
        _PackageAppInfoImpl* pAppInfoImpl = null;
        ArrayList* pAppList = null;
        pAppList = pPackageInfoImpl->GetAppInfoList();
+       int appCount = pAppList->GetCount();
+       AppLogTag(OSP_INSTALLER, "Write(): appCount=%d", appCount);
 
-       for (int i = 0 ; i < pAppList->GetCount(); i++)
+       for (int i = 0 ; i < appCount; i++)
        {
                pAppInfoImpl = dynamic_cast<_PackageAppInfoImpl*>(pAppList->GetAt(i));
                if (pAppInfoImpl)
                {
-                       IMap* pNameList = pAppInfoImpl->GetNameList();
-                       String label("label");
-                       String type("c++app");
-                       String binaryPath;
-                       binaryPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, pAppInfoImpl->GetName().GetPointer());
-
-                       if (pAppInfoImpl->GetDefault() == L"True")
-                       {
-                               WriteLanguageValue(pNameList, label);
-
-                               if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
-                               {
-                                       String iconPath;
-                                       iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pAppInfoImpl->GetMainmenuIcon().GetPointer());
-
-                                       __pWriter->StartElement("icon");
-                                       __pWriter->WriteString(iconPath);
-                                       __pWriter->EndElement();
-                               }
-                       }
-
-                       // temp
-                       String nodisplay("true");
-                       String taskmanage("false");
-                       String category;
-
-                       if (pAppInfoImpl->GetType() == L"UiApp")
-                       {
-                               taskmanage = L"true";
-
-                               if (pAppInfoImpl->IsMainmenuVisible() == true)
-                               {
-                                       nodisplay = L"false";
-                               }
-                               else
-                               {
-                                       nodisplay = L"true";
-                               }
-
-                               if (FindCategory(i, "http://tizen.org/category/ime") == true)
-                               {
-                                       AppLogTag(OSP_INSTALLER, "Write(): [http://tizen.org/category/ime] is detected. taskmanage=false, nodisplay=true");
-                                       taskmanage = L"false";
-                                       nodisplay = L"true";
-                               }
-                       }
-
-                       ArrayList* pFeatureList = pAppInfoImpl->GetAppFeatureList();
-                       String glFrame = GetGlFrameValue(pFeatureList);
-
-                       __pWriter->StartElement("ui-application");
-                       __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName());
-                       __pWriter->WriteAttribute("exec", binaryPath);
-                       __pWriter->WriteAttribute("nodisplay", nodisplay);
-                       __pWriter->WriteAttribute("taskmanage", taskmanage);
-                       __pWriter->WriteAttribute("multiple", "false");
-                       __pWriter->WriteAttribute("type", type);
-                       __pWriter->WriteAttribute("hw-acceleration", glFrame);
-
-                       WriteCategory(i);
-
-#if 0
-                       if (pAppInfoImpl->GetType() == L"UiApp")
-                       {
-                               String nodisplay;
-
-                               if (pAppInfoImpl->IsMainmenuVisible() == true)
-                               {
-                                       nodisplay = "false";
-                               }
-                               else
-                               {
-                                       nodisplay = "true";
-                               }
-
-                               __pWriter->StartElement("ui-application");
-                               __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName());
-                               __pWriter->WriteAttribute("exec", binaryPath);
-                               __pWriter->WriteAttribute("nodisplay", nodisplay);
-                               __pWriter->WriteAttribute("taskmanage", "true");
-                               __pWriter->WriteAttribute("multiple", "false");
-                               __pWriter->WriteAttribute("type", type);
-                       }
-                       else if (pAppInfoImpl->GetType() == L"ServiceApp")
-                       {
-                               ArrayList* pFeatureList = pAppInfoImpl->GetAppFeatureList();
-                               String onBoot("false");
-                               String autoRestart("false");
-
-                               if (FindFeatureValue(pFeatureList, "LaunchOnBoot", "True") == true)
-                               {
-                                       onBoot = L"true";
-                               }
-
-                               if (FindFeatureValue(pFeatureList, "AutoRestart", "True") == true)
-                               {
-                                       autoRestart = L"true";
-                               }
-
-                               __pWriter->StartElement("service-application");
-                               __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName());
-                               __pWriter->WriteAttribute("exec", binaryPath);
-                               __pWriter->WriteAttribute("type", type);
-                               __pWriter->WriteAttribute("on-boot", onBoot);
-                               __pWriter->WriteAttribute("auto-restart", autoRestart);
-                       }
-                       else
-                       {
-                               AppLogTag(OSP_INSTALLER, "Type is invalid! [%ls]", pAppInfoImpl->GetType().GetPointer());
-                               return false;
-                       }
-#endif
-
-                       WriteLanguageValue(pNameList, label);
-
-                       if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
-                       {
-                               String iconPath;
-                               iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pAppInfoImpl->GetMainmenuIcon().GetPointer());
-
-                               __pWriter->StartElement("icon");
-                               __pWriter->WriteString(iconPath);
-                               __pWriter->EndElement();
-                       }
-
-                       WriteAppControl(pAppInfoImpl);
-
-                       __pWriter->EndElement();
-
-                       if (pAppInfoImpl->GetType() == L"ServiceApp")
-                       {
-                               WriteLiveboxes(pAppInfoImpl);
-                       }
+                       WriteApp(i, pAppInfoImpl);
                }
        }
 
+       if (__pContext->__isSubMode == true)
+       {
+               AppLogTag(OSP_INSTALLER, "Write(): __pContext->__isSubMode is detected");
+               WriteSubModeApp(appCount);
+       }
+
        __pWriter->EndElement();
 
        return true;
@@ -571,3 +451,245 @@ ManifestGenerator::FindCategory(int index, const String& category) const
 
        return false;
 }
+
+bool
+ManifestGenerator::WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl)
+{
+       _PackageInfoImpl *pPackageInfoImpl = null;
+       pPackageInfoImpl = __pContext->GetPackageInfoImpl();
+
+       IMap* pNameList = pAppInfoImpl->GetNameList();
+       String label("label");
+       String type("c++app");
+       String binaryPath;
+       binaryPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, pAppInfoImpl->GetName().GetPointer());
+
+       if (pAppInfoImpl->GetDefault() == L"True")
+       {
+               WriteLanguageValue(pNameList, label);
+
+               if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
+               {
+                       String iconPath;
+                       iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pAppInfoImpl->GetMainmenuIcon().GetPointer());
+
+                       __pWriter->StartElement("icon");
+                       __pWriter->WriteString(iconPath);
+                       __pWriter->EndElement();
+               }
+       }
+
+       String nodisplay("true");
+       String taskmanage("false");
+       String category;
+
+       if (pAppInfoImpl->GetType() == L"UiApp")
+       {
+               taskmanage = L"true";
+
+               if (pAppInfoImpl->IsMainmenuVisible() == true)
+               {
+                       nodisplay = L"false";
+               }
+               else
+               {
+                       nodisplay = L"true";
+               }
+
+               if (FindCategory(index, "http://tizen.org/category/ime") == true)
+               {
+                       AppLogTag(OSP_INSTALLER, "Write(): [http://tizen.org/category/ime] is detected. taskmanage=false, nodisplay=true");
+                       taskmanage = L"false";
+                       nodisplay = L"true";
+               }
+       }
+
+       ArrayList* pFeatureList = pAppInfoImpl->GetAppFeatureList();
+       String glFrame = GetGlFrameValue(pFeatureList);
+
+       __pWriter->StartElement("ui-application");
+       __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName());
+       __pWriter->WriteAttribute("exec", binaryPath);
+       __pWriter->WriteAttribute("nodisplay", nodisplay);
+       __pWriter->WriteAttribute("taskmanage", taskmanage);
+       __pWriter->WriteAttribute("multiple", "false");
+       __pWriter->WriteAttribute("type", type);
+       __pWriter->WriteAttribute("hw-acceleration", glFrame);
+
+       WriteCategory(index);
+
+#if 0
+       if (pAppInfoImpl->GetType() == L"UiApp")
+       {
+               String nodisplay;
+
+               if (pAppInfoImpl->IsMainmenuVisible() == true)
+               {
+                       nodisplay = "false";
+               }
+               else
+               {
+                       nodisplay = "true";
+               }
+
+               __pWriter->StartElement("ui-application");
+               __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName());
+               __pWriter->WriteAttribute("exec", binaryPath);
+               __pWriter->WriteAttribute("nodisplay", nodisplay);
+               __pWriter->WriteAttribute("taskmanage", "true");
+               __pWriter->WriteAttribute("multiple", "false");
+               __pWriter->WriteAttribute("type", type);
+       }
+       else if (pAppInfoImpl->GetType() == L"ServiceApp")
+       {
+               ArrayList* pFeatureList = pAppInfoImpl->GetAppFeatureList();
+               String onBoot("false");
+               String autoRestart("false");
+
+               if (FindFeatureValue(pFeatureList, "LaunchOnBoot", "True") == true)
+               {
+                       onBoot = L"true";
+               }
+
+               if (FindFeatureValue(pFeatureList, "AutoRestart", "True") == true)
+               {
+                       autoRestart = L"true";
+               }
+
+               __pWriter->StartElement("service-application");
+               __pWriter->WriteAttribute("appid", pAppInfoImpl->GetPackageName());
+               __pWriter->WriteAttribute("exec", binaryPath);
+               __pWriter->WriteAttribute("type", type);
+               __pWriter->WriteAttribute("on-boot", onBoot);
+               __pWriter->WriteAttribute("auto-restart", autoRestart);
+       }
+       else
+       {
+               AppLogTag(OSP_INSTALLER, "Type is invalid! [%ls]", pAppInfoImpl->GetType().GetPointer());
+               return false;
+       }
+       #endif
+
+       WriteLanguageValue(pNameList, label);
+
+       if (pAppInfoImpl->GetMainmenuIcon().IsEmpty() == false)
+       {
+               String iconPath;
+               iconPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_ICONS, pAppInfoImpl->GetMainmenuIcon().GetPointer());
+
+               __pWriter->StartElement("icon");
+               __pWriter->WriteString(iconPath);
+               __pWriter->EndElement();
+       }
+
+       WriteAppControl(pAppInfoImpl);
+       WriteAppControl(index);
+
+       __pWriter->EndElement();
+
+       if (pAppInfoImpl->GetType() == L"ServiceApp")
+       {
+               WriteLiveboxes(pAppInfoImpl);
+       }
+
+       return true;
+}
+
+bool
+ManifestGenerator::WriteSubModeApp(int index)
+{
+       _PackageInfoImpl *pPackageInfoImpl = null;
+       pPackageInfoImpl = __pContext->GetPackageInfoImpl();
+
+       String binaryPath;
+       binaryPath.Format(1024, L"%ls%ls/%ls", pPackageInfoImpl->GetAppRootPath().GetPointer(), DIR_BIN, SUB_MODE_APPCONTROL_NAME);
+
+       String binaryExecPath = binaryPath + ".exe";
+
+       InstallerUtil::Copy(UIAPP_LOADER_PATH, binaryExecPath);
+       InstallerUtil::ChangeMode(binaryExecPath, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH);
+
+       if (File::IsFileExist(binaryPath) == true)
+       {
+               InstallerUtil::Remove(binaryPath);
+       }
+
+       InstallerUtil::CreateSymlink(binaryExecPath, binaryPath);
+
+       IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+       TryReturn(pAppDataList, false, "[osp-installer] pAppDataList is null");
+
+       AppLogTag(OSP_INSTALLER, "WriteSubModeApp(): appCount=%d", pAppDataList->GetCount());
+
+       AppData* pAppData = null;
+       pAppDataList->GetAt(index, pAppData);
+       TryReturn(pAppData, false, "[osp-installer] pAppData is null");
+
+       PackageId packageId = __pContext->GetAppId();
+       AppId appId = packageId + L"." + SUB_MODE_APPCONTROL_NAME;
+
+       __pWriter->StartElement("ui-application");
+       __pWriter->WriteAttribute("appid", appId);
+       __pWriter->WriteAttribute("exec", binaryPath);
+       __pWriter->WriteAttribute("nodisplay", "true");
+       __pWriter->WriteAttribute("taskmanage", "false");
+       __pWriter->WriteAttribute("multiple", "true");
+       __pWriter->WriteAttribute("type", "c++app");
+
+       WriteAppControl(index);
+
+       __pWriter->EndElement();        // end of "ui-application"
+
+       return true;
+}
+
+bool
+ManifestGenerator::WriteAppControl(int index)
+{
+       IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+       TryReturn(pAppDataList, false, "[osp-installer] pAppDataList is null");
+
+       AppData* pAppData = null;
+       pAppDataList->GetAt(index, pAppData);
+       TryReturn(pAppData, false, "[osp-installer] pAppData is null");
+
+       if (pAppData->__pAppControlData)
+       {
+               if (pAppData->__pAppControlData->__pOperationDataList)
+               {
+                       int operationCount = pAppData->__pAppControlData->__pOperationDataList->GetCount();
+
+                       for (int i = 0; i < operationCount; i++)
+                       {
+                               OperationData* pOperationData = null;
+                               pAppData->__pAppControlData->__pOperationDataList->GetAt(i, pOperationData);
+
+                               if (pOperationData == null) continue;
+
+                               __pWriter->StartElement("application-service");
+                               __pWriter->StartElement("operation");
+                               __pWriter->WriteAttribute("name", pOperationData->__id);
+                               __pWriter->EndElement();        // end of "operation"
+
+                               if (pOperationData->__uri.IsEmpty() == false)
+                               {
+                                       __pWriter->StartElement("uri");
+                                       __pWriter->WriteAttribute("name", pOperationData->__uri);
+                                       __pWriter->EndElement();
+                               }
+
+                               if (pOperationData->__mimeType.IsEmpty() == false)
+                               {
+                                       __pWriter->StartElement("mime");
+                                       __pWriter->WriteAttribute("name", pOperationData->__mimeType);
+                                       __pWriter->EndElement();
+                               }
+
+                               __pWriter->EndElement();        // end of ""application-service""
+                       }
+               }
+       }
+
+       return true;
+}
+
old mode 100644 (file)
new mode 100755 (executable)
index ba56ccb..2394feb
@@ -59,6 +59,10 @@ private:
        bool WriteCategory(int index) const;
        bool FindCategory(int index, const Tizen::Base::String& category) const;
 
+       bool WriteApp(int index, Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl);
+       bool WriteSubModeApp(int index);
+       bool WriteAppControl(int index);
+
 private:
        InstallationContext* __pContext;
        Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
index e745dee..aa52b1c 100755 (executable)
@@ -61,6 +61,8 @@ ManifestHandler::ManifestHandler(void)
 ,__isDefaultName(false)
 ,__isDefaultAppDetected(false)
 ,__pAppData(null)
+,__pSubModeAppControlData(null)
+,__pOperationData(null)
 {
 }
 
@@ -162,6 +164,10 @@ ManifestHandler::OnStartElement(const char *pName)
        {
                status = OnContentStartElement();
        }
+       else if (strcasecmp(pName, "Operation") == 0)
+       {
+               status = OnOperationStartElement();
+       }
 
        if (!status)
        {
@@ -220,7 +226,7 @@ ManifestHandler::OnEndElement(const char *pName)
        }
        else if (strcasecmp(pName, "Apps") == 0)
        {
-               AppLogTag(OSP_INSTALLER, "</%s>", pName);
+               status = OnAppsEndElement();
        }
        else if (strcasecmp(pName, "UiScalability") == 0)
        {
@@ -250,6 +256,10 @@ ManifestHandler::OnEndElement(const char *pName)
        {
                status = OnManifestEndElement();
        }
+       else if (strcasecmp(pName, "Operation") == 0)
+       {
+               status = OnOperationEndElement();
+       }
 
        if (!status)
        {
@@ -332,6 +342,14 @@ ManifestHandler::OnCharacters(const char *pCharacters)
        {
                status = OnCategoryValue(pCharacters);
        }
+       else if (strcasecmp(pName, "MimeType") == 0)
+       {
+               status = OnMimeTypeValue(pCharacters);
+       }
+       else if (strcasecmp(pName, "Uri") == 0)
+       {
+               status = OnUriValue(pCharacters);
+       }
 
        if (!status)
        {
@@ -406,20 +424,20 @@ ManifestHandler::OnUiAppStartElement(void)
                }
 
                AddAppFeature("MainmenuVisible", pMainmenuVisible);
-               AppLogTag(OSP_INSTALLER, "<MainmenuVisible=%s>", pMainmenuVisible);
+               AppLogTag(OSP_INSTALLER, " - MainmenuVisible=%s", pMainmenuVisible);
        }
 
        char* pGlFrame = pAttr->Find("GlFrame");
        if (pGlFrame)
        {
                AddAppFeature("GlFrame", pGlFrame);
-               AppLogTag(OSP_INSTALLER, "<GlFrame=%s>", pGlFrame);
+               AppLogTag(OSP_INSTALLER, " - GlFrame=%s", pGlFrame);
        }
 
        char* pCategory = pAttr->Find("Category");
        if (pCategory)
        {
-               AppLogTag(OSP_INSTALLER, "<Category=%s>", pCategory);
+               AppLogTag(OSP_INSTALLER, " - Category=%s", pCategory);
 
                if (strcasecmp(pCategory, "home-screen") == 0)
                {
@@ -440,6 +458,16 @@ ManifestHandler::OnUiAppStartElement(void)
                // __pPackageAppInfoImpl->SetAppFeature(categoryType);
        }
 
+       char* pSubMode = pAttr->Find("SubMode");
+       if (pSubMode)
+       {
+               if (strcasecmp(pSubMode, "True") == 0)
+               {
+                       __pContext->__isSubMode = true;
+                       AppLogTag(OSP_INSTALLER, " - SubMode=%s", pSubMode);
+               }
+       }
+
        String app_id;
        if (__pContext->GetPackageNameType() == INSTALLER_PREFIX_TYPE_ORG)
        {
@@ -780,6 +808,28 @@ ManifestHandler::OnResolutionStartElement(void)
 }
 
 bool
+ManifestHandler::OnOperationStartElement(void)
+{
+       XmlAttribute *pAttr = null;
+       char *pId = null;
+
+       pAttr = GetAttribute();
+       TryReturn(pAttr, true, "[osp-installer] pAttr is null");
+
+       pId = pAttr->Find("Id");
+       TryReturn(pId, true, "[osp-installer] pId is null");
+
+       __pOperationData = new (std::nothrow) OperationData;
+       TryReturn(__pOperationData, false, "[osp-installer] __pOperationData is null");
+
+       __pOperationData->__id = pId;
+
+       AppLogTag(OSP_INSTALLER, "<Operation Id=\"%s\">", pId);
+
+       return true;
+}
+
+bool
 ManifestHandler::OnDataControlStartElement(void)
 {
        XmlAttribute *pAttr = null;
@@ -961,6 +1011,25 @@ ManifestHandler::OnServiceAppEndElement(void)
 }
 
 bool
+ManifestHandler::OnAppsEndElement(void)
+{
+       if (__pContext->__isSubMode == true)
+       {
+               __pAppData = new (std::nothrow) AppData;
+               TryReturn(__pAppData, false, "[osp-installer] __pAppData is null");
+
+               __pAppData->__pAppControlData = __pSubModeAppControlData;
+               __pSubModeAppControlData = null;
+
+               __pContext->__pAppDataList->Add(__pAppData);
+       }
+
+       AppLogTag(OSP_INSTALLER, "</Apps>");
+
+       return true;
+}
+
+bool
 ManifestHandler::OnIconsEndElement(void)
 {
        delete[] __pDefaultIconType;
@@ -977,6 +1046,12 @@ ManifestHandler::OnAppControlEndElement(void)
        __pAppControlInfoImpl = null;
        AppLogTag(OSP_INSTALLER, "</AppControl>");
 
+       if (__pContext->__isSubMode == true)
+       {
+               __pSubModeAppControlData = __pAppData->__pAppControlData;
+               __pAppData->__pAppControlData = null;
+       }
+
        return true;
 }
 
@@ -1004,6 +1079,14 @@ ManifestHandler::OnResolutionEndElement(void)
 }
 
 bool
+ManifestHandler::OnOperationEndElement(void)
+{
+       __pAppData->__pAppControlData->__pOperationDataList->Add(__pOperationData);
+
+       return true;
+}
+
+bool
 ManifestHandler::OnDataControlEndElement(void)
 {
        __pPackageAppInfoImpl->AddDataControl(__pDataControlInfoImpl);
@@ -1447,6 +1530,25 @@ ManifestHandler::OnCategoryValue(const char *pCharacters)
 }
 
 bool
+ManifestHandler::OnMimeTypeValue(const char* pCharacters)
+{
+       __pOperationData->__mimeType = pCharacters;
+
+       AppLogTag(OSP_INSTALLER, "<MimeType>%s</MimeType>", pCharacters);
+       return true;
+}
+
+bool
+ManifestHandler::OnUriValue(const char* pCharacters)
+{
+       __pOperationData->__uri = pCharacters;
+
+       AppLogTag(OSP_INSTALLER, "<Uri>%s</Uri>", pCharacters);
+       return true;
+
+}
+
+bool
 ManifestHandler::FindElement(const char *pName)
 {
        bool res = false;
index a15ccb8..146ec6b 100755 (executable)
@@ -66,6 +66,7 @@ private:
        bool OnAppControlStartElement(void);
        bool OnCapabilityStartElement(void);
        bool OnResolutionStartElement(void);
+       bool OnOperationStartElement(void);
        bool OnDataControlStartElement(void);
 
        bool OnContentsStartElement(void);
@@ -77,6 +78,7 @@ private:
        bool OnPrivilegesEndElement(void);
        bool OnUiAppEndElement(void);
        bool OnServiceAppEndElement(void);
+       bool OnAppsEndElement(void);
        bool OnIconsEndElement(void);
        bool OnUiScalabilityEndElement(void);
        bool OnUiThemeEndElement(void);
@@ -84,6 +86,7 @@ private:
        bool OnAppControlEndElement(void);
        bool OnCapabilityEndElement(void);
        bool OnResolutionEndElement(void);
+       bool OnOperationEndElement(void);
        bool OnDataControlEndElement(void);
        bool OnDataControlTypeEndElement(void);
        bool OnConditionEndElement(void);
@@ -113,6 +116,9 @@ private:
        bool OnInstallationLocationValue(const char *pCharacters);
        bool OnCategoryValue(const char *pCharacters);
 
+       bool OnMimeTypeValue(const char* pCharacters);
+       bool OnUriValue(const char* pCharacters);
+
        // help functions
        bool FindElement(const char *pName);
        bool AddAppFeature(const Tizen::Base::String& name, const Tizen::Base::String& value);
@@ -144,6 +150,8 @@ private:
        bool __isDefaultAppDetected;
 
        AppData* __pAppData;
+       AppControlData* __pSubModeAppControlData;
+       OperationData* __pOperationData;
 
 }; // ManifestHandler