//
-// Open Service Platform
// Copyright (c) 2012 Samsung Electronics Co., Ltd.
//
// Licensed under the Apache License, Version 2.0 (the License);
#include <unique_ptr.h>
#include <FSecPrivacyInfo.h>
#include <FBaseSysLog.h>
+#include <FBase_StringConverter.h>
#include <FSec_AccessController.h>
+#include <privacy_info_client.h>
#include "FSec_PrivacyInfoImpl.h"
using namespace Tizen::Base;
String
_PrivacyInfoImpl::GetDisplayName(void) const
{
- String privacyURI = L"http://tizen.org/privacy/";
String displayName;
- __privacyId.SubString(privacyURI.GetLength(), displayName);
+ int ret = PRIV_MGR_ERROR_SUCCESS;
+ char* pPrivacyDisplayName;
+ privacy_info_client_s privacyInfo;
+
+ std::unique_ptr<char[]> pPrivacyId(null);
+ pPrivacyId.reset(_StringConverter::CopyToCharArrayN(__privacyId));
+ SysTryReturn(NID_SEC, pPrivacyId != null, displayName, E_SYSTEM, "[E_SYSTEM] An unexpected system error occurred.");
+
+ privacyInfo.privacy_id = pPrivacyId.get();
+ ret = privacy_info_client_get_privacy_display_name(&privacyInfo, &pPrivacyDisplayName);
+ SysTryReturn(NID_SEC, ret == PRIV_MGR_ERROR_SUCCESS, displayName, E_SYSTEM, "[E_SYSTEM] An unexpected system error occurred.");
+ displayName.Append(pPrivacyDisplayName);
+
+ if (pPrivacyDisplayName != null)
+ {
+ free(pPrivacyDisplayName);
+ }
return displayName;
}
String
_PrivacyInfoImpl::GetDescription(void) const
{
- String description("undefined");
+ String description("Undefined");
return description;
}