diff options
author | Duyoung Jang <duyoung.jang@samsung.com> | 2012-10-10 19:35:04 +0900 |
---|---|---|
committer | Duyoung Jang <duyoung.jang@samsung.com> | 2012-10-10 19:35:04 +0900 |
commit | 3efabba92b137535498ec40e5e94ed9e75ebe542 (patch) | |
tree | 655898e5d51d96913ea852684391bc4e672011dd /src | |
parent | 5bba03dd48a930243c475ed860dea850bef2a75f (diff) | |
download | installer-3efabba92b137535498ec40e5e94ed9e75ebe542.tar.gz installer-3efabba92b137535498ec40e5e94ed9e75ebe542.tar.bz2 installer-3efabba92b137535498ec40e5e94ed9e75ebe542.zip |
Apply category for ime, home-screen, lock-screen
Change-Id: Ifda8a6d7f69fd3db673f5d880d87b1e621d7d174
Diffstat (limited to 'src')
-rwxr-xr-x | src/Context/InstallationContext.cpp | 12 | ||||
-rwxr-xr-x | src/Context/InstallationContext.h | 4 | ||||
-rwxr-xr-x | src/Manager/ConfigurationManager.cpp | 56 | ||||
-rwxr-xr-x | src/Manager/ConfigurationManager.h | 1 | ||||
-rwxr-xr-x | src/XmlHandler/ManifestGenerator.cpp | 27 | ||||
-rwxr-xr-x | src/XmlHandler/ManifestHandler.cpp | 8 |
6 files changed, 104 insertions, 4 deletions
diff --git a/src/Context/InstallationContext.cpp b/src/Context/InstallationContext.cpp index 7b34d70..3351cf8 100755 --- a/src/Context/InstallationContext.cpp +++ b/src/Context/InstallationContext.cpp @@ -353,6 +353,18 @@ InstallationContext::SetAppVersion(const String& appVersion) __appVersion = appVersion; } +const String& +InstallationContext::GetCategory(void) const +{ + return __category; +} + +void +InstallationContext::SetCategory(const String& category) +{ + __category = category; +} + String InstallationContext::GetManifestXmlPath(void) { diff --git a/src/Context/InstallationContext.h b/src/Context/InstallationContext.h index a030b4e..b87fd8e 100755 --- a/src/Context/InstallationContext.h +++ b/src/Context/InstallationContext.h @@ -105,6 +105,9 @@ public: const Osp::Base::String& GetAppVersion(void) const; void SetAppVersion(const Osp::Base::String& appVersion); + const Osp::Base::String& GetCategory(void) const; + void SetCategory(const Osp::Base::String& category); + Osp::Base::String GetManifestXmlPath(void); Osp::Base::String GetSignatureXmlPath(void); @@ -146,6 +149,7 @@ private: Osp::Base::String __appId; Osp::Base::String __appVersion; Osp::Base::String __appRootPath; + Osp::Base::String __category; Osp::Base::Collection::ArrayList* __pPrivilegeList; RootCertificateType __rootCertType; diff --git a/src/Manager/ConfigurationManager.cpp b/src/Manager/ConfigurationManager.cpp index 525b029..56971dd 100755 --- a/src/Manager/ConfigurationManager.cpp +++ b/src/Manager/ConfigurationManager.cpp @@ -27,6 +27,8 @@ #include <FBaseUtilStringUtil.h> #include <FIoFile.h> +#include <FIoDirectory.h> +#include <FApp_Aul.h> #include <FApp_PackageInfoImpl.h> #include <FApp_PackageManagerImpl.h> #include <FBase_StringConverter.h> @@ -156,6 +158,27 @@ ConfigurationManager::CreateFile(InstallationContext* pContext) uiScalabilityInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), UISCALABILITY_INFO_FILE); CreateInfoFile(uiScalabilityInfoFile, &uiScalability); + + if (pContext->GetCategory().IsEmpty() == false) + { + String category = pContext->GetCategory(); + category.ToLowerCase(); + + int type = _Aul::GetAppType(category); + + if (category == L"ime") + { + CreateImeSymlink(binaryPath, appName); + } + + String typeInfo; + typeInfo.Format(1024, L"%d", type); + + String typeInfoFile; + typeInfoFile.Format(1024, L"%ls%ls", rootPath.GetPointer(), TYPE_INFO_FILE); + + CreateInfoFile(typeInfoFile, &typeInfo); + } } else if (appType == L"ServiceApp") { @@ -405,6 +428,39 @@ ConfigurationManager::CreateInfoFile(const String& filePath, const String* pCont } bool +ConfigurationManager::CreateImeSymlink(const String& binaryPath, const String& appName) +{ + bool res = true; + int err = 0; + const char* pExePath = null; + const char* pSymlinkPath = null; + + Directory::Create(IME_PATH, true); + + String exePath; + exePath.Format(1024, L"%ls.exe", binaryPath.GetPointer()); + + String symlinkPath; + symlinkPath.Format(1024, L"%s/%ls.so", IME_PATH, appName.GetPointer()); + + pExePath = _StringConverter::CopyToCharArrayN(exePath); + TryCatch(pExePath, res = false, "[osp-installer] pExePath is null"); + + pSymlinkPath = _StringConverter::CopyToCharArrayN(symlinkPath); + TryCatch(pSymlinkPath, res = false, "[osp-installer] pSymlinkPath is null"); + + err = symlink(pExePath, pSymlinkPath); + + AppLogTag(OSP_INSTALLER, "[%s] -> [%s]", pSymlinkPath, pExePath); + +CATCH: + delete[] pExePath; + delete[] pSymlinkPath; + + return res; +} + +bool ConfigurationManager::FindPrivilege(InstallationContext* pContext, const String& privilege) const { TryReturn(pContext, false, "[osp-installer] pContext is null."); diff --git a/src/Manager/ConfigurationManager.h b/src/Manager/ConfigurationManager.h index d5e7dc9..f4a7111 100755 --- a/src/Manager/ConfigurationManager.h +++ b/src/Manager/ConfigurationManager.h @@ -49,6 +49,7 @@ private: bool CreateSystemXmlFile(InstallationContext* pContext); bool CreateHybridServiceDesktopFile(InstallationContext* pContext); bool CreateInfoFile(const Osp::Base::String& filePath, const Osp::Base::String* pContext); + bool CreateImeSymlink(const Osp::Base::String& binaryPath, const Osp::Base::String& appName); bool FindPrivilege(InstallationContext* pContext, const Osp::Base::String& privilege) const; }; // ConfigurationManager diff --git a/src/XmlHandler/ManifestGenerator.cpp b/src/XmlHandler/ManifestGenerator.cpp index 4883b12..1c381bb 100755 --- a/src/XmlHandler/ManifestGenerator.cpp +++ b/src/XmlHandler/ManifestGenerator.cpp @@ -20,6 +20,7 @@ */ #include <FLclLocale.h> +#include <FApp_Aul.h> #include <FApp_PackageInfoImpl.h> #include "ManifestGenerator.h" @@ -57,7 +58,7 @@ ManifestGenerator::Construct(InstallationContext* pContext) bool ManifestGenerator::Write() { - bool preload = false; //__pContext->IsPreloaded(); + //bool preload = false; //__pContext->IsPreloaded(); String xmlPath; String package; String location; @@ -132,18 +133,31 @@ ManifestGenerator::Write() // temp String nodisplay("true"); String taskmanage("false"); + String category; if (pAppInfoImpl->GetType() == L"UiApp") { - taskmanage = "true"; + taskmanage = L"true"; if (pAppInfoImpl->IsMainmenuVisible() == true) { - nodisplay = "false"; + nodisplay = L"false"; } else { - nodisplay = "true"; + nodisplay = L"true"; + } + + if (__pContext->GetCategory().IsEmpty() == false) + { + category.Format(1024, L"%ls", __pContext->GetCategory().GetPointer()); + category.ToLowerCase(); + + if (_Aul::GetAppType(category) != 0) + { + taskmanage = L"false"; + nodisplay = L"true"; + } } } @@ -155,6 +169,11 @@ ManifestGenerator::Write() __pWriter->WriteAttribute("multiple", "false"); __pWriter->WriteAttribute("type", type); + if (category.IsEmpty() == false) + { + __pWriter->WriteAttribute("categories", category); + } + #if 0 if (pAppInfoImpl->GetType() == L"UiApp") { diff --git a/src/XmlHandler/ManifestHandler.cpp b/src/XmlHandler/ManifestHandler.cpp index 3bfaaa2..a56896d 100755 --- a/src/XmlHandler/ManifestHandler.cpp +++ b/src/XmlHandler/ManifestHandler.cpp @@ -969,6 +969,7 @@ ManifestHandler::OnUiAppElement(void) char *pExecutableName = null; char *pDefault = null; char *pMainmenuVisible = null; + char *pCategory = null; __pPackageAppInfoImpl = new _PackageAppInfoImpl; TryReturn(__pPackageAppInfoImpl, false, "[osp-installer] __pPackageAppInfoImpl is null"); @@ -1038,6 +1039,13 @@ ManifestHandler::OnUiAppElement(void) __pPackageAppInfoImpl->SetPackageName(app_id); + pCategory = pAttr->Find("Category"); + if (pCategory) + { + AppLogTag(OSP_INSTALLER, "<Category=%s>", pCategory); + __pContext->SetCategory(pCategory); + } + AppLogTag(OSP_INSTALLER, "app_id = %S", app_id.GetPointer()); AppLogTag(OSP_INSTALLER, "<UiApp Name=\"%s\" Default=\"%s\">", pExecutableName, pDefault ? pDefault:"False"); |