Tizen::Graphics::Bitmap* GetAppMenuIconN(void) const;
- Tizen::Base::Collection::IMap* GetAppMetadataListN(void) const;
+ Tizen::Base::Collection::HashMap* GetAppMetadataListN(void) const;
Tizen::Base::Collection::ArrayList* GetAppCategoryListN(void) const;
bool IsMenuIconVisible(void) const;
private:
static int CategoryHandler(const char* pCategoryName, void* pUserData);
+ static int MetadataHandler(const char* pKey, const char* pValue, void* pUserData);
private:
_PackageAppInfoImpl(const _PackageAppInfoImpl& value);
return null;
}
-IMap*
+HashMap*
_PackageAppInfoImpl::GetAppMetadataListN(void) const
{
- return null;
+ HashMap* pMap = null;
+
+ if (__fromDatabase)
+ {
+ SysTryReturn(NID_APP, __pAppInfoHandle, null, E_SYSTEM, "__pAppInfoHandle is null.");
+
+ result r = E_SUCCESS;
+ int res = PMINFO_R_OK;
+
+ pMap = new (std::nothrow) HashMap();
+ SysTryReturn(NID_APP, pMap, null, E_OUT_OF_MEMORY, "ArrayList creation failure.");
+ pMap->Construct();
+
+ res = pkgmgrinfo_appinfo_foreach_metadata(__pAppInfoHandle, MetadataHandler, pMap);
+ if (res != PMINFO_R_OK)
+ {
+ SysLog(NID_APP, "pkgmgrinfo_appinfo_foreach_metadata() is failed. result = [%d]", res);
+ r = E_SYSTEM;
+
+ pMap->RemoveAll(true);
+ pMap = null;
+ }
+
+ SetLastResult(r);
+ }
+ else
+ {
+ SysLog(NID_APP, "GetAppMetadataListN() is not available.");
+ }
+
+ return pMap;
}
ArrayList*
return 0;
}
+int
+_PackageAppInfoImpl::MetadataHandler(const char* pKey, const char* pValue, void* pUserData)
+{
+ SysTryReturn(NID_APP, pKey, 0, E_SYSTEM, "pKey must not be null.");
+ SysTryReturn(NID_APP, pValue, 0, E_SYSTEM, "pValue must not be null.");
+ SysTryReturn(NID_APP, pUserData, 0, E_SYSTEM, "pUserData must not be null.");
+
+ SysLog(NID_APP, "Key = [%s], Value = [%s]", pKey, pValue);
+
+ MultiHashMap* pMultiMap = (MultiHashMap*) pUserData;
+ pMultiMap->Add(*(new (std::nothrow) String(pKey)), *(new (std::nothrow) String(pValue)));
+
+ return 0;
+}
+
// to be reviewed
_PackageAppInfoImpl::_PackageAppInfoImpl(void)
: __launchingIconVisible(true)
#include <FIoDbEnumerator.h>
#include <FIoDbStatement.h>
#include <FBaseSysLog.h>
+#include <FSecPrivilegeInfo.h>
#include <FBase_StringConverter.h>
#include <FBaseUtilStringTokenizer.h>
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
-using namespace Tizen::Io;
using namespace Tizen::Base::Utility;
+using namespace Tizen::Io;
+using namespace Tizen::Security;
namespace Tizen { namespace App { namespace Package
{
String* pPrivilege = dynamic_cast <String*>(__pPrivilegeList->GetAt(i));
if (pPrivilege)
{
- String* pPrivilegeString = new (std::nothrow) String(*pPrivilege);
- SysTryReturn(NID_APP, pPrivilegeString, null, E_OUT_OF_MEMORY, "pPrivilegeString must not be null.");
+ PrivilegeInfo* pPrivilegeInfo = new (std::nothrow) PrivilegeInfo;
+ SysTryReturn(NID_APP, pPrivilegeInfo, null, E_OUT_OF_MEMORY, "pPrivilegeInfo must not be null.");
+
+ pPrivilegeInfo->Construct(*pPrivilege);
- r = pPrivilegeList->Add(*pPrivilegeString);
+ r = pPrivilegeList->Add(*pPrivilegeInfo);
}
}