#include "InstallerUtil.h"
-#define OSP_INSTALLER_VERSION "version=[20130226.2]"
+#define OSP_INSTALLER_VERSION "version=[20130226.3]"
#define DIR_BIN L"/bin"
#define DIR_INFO L"/info"
:__pCategoryList(null)
,__pAccountDataList(null)
,__pAppControlDataList(null)
+,__pAppControlImplList(null)
+,__pDataControlList(null)
+,__pSubModeAppControlDataList(null)
+,__pNameList(null)
+,__pFeatureList(null)
+,__pLaunchConditionList(null)
+,__pNotificationMap(null)
,__feature(0)
,__isSubMode(false)
,__legacyAppControls(false)
,__isSystemService(false)
+,__mainmenuVisible(false)
{
}
__pLaunchConditionList->RemoveAll();
delete __pLaunchConditionList;
}
+
+ if (__pNotificationMap)
+ {
+ __pNotificationMap->RemoveAll();
+ delete __pNotificationMap;
+ }
}
InstallerError
r = __pLaunchConditionList->Construct();
TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pLaunchConditionList->Construct() failed.");
+ __pNotificationMap = new (std::nothrow) HashMap(SingleObjectDeleter);
+ TryReturn(__pNotificationMap, INSTALLER_ERROR_OUT_OF_MEMORY, "__pNotificationMap is null.");
+ r = __pNotificationMap->Construct();
+ TryReturn(!IsFailed(r), INSTALLER_ERROR_OUT_OF_MEMORY, "__pNotificationMap->Construct() failed.");
+
return INSTALLER_ERROR_NONE;
}
Tizen::Base::Collection::HashMap* __pNameList;
Tizen::Base::Collection::HashMap* __pFeatureList;
Tizen::Base::Collection::HashMap* __pLaunchConditionList;
+ Tizen::Base::Collection::HashMap* __pNotificationMap;
int __feature;
WriteAppControl(index);
}
- __pWriter->EndElement();
+ __pWriter->EndElement(); // end of "ui-application"
if (pAppData->__type == L"ServiceApp")
{
}
WriteAccounts(index);
+ WriteNotifications(index);
return true;
}
TryReturn(pAccountDataList, false, "pAccountDataList is null");
int accountCount = pAccountDataList->GetCount();
- if (accountCount == 0)
+ if (accountCount <= 0)
{
return true;
}
return true;
}
+
+bool
+ManifestGenerator::WriteNotifications(int index)
+{
+ IListT<AppData*>* pAppDataList = __pContext->__pAppDataList;
+ TryReturn(pAppDataList, false, "pAppDataList is null");
+
+ AppData* pAppData = null;
+ pAppDataList->GetAt(index, pAppData);
+ TryReturn(pAppData, false, "pAppData is null");
+
+ HashMap* pNotificationMap = pAppData->__pNotificationMap;
+ TryReturn(pNotificationMap, false, "pNotificationMap is null");
+
+ int count = pNotificationMap->GetCount();
+ if (count <= 0)
+ {
+ return true;
+ }
+
+ IMapEnumerator* pMapEnum = pNotificationMap->GetMapEnumeratorN();
+ TryReturn(pMapEnum, false, "pMapEnum is null");
+
+ __pWriter->StartElement("notifications");
+ __pWriter->WriteAttribute("appid", pAppData->__appId);
+
+ while (pMapEnum->MoveNext() == E_SUCCESS)
+ {
+ String* pKey = null;
+ String* pValue = null;
+
+ pKey = static_cast<String*> (pMapEnum->GetKey());
+ pValue = static_cast<String*> (pMapEnum->GetValue());
+
+ __pWriter->StartElement("notification");
+ __pWriter->WriteAttribute("section", *pKey);
+ __pWriter->WriteString(*pValue);
+ __pWriter->EndElement(); // end of "notification"
+ }
+
+ __pWriter->EndElement(); // end of "notifications"
+
+ delete pMapEnum;
+ return true;
+}
bool WriteSubModeApp(int index, AppData* pAppData);
bool WriteAppControl(int index, bool subMode = false);
bool WriteAccounts(int index);
+ bool WriteNotifications(int index);
private:
InstallationContext* __pContext;
ManifestHandler::OnNotificationValue(const char *pCharacters)
{
XmlAttribute *pAttr = null;
- char *pName = null;
+ const char *pName = null;
pAttr = GetAttribute();
- TryReturn(pAttr, true, "pAttr is null");
+ TryReturn(pAttr, true, "pAttr is null.");
pName = pAttr->Find("Name");
- TryReturn(pName, true, "pName is null");
+ TryReturn(pName, true, "pName is null.");
+
+ if (strcasecmp(pName, "Ticker") == 0)
+ {
+ pName = "Notification";
+ }
+ else if (strcasecmp(pName, "Notification") == 0 || strcasecmp(pName, "Sounds") == 0
+ || strcasecmp(pName, "Badge") == 0 || strcasecmp(pName, "Contents") == 0)
+ {
+ // known notification attributes
+ }
+ else
+ {
+ TryReturn(0, true, "Unknown notification attributes=%s", pCharacters);
+ }
+
+ String* pKey = new (std::nothrow) String(pName);
+ TryReturn(pKey, false, "pKey is null.");
+
+ String* pValue = new (std::nothrow) String(pCharacters);
+ TryReturn(pValue, false, "pValue is null.");
+
+ pKey->ToLowerCase();
+ pValue->ToLowerCase();
+ __pAppData->__pNotificationMap->Add(pKey, pValue);
AppLog("<Notification Name=\"%s\", Value=\"%s\">", pName, pCharacters);
return true;