SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/output")
INCLUDE_DIRECTORIES(
+ inc
+ src/Context
+ src/Installer
+ src/Manager
+ src/XmlHandler
+ src/Step
+ src/Util
/usr/include/glib-2.0
/usr/lib/glib-2.0/include
/usr/include/dlog
/usr/include/libxml2
/usr/include/system
/usr/include/drm-intel
- inc
- src/Context
- src/Installer
- src/Manager
- src/XmlHandler
- src/Step
- src/Util
)
SET (${this_target}_SOURCE_FILES
#ifndef _INSTALLER_DEFS_H_
#define _INSTALLER_DEFS_H_
-#define OSP_INSTALLER_VERSION "osp-installer version = [2012/12/12]_RC[2]"
+#define OSP_INSTALLER_VERSION "osp-installer version = [2012/12/17]_RC[1]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
using namespace Tizen::App::Package;
InstallationContext::InstallationContext(void)
-:__pStep(null)
+:__pAppDataList(null)
+,__pStep(null)
,__pDrmLicense(null)
,__error(INSTALLER_ERROR_NONE)
,__step(INSTALLER_STEP_NONE)
delete __pLiveBoxList;
__pLiveBoxList = null;
}
+
+ __pAppDataList->RemoveAll();
+ __pAppDataList = null;
}
InstallerError
InstallationContext::Construct(void)
{
- __pPackageInfoImpl = new _PackageInfoImpl();
+ __pPackageInfoImpl = new (std::nothrow) _PackageInfoImpl();
TryReturn(__pPackageInfoImpl, INSTALLER_ERROR_MEMORY, "[osp-installer] __pPackageInfoImpl is null.");
+ __pAppDataList = new (std::nothrow) ArrayListT<AppData*>;
+ TryReturn(__pAppDataList, INSTALLER_ERROR_MEMORY, "[osp-installer] __pAppDataList is null");
+
return INSTALLER_ERROR_NONE;
}
return __pNameList;
}
+AppData::AppData()
+:__pCategoryList(null)
+{
+ __pCategoryList = new (std::nothrow) ArrayListT<String*>;
+
+}
+
+AppData::~AppData()
+{
+ __pCategoryList->RemoveAll();
+ delete __pCategoryList;
+}
class IInstallationStep;
+class PackageData
+ : public Tizen::Base::Object
+{
+public:
+ PackageData(){};
+ virtual ~PackageData(){};
+
+};
+
+class AppData
+ : public Tizen::Base::Object
+{
+public:
+ AppData();
+ virtual ~AppData();
+
+ Tizen::Base::Collection::IListT<Tizen::Base::String *>* __pCategoryList;
+
+private:
+};
/**
* @class InstallationContext
* @brief This class represents the class of InstallationContext.
Tizen::App::Package::_PackageInfoImpl* GetPackageInfoImpl(void) const;
+ PackageData __packageData;
+ Tizen::Base::Collection::IListT<AppData *>* __pAppDataList;
+
private:
InstallationContext(const InstallationContext& value);
InstallationContext& operator =(const InstallationContext& source);
nodisplay = L"true";
}
- int categoryType = pAppInfoImpl->GetAppFeature();
-
- if (categoryType != CATEGORY_TYPE_NONE)
+ if (FindCategory(i, "http://tizen.org/category/ime") == true)
{
- category = InstallerUtil::GetCategory(categoryType);
- category.ToLowerCase();
-
- if (_Aul::GetAppType(category) != 0)
- {
- taskmanage = L"false";
- nodisplay = L"true";
- }
+ AppLogTag(OSP_INSTALLER, "Write(): [http://tizen.org/category/ime] is detected. taskmanage=false, nodisplay=true");
+ taskmanage = L"false";
+ nodisplay = L"true";
}
}
__pWriter->WriteAttribute("type", type);
__pWriter->WriteAttribute("hw-acceleration", glFrame);
- if (category.IsEmpty() == false)
- {
- __pWriter->WriteAttribute("categories", category);
- }
+ WriteCategory(i);
#if 0
if (pAppInfoImpl->GetType() == L"UiApp")
return true;
}
+
+bool
+ManifestGenerator::WriteCategory(int index) const
+{
+ IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+ TryReturn(pAppDataList, true, "[osp-installer] pAppDataList is null");
+
+ AppData* pAppData = null;
+ pAppDataList->GetAt(index, pAppData);
+ TryReturn(pAppData, true, "[osp-installer] pAppData is null");
+
+ IListT<String*>* pCategoryList = pAppData->__pCategoryList;
+ TryReturn(pCategoryList, true, "[osp-installer] pCategoryList is null");
+
+ for (int i = 0; i < pCategoryList->GetCount(); i++)
+ {
+ String *pStr = null;
+ pCategoryList->GetAt(i, pStr);
+ TryReturn(pStr, false, "[osp-installer] pStr is null");
+
+ AppLogTag(OSP_INSTALLER, "WriteCategory(): Category String=[%ls]", pStr->GetPointer());
+
+ __pWriter->StartElement("category");
+ __pWriter->WriteAttribute("name", *pStr);
+ __pWriter->EndElement();
+ }
+
+ return true;
+}
+
+bool
+ManifestGenerator::FindCategory(int index, const String& category) const
+{
+ result r = E_SUCCESS;
+
+ IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+ TryReturn(pAppDataList, false, "[osp-installer] pAppDataList is null");
+
+ AppData* pAppData = null;
+ r = pAppDataList->GetAt(index, pAppData);
+ TryReturn(pAppData, false, "[osp-installer] pAppData is null");
+
+ IListT<String*>* pCategoryList = pAppData->__pCategoryList;
+ TryReturn(pCategoryList, false, "[osp-installer] pCategoryList is null");
+
+ for (int i = 0; i < pCategoryList->GetCount(); i++)
+ {
+ String *pStr = null;
+ pCategoryList->GetAt(i, pStr);
+ TryReturn(pStr, false, "[osp-installer] pStr is null");
+
+ if (*pStr == category)
+ {
+ AppLogTag(OSP_INSTALLER, "FindCategory(): Category is found=[%ls]", pStr->GetPointer());
+ return true;
+ }
+
+ }
+
+ return false;
+}
bool WriteAppControl(Tizen::App::Package::_PackageAppInfoImpl* pAppInfoImpl) const;
Tizen::Base::String GetGlFrameValue(Tizen::Base::Collection::ArrayList* pFeatureList) const;
+ bool WriteCategory(int index) const;
+ bool FindCategory(int index, const Tizen::Base::String& category) const;
+
private:
InstallationContext* __pContext;
Tizen::App::Package::_PackageInfoImpl* __pPackageInfoImpl;
,__isDefaultLaunchImage(false)
,__isDefaultName(false)
,__isDefaultAppDetected(false)
+,__pAppData(null)
{
}
__pPackageAppInfoImpl = null;
__isDefaultName = false;
+
+ __pContext->__pAppDataList->Add(__pAppData);
+ __pAppData = null;
+
AppLogTag(OSP_INSTALLER, "</%s>", pName);
}
else if (strcasecmp(pName, "ServiceApp") == 0)
__pPackageAppInfoImpl = null;
__isDefaultName = false;
+
+ __pContext->__pAppDataList->Add(__pAppData);
+ __pAppData = null;
+
AppLogTag(OSP_INSTALLER, "</%s>", pName);
}
else if (strcasecmp(pName, "AppControl") == 0)
{
status = OnInstallationLocationValue(pCharacters);
}
+ else if (strcasecmp(pName, "Category") == 0)
+ {
+ status = OnCategoryValue(pCharacters);
+ }
if (!status)
{
}
bool
+ManifestHandler::OnCategoryValue(const char *pCharacters)
+{
+ TryReturn(__pAppData, false, "[osp-installer] __pAppData is null");
+
+ __pAppData->__pCategoryList->Add(new String(pCharacters));
+ return true;
+}
+
+bool
ManifestHandler::OnAppControlElement(void)
{
XmlAttribute *pAttr = null;
__pPackageAppInfoImpl = new _PackageAppInfoImpl;
TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null");
+ __pAppData = new (std::nothrow) AppData;
+ TryReturn(__pAppData, false, "[osp-installer] __pAppData is null");
+
pAttr = GetAttribute();
TryReturn(pAttr, true, "[osp-installer] pAttr is null");
{
AppLogTag(OSP_INSTALLER, "<Category=%s>", pCategory);
- CategoryType categoryType = InstallerUtil::GetCategoryType(pCategory);
- __pPackageAppInfoImpl->SetAppFeature(categoryType);
+ if (strcasecmp(pCategory, "home-screen") == 0)
+ {
+ // __pCategoryList->Add(new String("home-screen"));
+ __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/homescreen"));
+ }
+ else if (strcasecmp(pCategory, "lock-screen") == 0)
+ {
+ // __pCategoryList->Add(new String("lock-screen"));
+ __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/lockscreen"));
+ }
+ else if (strcasecmp(pCategory, "Ime") == 0)
+ {
+ __pAppData->__pCategoryList->Add(new String("http://tizen.org/category/ime"));
+ }
+
+ // CategoryType categoryType = InstallerUtil::GetCategoryType(pCategory);
+ // __pPackageAppInfoImpl->SetAppFeature(categoryType);
}
String app_id;
__pPackageAppInfoImpl = new _PackageAppInfoImpl;
TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null");
+ __pAppData = new (std::nothrow) AppData;
+ TryReturn(__pAppData, false, "[osp-installer] __pAppData is null");
+
pAttr = GetAttribute();
TryReturn(pAttr, true, "pAttr is null");
bool OnNotificationValue(const char *pCharacters);
bool OnSizeValue(const char *pCharacters);
bool OnInstallationLocationValue(const char *pCharacters);
+ bool OnCategoryValue(const char *pCharacters);
bool OnAppControlElement(void);
bool OnCapabilityElement(void);
bool __isDefaultName;
bool __isDefaultAppDetected;
+ AppData* __pAppData;
+
}; // ManifestHandler
#endif // _MANIFEST_HANDLER_H_